Open file (update application) in Android


#1

Hi all,

has anybody done “auto update” of android app? We are using https://www.npmjs.com/package/nativescript-downloadmanager to download new apk version and creating manually new intent to execute the file, which kinda works (android 5-6), but was wondering if there is some other (better) way to do this? This is internal use app so it is not going through Play store. It looks like there is native api openFile available in NS, but at this moments it is only available for iOS.

thanks
davor


#2

Downloading latest APK and triggering install intent could be the easiest way.

If you are looking for something like code-push you might have to implement the whole architecture keeping nativescript-code-push plugin as reference.


#3

Hey manojdcoder, yeah, this works, it looks like android 7 implemented new intent politics that wont work with this method, here is code example claiming that, https://stackoverflow.com/a/48361119/1271888 we didnt tried it yet…

yeah, code push is out of reach at this moment, it is a simple app, just wondered what people are using to open pdf/apk ot whatever file

thanks


#4

Hi @davorpeic,

I am looking to achieve the same thing as you did. Can you help me out a bit on how to “manually create a new intent to execute the file” ?

Thank you!
Tony