Page 1 of 2

Coding an Update Functionality for an LC App ?

Posted: Thu Jan 18, 2018 8:13 pm
by teriibi
Hi,

I`d like to know if there is way to code an update mechanism to release bugfix upgrades or add new features to an installed app ?

(let´s say on Android Plateform)
:roll: 8)

Re: Coding an Update Functionality for an LC App ?

Posted: Thu Jan 18, 2018 8:34 pm
by dunbarx
Hi.

If you are adding new features I would think you would provide a new version of your app. Same with bug fixes. The executable does not change. But the working stack(s) would have to.

This assumes you do not have a mechanism to change scripts within the app itself, or to add or modify existing controls. All that would still have to be directed from some communication with the existing structure. Doable, I suppose. But I would shy away.

Craig Newman

Re: Coding an Update Functionality for an LC App ?

Posted: Thu Jan 18, 2018 8:42 pm
by FourthWorld
teriibi wrote:
Thu Jan 18, 2018 8:13 pm
Hi,

I`d like to know if there is way to code an update mechanism to release bugfix upgrades or add new features to an installed app ?

(let´s say on Android Plateform)
The recommended way to update mobile apps is through the app store.

Re: Coding an Update Functionality for an LC App ?

Posted: Fri Jan 19, 2018 6:36 pm
by jacque
The Play Store has automatic update mechanisms but if you plan to distribute outside the store, the easiest way to do it is to put a plain text file on a server that contains the latest version number. On launch your app checks that file to see if its own version is different from the one in the text file. If so, the app displays a dialog informing the user there is a new version a available and provides a link to the app online.

Another way is to use a launcher stack that opens the most current version of the actual mainstack from the server.

Note that the only way to update ios apps is via the Apple App Store.

Re: Coding an Update Functionality for an LC App ?

Posted: Fri Jan 19, 2018 10:19 pm
by teriibi
thanks jacque, quite interesting info:
Can you detail this option ?

I though an Android Apk could only be downloaded and installed before it can open and run for the user ?
use a launcher stack that opens the most current version of the actual mainstack
:idea: :?:

Is this some kind of webapp...or...is the launcher actualy able to download install or update to a newer apk version of an already installed app on an Android Device ?

I´m asking this since some App builders (cant remember if it was about a Web type App) allows some
constant (rolling) updates with very little action from the end user, which I find real cool in a way

(not refering to google instant update tools)

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 12:45 am
by ghettocottage
use a launcher stack that opens the most current version of the actual mainstack
+1 for this method. It is quite possibly even more simple than how it sounds.

1. take your app you are building. Do not export it as anything..just take the file you have been working on and put it on a webserver in a sub-folder called stacks (for example). So now your stack is at https://yourdomain.com/stacks/yourstack.livecode

2. create another stack. Name it "launcher". In the stack script put this:
//request the stack
go url "https://yourdomain.com/stacks/yourstack.livecode"
//close this window
close stack launcher
end openStack

3. now export the launcher as your app for whatever platform. when the launcher is opened, it will grab your stack on the server, open it, and close itself. your main stack will now be the one open.



you can update the stack on your server whenever you want. Whenever anyone opens that launcher, it will open your most recent version of your stack. It is really quite brilliant and a time-server on many levels.

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 1:06 am
by teriibi
:shock: :shock: :shock: :shock:
can´t believe what Im reading !!
got to give a serious test to this feature asap !

Thanks for advertising, I m sure it will be of great help :wink:

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 2:18 am
by dunbarx
That is really the bomb.

Craig.

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 2:58 am
by ghettocottage
Here is the thread where I learned about it a couple of years ago:
http://forums.livecode.com/viewtopic.ph ... 80#p155580

@FourthWorld goes into some more details on ways to secure it. I have used this method on a database project I was working on. Worked across all Desktops (mac, windows and linux) without any issues.

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 3:09 am
by teriibi
hmm...okay...so its mostly useable on larger screens...like desktop ones.
I mean : it wont resize out of the box to smartphones or tablets ? :oops:

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 3:25 am
by ghettocottage
hmm...okay...so its mostly useable on larger screens...like desktop ones.
I mean : it wont resize out of the box to smartphones or tablets ?
why not? It will do whatever you have set the stack to do.

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 9:30 am
by jmburnod
Hi,
you can update the stack on your server whenever you want. Whenever anyone opens that launcher, it will open your most recent version of your stack
As far i know that is not possible for iOS app. Apple doesn't allow import code and consider stacks as code
Best regards
Jean-Marc

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 10:54 pm
by teriibi
@Cottage,
- Launcher App was built
- basic Sqlitex.livecode uploaded
...testing the window launcher.exe ....Stack opens....but nothing more happens :shock:
Whats to modify in this script ? :?
(I added the "Select all" line .. as I saw this in a previous topic)
Image

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 10:57 pm
by Klaus
Replace
-> Select all
with
-> on openstack
8)
Dont close the launcher stack for testing and try again.

Re: Coding an Update Functionality for an LC App ?

Posted: Sat Jan 20, 2018 10:59 pm
by Klaus
Ah, error checking!
Add this after the go url... line:
...
if the result <> EMPTY then
answer the result
end if
...
May give a hint, if the download fails for whatever reason.