Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create Android Application plugins/extensions that can be installed as an APK or from market?

Tags:

android

I'm actually investigating the possibility to have an application that fulfill the following requirements:

  • The Main Application may have 5 deactivated functionalities
  • If you try to use a deactivated functionality, the application invites you to download an extension that can be installed as an APK or from market.
  • Once the functionality is installed, it becomes activated and then it can be used.

So we can have some free/not free functionalities. I've already seen such a behavior in some applications but I don't remember the name.

Is there something in the Android SDK to be used? how it can be implemented?

Thanks for your help.

like image 678
Anas EL HAJJAJI Avatar asked Nov 30 '12 11:11

Anas EL HAJJAJI


People also ask

How do I make an APK file on my Android?

Creating an APK file First, open up your project or application that you want to import into an APK file. Then, select Build > Build Bundle(s)/APK(s) > Build APK(s) from the toolbar menu. Android Studio will take a few moments to generate an APK file.

How do I create an AAB file?

Generating an AAB in Android Studio To create an AAB binary locally using Android Studio, open the Build menu, then choose “Generate Signed Bundle / APK.” Follow the prompts to sign the AAB with your keystore file. For complete details, view the Android documentation.

What is .APK extension in Android?

An APK (Android Package Kit) is the file format for applications used on the Android operating system. APK files are compiled with Android Studio, which is the official integrated development environment (IDE) for building Android software. An APK file includes all of the software program's code and assets.


2 Answers

Not sure if this is what you looking for, but let me suggest something to get you started (probably)

For the sake of example, say, in your application, for instance, you have 2 buttons (instead of 5)

BUTTON 1 and BUTTON 2.

When you start your application, check if the necessary applications (third party to your own application) are installed or not using the PackageManager

This is a pseudo code that I use in my app to check if Google Maps is installed or not on the users device:

boolean installedMaps = false;

// CHECK IF AN APPLICATION IS INSTALLED
PackageManager pkManager = getPackageManager();
try {
    PackageInfo pkInfo = pkManager.getPackageInfo("com.google.android.apps.maps", 0); // REPLACE THIS "com.google.android.apps.maps" WITH THE ACTUAL PACAKAGE NAME
    // Log.e("pkInfo", pkInfo.toString());
    installedMaps = true;
} catch (NameNotFoundException e) {
    e.printStackTrace();
    installedMaps = false;
}

If the boolean installedMaps returns true, enable the button. Otherwise, prompt the user to with a Dialog to download the application off Google Play.

And do this for each function you need to Activate or Deactivate.

NOTE: You will need to know the Package Name of the other application for that. If you do not know it, it can be found by running the application on your device and checking the logcat.

If you also need to share Content between all concerned application, you might also consider making use of Content Providers

Again, I am not entirely sure if this is what you are looking for. Please do correct if I am wrong in my assumption.

like image 144
Siddharth Lele Avatar answered Nov 15 '22 17:11

Siddharth Lele


You can create apks with Service and use http://developer.android.com/guide/components/aidl.html to connect to this service. And this service can do what you want so only your imagination is your limit ;-)

I recommend read about this: http://developer.android.com/guide/topics/manifest/manifest-element.html#uid it is possible to share more data between 2 and more apps. But they should be singned with same key.

like image 26
radzio Avatar answered Nov 15 '22 19:11

radzio