Offline storage management for Android
Theme : Newspaper updates in android application.
How to get or retrieve data from the server and publish updates on an Android application. How to manage offline storage means how the data is updated on the Android app whenever there is no internet connection, at least how it thinks about showing the update on the Android app. If anyone knows this question, please answer it.
I
actually use php
or json
as an intermediate file to get data from the server and send updates to the android app, but it seems more complicated, how do I manage updates if I don’t have permission to access server-side files? Do I need permission to access server files?
More on the topic: If I want to sync the update with the website,
how do I handle or implement it? I’m not asking for any type of coding here.
Solution
How to get or retrieve data from a server and publish updates on an Android app
use HTTPClient.
How to manage offline storage means how to update data on android apps when there is no internet connection
I think you don’t understand what offline storage means. If there is no internet connection, that’s it. You are not able to update your content. Offline storage is useful if you have internet connection, but not everytime. The content you downloaded when you had internet connection can be saved to SQLLite to be loaded when you don’t have internet connection.
actually use php or json as an intermediate file to get data from the server and send updates to the android app, but it seems more complicated, what do I do if I can’t get access to server-side files to manage updates? Do I need permission to access server files?
Create WebService as an interface. Do not let other system to be able to directly access your files. Or just create a PHP files that basically return Json or XML Data.
Other option : create an RSS.More on the topic: If I want to sync the update with the website, how do I handle or implement it? I’m not asking for any type of coding here.
Create an event to start sync using HTTPClient. If there is new update, save it to SQLLite(for offline storage) and display the content. The event can be triggered during the start of your application or clicking refresh button and if Internet exist.
I
Update:
There is a new framework called couchbase mobile. You can synchronize the local mobile database from the couch server. You can insert/update data locally (offline mode), and then the data can also be synced to the sofa server as long as you have an internet connection. This means that you no longer need to create HTTPClient.
For databases, try cloudant