I want to do mobile app (let's say it will be like ebook with some improvements) which content should be changeable for non-programmer user. And this content should not be loaded from web at every time when opening app(so content update take place when: * updating whole app or maybe * app itself checking if content is changed when internet is available).
I want to try do this for multiple platforms (e.g android, ios).
So, basically I am looking mobile app-based CMS, but all I found were expensive.
No, I don't know of a free, open source CMS targeted towards mobile applications, however there are several free CMS for standard web pages, listed here.
Use one of those web-based CMS to edit content through a browser and store it in a database. Create a web service on your server-side to extract the desired content for your Android application. More information in this post.
To change this content on app update, you should first save the application version to SharedPreferences
on app launch, and then check the current version of the application on each subsequent launch. The following code can be used to get the application version:
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
string version = info.versionName;
If the version number has changed, call your web service to pull the new content into your application. If you only want to do this when WiFi is connected, you can do a check using ConnectivityManager
:
ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (wifi.isConnected()) {
// Retrieve data from web server
}
Don't forget the appropriate permission:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />