- I used HttpRequest to fetch content of version.txt
- When user press on "Download" button my app will start an intent to open browser then it will download the apk file. This way the browser will take care the downloading but users need to install the apk file manually. I used this code:
Code:
Dim newintent As Intent, uri As String
uri="http://www.mywebsite.com/myapp.apk"
newintent.Initialize(newintent.ACTION_VIEW,uri)
StartActivity(newintent)
- Another way is you use HttpUtils to download apk file and install it automatically by using this code:
Code:
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "file:///sdcard/myapp.apk")
i.SetType("application/vnd.android.package-archive")
StartActivity(i)
*Package Manager will kill your app if it's running.