How can i generate different aps using a single code

15 views
Skip to first unread message

ivan paredes

unread,
Jun 29, 2017, 8:52:30 AM6/29/17
to phonegap

in english:

Hi. I have a problem. I have a base application using ionic/cordova for android, and I need to develop applications derived from it, but that have different: Package name, Keystore (password alias, etc), Css and maybe html, Some images (especially logos), and some texts (especially titles).

How can I do to develop on an application and when compiling, to generate several different apks. I know there are flavors in android, but I do not know how to use them in an apache cordova application


en español:

hola. tengo un problema. yo tengo una aplicación base hecha en ionic y cordova para android, y necesito elaborar aplicaciones derivadas de ella, pero que tengan distintos: package name, keystore (password alias, etc), css y tal vez html, algunas imagenes (en especial logos), y algunos textos (en especial titulos).

como puedo hacer para desarrollar sobre una aplicacion y cuando compile, que se generen varios apks distintos. se que existen los flavors en android, pero no se como usarlos en una aplicacion apache cordova

Rob Willett

unread,
Jun 29, 2017, 1:07:51 PM6/29/17
to phon...@googlegroups.com
This is tricky (or we think it is).

We have two apps in the Apple store and Android store which has *almost* the same code base. 

The way we got this to work and we tried a lot of different things.

What worked for us on our Macs was the following:

1. We have a master directory which contains the main app with all the right plugins. This compiles easily and is built as per normal.

2. We create a new directory for each new app at the same level as the master directory.

3. We create symbolic links from almost every source Javascript file back from the new directory to the main application directory. We use symbolic links (though we could use hard links) so we don't accidentally edit a Javascript file that we shouldn't. So this means we have all the html, css, js files. Anything thats a user changed artefact.

4. We install the right plugins into each new application folder. We do NOT do symbolic links.

5. We create the right config.xml file in the root of each application folder with the correct app ids in. This is not symbolic linked.

6. We have one small Javascript file that controls what each application does. We use global variables to define the behaviour of the app. We would prefer to use the equivalent of C's #defines but thats not an option thats available to us. We use TypeSscript but thats a detail here.

We have shell scripts that automate all of this. We spend three months trying to work out the best system and this is the best way we could find. Doesn't mean its the only way and on Windows, might be difficult with symbolic links.

Rob

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages