1

This question may seems old to some you guys or may be silly or may interesting , but i really want to know this.I build an application in ionic but now as i want to make such automated system like i can make multiple application's apks from the existing parent code with different package names and version codes.I want to make such a script that when i run it on command line i will be able to build a new apk from the parent code just by changing logo and package name , version code , version name.As the functionality will remain same only base url , package name , version code need to get changed . so i want this process to reduce my efforts in generating new apks manually.

I done some R&D and found some links but i am not able to understand them clearly , as i never use ant or maven earlier , After seing such links i believe that this can be possible . So , i just want to get sure of this and want to take idea from all the experts here in stackoverflow.I really want to learn this amazing thing.

links are as follows :-

Create an Android project from existing one

How to compile APK from command line? http://www.simpligility.com/2010/11/release-version-management-for-your-android-application/

Found This But it is Unanswered :-

Generate multiple APK's with same code base using ANT

I found this But i do not know how ruby works and how to use this in ionic framework:-

http://iambrucewang.blogspot.in/2012/03/create-multiple-android-apps-from-one.html

I am using Linux mint and eclipse as IDE .

Please enlighten me with your expertise knowledge.I will be very grateful to you all.

Regards

Community
  • 1
  • 1
sid
  • 1,116
  • 1
  • 10
  • 27

1 Answers1

0

First of all: Don't use Ecplise anymore as an Android IDE. The Eclipse Support for Android is outdated and Android Studio will bring you joy.

Regarding your question: You are asking about build types (i.e. develop, release, ...) and build flavors (paid, free, whatever, ...).

You can define these two in the gradle file (don't use Ant anymore. For Android it's as outdated as Ecplise). For example you define two flavors: logoOne and logoTwo. For each flavor you can either use different implementations for classes who need to do different things OR you can also define BuildConfig Fields with more or less hardcoded information.

More about this here:

https://developer.android.com/studio/build/build-variants.html

or on youtube here:

https://www.youtube.com/watch?v=cD7NPxuuXYY

This will generate seperate APKs for each build variant (= combination of buildtype and buildflavor)

muetzenflo
  • 5,653
  • 4
  • 41
  • 82