android


Android: Application for different requirements and features


Using build variant in Android we can support different flavors.
I need to develop an application where I am supporting different clients. Each client needs are a little different.
However, the basic data, network call class etc are same for all clients.
How can I ensure partial code of my application remains same for all flavors?
This will help in maintaining one repository for all common classes.
You need to understand how build variant works.
Each client needs are a little different is a vague statement
Imagine you have an application which has different screen's for different countries. But major functionalities are the same.
Now using build variants you can make different flavors
1) For country one : This will have screens designed specific to country one
2) For country two : This will have screens designed specific to country two
3) Common part : All the common business logic can be put under your common package
While project is build, the common part is considered and specific flavor too becomes part of flavorXX.apk
productFlavors {
employee {
applicationId "com.myapp.employee"
}
driver {
applicationId "com.myapp.driver"
}
asset {
applicationId "com.myapp.asset"
}
vehicle {
applicationId "com.myapp.vehicle"
}
}
sourceSets {
asset {
manifest.srcFile 'src/asset/AndroidManifest.xml'
}
driver {
manifest.srcFile 'src/driver/AndroidManifest.xml'
}
employee {
manifest.srcFile 'src/employee/AndroidManifest.xml'
}
vehicle {
manifest.srcFile 'src/vehicle/AndroidManifest.xml'
}
}
In the above example , I am having different flavors of same application. Inorder to split accordingly you need to understand which part of your app goes into specific flavor and which can be kept common. Go through below links for more details.
Understanding Product Flavors reference link 1
Understanding Product Flavors reference link 2

Related Links

Android RecyclerView does not animate all the items
Hiding URL in android Application
MPAndroidChart: BubbleEntry on same dataset and xAxis cannot be selected
Android: Storing text file in android device's internal memory not in external memory card?
json error in logcat file in aysnc task
Android Studio 2.2 cannot Run a homescreen project
App crash during edittext on click in android
Programmatically launch a SearchView (Android)
ServiceConnection onServiceConnected is not calling
Android OS shuts down the Wakelock + AlarmManager after a few minutes
ionic.leave do not fire
Adding Android Google PlusOneButton to layout causes compilation error
Json parsing in skyscanner pricing api
Android Studio Crashed and now gradle files are missing info
Im trying to make a acsess code for a app
Fragment data is lost when multiple time startActivityForResult is called

Categories

HOME
batch-file
search
azure-stream-analytics
porting
codenvy
nvd3.js
battery
oracle-apex-5
requirements
onclick
spring-session
nstableheaderview
nfs
lanczos
fabric.io
mql5
jquery-ui-sortable
github-enterprise
rtf
atlassian
null-pointer
google-picker
identity-management
google-maps-autocomplete
symbols
kendo-mobile
ember-cli
r-mice
react-toolbox
exit
short-url
ckfinder
gpio
ms-access-web-app
delimiter
8051
winexe
datastax-enterprise-graph
ceylon
paperjs
realm-mobile-platform
erb
papaparse
gnat-gps
dynamic-jasper
navigator
protege4
docfx
google-knowledge-graph
kill
portforwarding
wc
apache-directory
serde
dotnet-httpclient
spring-integration-sftp
globalize
twilio-click-to-call
carrot2
boxing
java-6
check-mk
mach-o
grails-plugin
stax
database-relations
aspen
qbxml
inf
wiredep
oracle-spatial
atoi
liquid-layout
snoop
entity-framework-4.3
user-permissions
code-documentation
grouping-sets
cross-join
named-parameters
conditionaltagsupport
openargs
notorm
solace-mq
code-duplication
windows-98
bjyauthorize
booksleeve
pdfviewer
correlated-subquery
lambdaj
multiplexing
ikimagebrowserview
matlab-load
listactivity
exponentiation
jqote
umra
duplex
escrow
sqlobject
soappy
cardspace

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App