Jul 2 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 2 | 9:05 AM |
MiguelFebres | has entered the room |
Mark M. |
hello, Miguel!
|
Mark M. |
how can I help you today?
|
MiguelFebres |
Hello Mark, good morning
|
MiguelFebres |
I have a project in Android that I will offer to multiple clients
|
MiguelFebres |
the core logic will be the same, but some clients can request some changes in the functionality and/or layout
|
MiguelFebres |
what is the best way to structure the project to handle that?
|
Mark M. |
that depends on the scope of the changes
|
Mark M. |
if the changes will be limited, use one project with product flavors for each client
|
Mark M. |
if the changes could be substantial, package the project as a library, and create an app for each client that uses the library
|
MiguelFebres |
any example on how to implement both cases?
|
Mark M. |
not really
|
Mark M. |
by definition, you are talking about a large project
|
MiguelFebres |
actually its a small project
|
Mark M. |
I cover product flavors in the book, as well as library modules
|
Mark M. |
but the examples are not specifically set up for your scenario
|
MiguelFebres |
ok I will read about product flavors, but it is possible to handle the package name? Every customer will publish its app in play so they need to have a different package name
|
Jul 2 | 9:10 AM |
Mark M. |
that is handled in either of the solutions that I suggested
|
Mark M. |
with product flavors, you override the applicationId in the flavor definition
|
Mark M. |
with separate per-client apps, each app would naturally get its own applicationId
|
Mark M. |
from the standpoint of uniqueness rules, what we used to call the "package name" is now the applicationId
|
Mark M. |
it happens to default its value to the package attribute in the <manifest> element
|
Mark M. |
but you can override it in build.gradle as needed
|
Mark M. |
for the product flavor approach, see https://github.com/commonsguy/cw-omnibus/blob/m...
|
Mark M. |
where I override applicationId in my two flavors (vanilla and chocolate)
|
MiguelFebres |
ok great I will take a look
|
MiguelFebres |
do you have the page number in the pdf about product flavors?
|
Mark M. |
"Gradle and the New Project Structure" chapter
|
Mark M. |
page 863 in the PDF edition of Version 6.7
|
Jul 2 | 9:15 AM |
MiguelFebres |
ok thanks
|
MiguelFebres |
I have a question about a different topic
|
Mark M. |
go ahead
|
MiguelFebres |
regarding AdMob
|
Jul 2 | 9:20 AM |
MiguelFebres |
The application I am planning to offer supports AdMob, so the customers can configure theirs AdMob ID so they can show ads in the application
|
MiguelFebres |
I have already that
|
MiguelFebres |
and of course the customers pay me for the app
|
MiguelFebres |
but I am thinking in have a free version of the app but with my AdMob ID
|
MiguelFebres |
I know that technically it is possible but I want to know if it is allowed to have the same AdmobID in different projects that will be published under different google play accounts
|
Mark M. |
"allowed" is not a technical question; it is a question of terms of service
|
Mark M. |
I have never used AdMob
|
Mark M. |
and IANALNDIPOOTV (I am not a lawyer, nor do I play one on TV)
|
Mark M. |
so I cannot really help on on that question, sorry
|
MiguelFebres |
ok, I will read about the product flavors and will be back if I have more questions
|
Jul 2 | 9:25 AM |
Mark M. |
OK
|
Jul 2 | 10:00 AM |
Mark M. |
that is a wrap for today's chat
|
Mark M. |
the transcript to this chat will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next office hours are Tuesday at 4pm US Eastern
|
Mark M. |
have a pleasant day!
|
MiguelFebres | has left the room |
Mark M. | turned off guest access |