Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkey

Build Your Own App Store Or MDM Solution With Delphi XE7 Firemonkey On Android

Delphi XE7 Firemonkey Android APK Auto UpdateDeveloper 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.



Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
DelphiDemoFiremonkeyLinuxOSXWindows

Build Classic Desktop Operating System Themes Apps With Styles For FireMonkey

DelphiFiremonkeyIDEWindows

Easily Let AI Agents Query And Manage Your Databases Via FireDAC MCP

DelphiDemoShowcaseWindows

Build A Tiny, Explainable Language Model Entirely In Delphi

ComponentDelphiDemoFiremonkeyLibraryWindows

Run Google's Gemma 4 Vision Models Natively In Delphi

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

2 Comments

Comments are closed.