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

How can I set the xmpp presence to offline?
How to create simple self LVL like library
java.lang.NoClassDefFoundError, on one of my own class
Android XML Layout with buttons
Android AsyncTask ExceptionInIntilizationError
Dimension of my Scaled ImageView
What happens if a C2DM or GCM Receiver's onReceive function fails during a Registration Intent?
Can the fragments be used in android 2.3 project ?
Drawing to canvas onDraw works, drawing onTouchEvent doesn't
Android ActionBarSherlock Custom View
overriding Adapter.getView
Downloading Android App from PC to device
Canvas seems to draw on 2 different views
Eclipse Android Emulator - Keyboard not working
How to hide/encrypt/confuse direct URLs used in my Android application? [duplicate]
Executing a Code after activity is displayed

Categories

HOME
paraview
object
3d
requirements
google-cloud-functions
nsbundle
echo
spring-session
android-json
character
bing-maps
heap
x-cart
gkturnbasedmatch
enterprise-architect
searchview
symfony-console
windows-xp
roslyn
xcode-ui-testing
jasmine-node
amazon-quicksight
paperjs
uitapgesturerecognizer
testcomplete
nsurl
scrollview
send
complex-numbers
pdw-file-browser
jwplayer6
python-pptx
playframework-2.1
jpad
sessionstorage
z-notation
resolution
subclipse
gitlist
stdmap
tinkerpop
java-bytecode-asm
oracleclient
seq
lsyncd
d3-force-directed
pytables
i386
gcloud-ruby
jparsec
phpgrid
linklabel
assertion
sciruby
rpart
dronekit-android
matlab-deployment
android-broadcast
cakephp-2.7
uncaught-typeerror
crowd
punycode
formview
create.js
unix-socket
grails-domain-class
lnk
malformedurlexception
wxformbuilder
synapse
mbunit
process-explorer
insert-id
fragmenttransaction
web-farm
objectquery
mapping-by-code
database-create
floating-point-exceptions
screen-size
timertask
isapi-extension
escrow
int64
idatareader

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