Updating app issue

sconlon

Active Member
Licensed User
Longtime User
I want to be able to update my app from a website using FTP so I have a service within the app that checks for a new version of the APK file and downloads it. Each time the app is run it checks for the existence of a new APK file, i.e. a previously downloaded one, and if found does:

Dim myapp As String
Dim Intent1 As Intent
myapp = "file://" & apkPath & "/" & APKfullname
Intent1.Initialize(Intent1.ACTION_VIEW, myapp)
Intent1.SetType("application/vnd.android.package-archive")
StartActivity(Intent1)

What happened was that the Install dialog was displayed but then the app continued to run and it was only when I exited the app that the install resumed. So I put an Activity.Finish after the StartActivity(Intent1) and as this is done before much else in Main I thought the Activity.Finish would exit the app and allow the install to run. Not so, it seemed that the Activity.Finish made no difference. Puzzling to me!

Ta.
 

JonPM

Well-Known Member
Licensed User
Longtime User
Would ExitApplication work for you instead? This destroys the activity immediately.
 
Upvote 0

sconlon

Active Member
Licensed User
Longtime User
Erel, apologies for using the incorrect protocol.

The ExitApplication worked fine and I guess since I had not yet started any of the other activities in the project it should be ok to use. But I still wonder why Activity.Finish did not work as expected.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…