Start timer in different sub

sconlon

Active Member
Licensed User
Longtime User
I have a service module which will download a newer version of my app from my website and I then want to alert Main that this has happened so that it can then be installed. I know that there are a number of ways of doing this but I thought of using a timer. So the service module would start a timer (declared in Main) that would tick after one sec and call an event sub in Main. I'm not sure this is possible as I haven't been able to declare an eventname that works, it always gives a "Sub eventname_tick was not found".

Is this possible at all or should I try some other method - a simple global boolean and have Main check this within its own timer.
 

mc73

Well-Known Member
Licensed User
Longtime User
If using the httpUtils2 you can set your jobDone sub in your main activity. It will get triggered, and you can proceed the way you want, for e.g. installing immediately or letting user finish his jobs first.
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
Didn't think of that one as I was using FTP to do the download. I first do a List command to get a list of server files and then compare dates before doing a download if there is a newer APK file. Don't think I can do this with httpUtils2 but maybe there is a different/better way to do the same thing?
 
Upvote 0

yttrium

Active Member
Licensed User
Longtime User
Didn't think of that one as I was using FTP to do the download. I first do a List command to get a list of server files and then compare dates before doing a download if there is a newer APK file. Don't think I can do this with httpUtils2 but maybe there is a different/better way to do the same thing?

For my desktop VB.NET app, I keep a "latest" file on the server with a single string with no line endings. It holds the version number in the same syntax as a version number global variable in my app, and if the two strings don't match it prompts the user to update.

You could try looking into that.
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
A good idea but I didn't want to have to remember to change anything on the server other than save the new APK file. Comparing dates does this ok.
 
Upvote 0
Top