Developer Robert C. from the Brazilian Programador Mobile forum wrote in with a demo that shows how to auto update your Android APK with Delphi XE7 Firemonkey. If you want to deploy your app on Android and don’t want to use one of the app stores or if you want to build your own app store this is a pretty useful functionality to have. Basically it hits a URL with TIdHTTP, downloads the APK file, and then launches the APK using an Android Intent. Android then asks the user if they want to install the new APK. With this kind of functionality you could build your own app store or even an enterprise mobile device management service. In addition to auto updating your own app you can use this functionality to install other apps from your own app. So for example if your app is your own app store you can have it download other apps from your app and allow the user to install them. This project should also work in Appmethod. Here is the main Android intent code:
var
aFile:Jfile;
Intent:JIntent;
begin
aFile:=TJfile.JavaClass.init(stringtojstring(GetSharedDownloadsDir),stringtojstring('APP.apk'));
Intent := TJIntent.Create ;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
Intent.setDataAndType(TJnet_Uri.JavaClass.fromFile(aFile),StringToJString('application/vnd.android.package-archive'));
SharedActivityContext.startActivity(Intent);
Head over and check out the full post from Robert C. on building third party APK installing functionality with Delphi XE7 Firemonkey.
Mirror: Or download the sample project of the third party Android APK installer here.
a lot of thank you.. excelent article… i needed this topic with urgently…