Office Hours — Today, July 2

Tuesday, June 30

Jul 2
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:05 AM
MiguelFebres
has entered the room
Mark M.
hello, Miguel!
how can I help you today?
MiguelFebres
Hello Mark, good morning
I have a project in Android that I will offer to multiple clients
the core logic will be the same, but some clients can request some changes in the functionality and/or layout
what is the best way to structure the project to handle that?
Mark M.
that depends on the scope of the changes
if the changes will be limited, use one project with product flavors for each client
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
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
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
9:10 AM
Mark M.
that is handled in either of the solutions that I suggested
with product flavors, you override the applicationId in the flavor definition
with separate per-client apps, each app would naturally get its own applicationId
from the standpoint of uniqueness rules, what we used to call the "package name" is now the applicationId
it happens to default its value to the package attribute in the <manifest> element
but you can override it in build.gradle as needed
for the product flavor approach, see https://github.com/commonsguy/cw-omnibus/blob/m...
where I override applicationId in my two flavors (vanilla and chocolate)
MiguelFebres
ok great I will take a look
do you have the page number in the pdf about product flavors?
Mark M.
"Gradle and the New Project Structure" chapter
page 863 in the PDF edition of Version 6.7
9:15 AM
MiguelFebres
ok thanks
I have a question about a different topic
Mark M.
go ahead
MiguelFebres
regarding AdMob
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
I have already that
and of course the customers pay me for the app
but I am thinking in have a free version of the app but with my AdMob ID
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
I have never used AdMob
and IANALNDIPOOTV (I am not a lawyer, nor do I play one on TV)
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
9:25 AM
Mark M.
OK
10:00 AM
Mark M.
that is a wrap for today's chat
the transcript to this chat will be posted to https://commonsware.com/office-hours/ shortly
the next office hours are Tuesday at 4pm US Eastern
have a pleasant day!
MiguelFebres
has left the room
Mark M.
turned off guest access

Tuesday, June 30

 

Office Hours

People in this transcript

  • Mark Murphy
  • MiguelFebres