I'm planning to self-host my application but not sure what is the best way to implement auto-update.
I'm planning to do following:
My question is how do I initialize update from code? I understand user will need to confirm this action but I want to do as much work as possible myself. Do I need to call specific intent to do this?
I guess question is how do I install APK programmaticaly if it's already on device..
I guess question is how do I install APK programmaticaly if it's already on device..
You can launch the install using the following code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive");
startActivity(intent);
The above code was taken from an answer to a similar question: automatic install of apk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With