How do I implement app updates?

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

How do I implement app updates?

Post by nower » Sun Mar 30, 2014 6:32 pm

How do I implement app updates for users that have my app installed?
I can imagine that an app that was installed manually in a desktop environment could possibly update itself, but I have no idea how it works with app stores.

I guess it may depend on the platform. Is there an option that works on all platforms?
Do Google and Apple mobile stores have specific requirements for app updates?
What about the Mac OS X store and the Windows 8 store?

What happens when an app update is installed?
How does the app know that it is being/was updated?
How do I preserve user data and settings through an update?
How do I make sure that any changes to the user data are applied to the existing data without wiping it out?
Anything else to consider?
Any sample stacks that have the best update mechanisms implemented?

Sorry for the long list of questions, but I am just tapping in the dark about this subject, and I feel it is important to address for a professional app. :?

Thanks,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: How do I implement app updates?

Post by LCNeil » Mon Mar 31, 2014 1:41 pm

Hi Werner,

The various mobile stores take care of the update process for you. In the case of iOS,you would log into iTunes Connect and select the option to create a new version of your application. After you have filled in the required information you will be allowed to upload your app via the "Application Launcher”.

The process is slightly different for Google play in that you create an incremented version of your application, upload this APK to the Google play store and update your store listing.

Initial Deployment to the various stores is explained in Lesson 8 of the coding school course.

As long as you have saved your users data into the applicable directories, then it will remain present when the update their application. There are various special folders that deal with this, with the main persistent folders being “Documents” and “Library” on iOS and only “Documents” on Android.

These folders are sandboxed within the application and are separate from any O/S based directories.

More information on these can be found under the “SpecialFolderPath” dictionary entry.

The only way for this user data not to be used during an update is if the user was to fully remove the application from their device prior to the update. This would result in a fresh version of the application being installed instead of an update.

User will be notified of any updates via the applicable store(i.e by device notification). These notification direct the user to your store listing where they are given the option to update or not.

In regards to Mac OSX app store, although it is possible to submit to the Mac app store with LiveCode application, there can be some sandboxing issues as we currently build via the Carbon framework. This should be resolved with the soon to be release cocoa port of LiveCode.

More information on the Mac App store submission process can be found here-

http://newsletters.livecode.com/novembe ... etter4.php

and here

http://newsletters.livecode.com/june/is ... etter4.php

For Windows 8 store, as LiveCode application do not directly support the tiled interface (metro) of these store Apps, I do not believe it is possible to submit to this store.

More information on Windows 8 store app requirements can be found here-

http://blogs.msdn.com/b/windowsstore/ar ... -apps.aspx

I hope the above information is of some assistance.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: How do I implement app updates?

Post by nower » Mon Mar 31, 2014 10:33 pm

Hi Neil,

yes, that is helpful, but it still leaves a few of my questions unanswered.

Let's say I have the user data for the app in a stack in the documents folder, and I access that stack when the app starts.
Let's further say that the app update changed something related to the user data and I need to update the user data stack.
I tried that before in my desktop version and had problems because the user data stack was already open and any updates I made during preOpenStack or preOpenCard didn't take effect immediately.

So how do you handle such a situation?

And the other question is whether there is a good sample stack that demonstrates app updates for a desktop app over the internet, where the app was not installed and updated through an app store but directly.

Thanks,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: How do I implement app updates?

Post by LCNeil » Tue Apr 01, 2014 12:09 pm

Hi Werner,

We do not have any sample stack available for this purpose but it might be worth asking in the public forums as there may be other users whom have implemented such functionality.

One method, that we have seen used is to have your updates (stack) stored on a server and then have these accessed via script. This is explained in some detail in the following stack overflow post-

http://stackoverflow.com/questions/1864 ... om-the-web

In regards to the data not being updated during preOpenStack or preOpenCard, I would suggest an approach of having an update card that is triggered before any cards that contains user data are shown or accessed. This will ensure that the data is up to date before being accessed by the user. This cased would should be the first one to be accessed when the application is launched.

Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
-- 

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: How do I implement app updates?

Post by nower » Tue Apr 01, 2014 1:10 pm

Hi Neil,

Do you have an example stack with such an update card? Or explain it in a bit more detail?
I can't quite imagine how something like that would work and how the app structure would need to change for it.

Thanks,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: How do I implement app updates?

Post by LCNeil » Tue Apr 01, 2014 10:57 pm

Hi Werner,


I have created an example stack that shows one method of updating your stack via a simple launcher stack. Please find this attached. You will have to place the included v1.livecode stack in your documents directory and then open main stack.livecode.

I've implemented the update method by creating custom properties (cVersion) on the various stacks and these are used for version number purposes. The application stack (v1.livecode and update stack from server) are loaded by the updater stack and the version numbers are checked. If the version number of the update stack is greater than the v1.livecode stack, then this replaces the pre-existing stack. If the stack is up to date then the stack is simply loaded.

The user has the option to accept or decline the update and this results in the update being requested when the main stack.livecode is opened again.

All scripts are contained within the card script of the main stack.livecode stack with code commented throughout.

I hope this is of some assistance.
example.zip
(3.53 KiB) Downloaded 132 times
Kind Regards,

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
-- 

Post Reply

Return to “idea2app and Coding School”