Hi,
There is a problem deploying an apk created on a version of GST(GMA) different to that used to create an existing apk on the device.
The Android device detects an existing app is being upgraded, but the upgrade attempt always fails.
There is not a problem upgrading apps where the apk is generated from the same GST(GMA) version.
The only workround for this is to delete the existing app on the device and do a fresh install.
This results in the apps database being cleared..... which is obviously not great.
The SQLite db used by the application is embedded in the app itself (as far as i can tell), so when you delete the app the DB goes as well.
We are looking for a way to retain the SQLite db on the device, regardless of whether an upgrade or reinstall of the app occurs.
Anybody any ideas?
With regarding to maintaining data when you upgrade an app, pay attention to the creating first database section as described for GMA and GMI at bottom here ...
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_gma_app_structure.htmlhttp://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_gmi_app_structure.htmland also covered here
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_sql_programming_059.htmlIf you ship a database along with your program objects, it will be placed in the area labelled 'Program Files' in the two directory structure diagrams. When your app is first run, it needs to copy the database to the Writable app files area, so that it is not overwritten when you subsequently upgrade the app. If your app does not ship a database but you create one on first run then again make sure you create it in the Writable app files area. In both cases your apps need to be responsible for how the database is upgraded each time you upgrade the app, either with a new SQLite database file that you unload/load from existing to new, or by a series of ALTER TABLE to turn existing into new, and in doing so you have to consider what happens if a user skips an upgrade (fun)...
You also should consider what happens if you delete and install the app again. All the files in the Application Sandbox will be deleted. With Android you can write to files outside your Application SandBox eg. SD Cards, and that is perhaps one way to preserve data across the delete and reinstall of an app. iOS does have an "Offload App" feature.
With regards your particular issue, does the app upgrade or does it perhaps fail on first run because the database is not as it thinks it is. So first thing I'd check is the version number of the installed app. If that has gone up, you know the install has probably finished, and the problem is when the app is run. If the version number hasn't gone up then the problem is in the install of the upgrade, perhaps certificates as Susobh suggested.
Reuben