Whats the best way to deploy several customized versions of a Android application?
Currently I have a script to exchange the resource folder for getting a customized version of my app. It works great, but all custom versions still have the same package name in the AndroidManifest.xml. Therefore it is not possible to install two customized versions of the app at the same time.
This is one solution for this problem, but that has to be done by hand
Can you think of a more easy solution, or how this could be built into a skript?
(btw: it is not for a porn/spam/whatever app, not even a paid one)
Using the Native Android Cloning FeatureSome Android devices offer native support for app cloning. It lets you run multiple copies of the same app without having to install any third-party tool. This feature is available on Samsung, Xiaomi, Oppo, and OnePlus phones, among others.
First install the older version and edit that app with 'App Cloner'. Just change the name of the app. Now, uninstall the app and then install the modified APK. Now install the latest version as well.
Perhaps the built-in Android "library" concept was not fully baked at the time of the original post, but it may be the preferred method as of 2011. Follow these steps for an ant build:
Starting from a working app (let's call it directory "myOrigApp", package com.foo.myapp), just add this line to "default.properties" to make it a library:
android.library=true
Now create a new app in a sibling directory in any way you prefer (let's call it directory "sibling", package com.foo.myVariant). Using Intellij Idea, for example, create a project 'from scratch' with directory 'sibling' and it will create all the files/directories you would normally need.
In that new, sibling directory edit "default.properties" to add the dependency:
android.library.reference.1=../myOrigApp
Copy over the Manifest from the original dir:
cd sibling cp ../myOrigApp/AndroidManifest.xml ../myOrigApp/local.properties ../myOrigApp/build.properties .
Edit that copied Manifest file to change its package name to your new variant, "com.foo.myVarient"; that's the only change.
If you just run the ant build scripts, you may be done. (I had to just set up signing keys.)
If you want to set up an IDE like Idea to have the library project as a dependent of the variant project, follow these steps to add a library project to the variant project (assumes you already have a project set up for both):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With