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 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE7 Firemonkey Android APK Auto Update | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSDeveloper 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
DelphiDemoFiremonkeyLinuxOSXShowcaseWindows

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging

DelphiFiremonkeyShowcaseUtilityWindows

Unleashing Creativity With Song Writer AI: A Deep Dive

DelphiFiremonkeyShowcaseWindows

How To Build Stable Diffusion Text To Image Prompts

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

2 Comments

Leave a Reply