score:1
i don't see this "modular" app as anything different from one app, with several packages, each containing discrete functionality, that is adapted to some list of settings or external parameter (either provided by the user or you).
my approach would be to have a "main" package. that package would contain the shared functionality you mention above and serve as the hub for your application. i would then create separate sub-packages for the different "add on" functionality. this allows you to still use the code in your main package with a simple import statement. from your description these additional functions should probably be implemented as a fragment
. a fragment
is almost a stand alone application with the exception that it is "hosted" by an activity
. depending on how these add on functions are used (i cannot tell if they relate to the ui, just background processing etc) you could easily have 3 of 4 different fragments and choose to load only 1 or 3 or 2 of them at runtime.
to control which parts of the code are used i would just set up a simple switching class (it could even be part of the first activity launched, i cant tell from your description above). here i would check for some setting indicating which parts of the app will be "active." this could be easily defined using sharedpreferences
to store a specific configuration, e.g. use a and b, prior to delivering the final project. you would then just initialize the fragments you need and display them either (1) individually in a fragment
layout element or framelayout
; (2) collectively in some other view structure like a viewpager
.
i follows your links on the broadcastreceiver
and i am still not sure why they are "everything else than recommended." used correctly a broadcastreceiver
is very useful. i tend to use a localbroadcastmanager
along with a broadcastreceiver
to notify other sections of the app when some asynctask
, e.g. downloading a lot of data, is complete. these parts of the app can then access a local database or process the information downloaded on their own time. i wouldn't use a broadcastreceiver
to modulate parts of the app if that is what you're looking for. i would instead just use a sharedpreference
file to set the configuration at runtime.
score:0
if you need modules like facebook sdk or something like that better use library project. if you use idea or android studio there is such thing like module. if i need some modeles in one app i prefer just put in different packages like com.appname.model, com.appname.ui and so on. broadcast receiver isn't about modules. as i know there isn't analog of ios target.
Source: stackoverflow.com
Related Query
- How to import existing Android project into Eclipse?
- How to change package name of Android Project in Eclipse?
- How do you open an Android Studio project in Eclipse?
- How do you import an Eclipse project into Android Studio now?
- How to add a Library Project to a android project?
- How to import Android Studio project in Eclipse?
- How to close a project in Android Studio?
- How to convert an Eclipse Android project to use Ant for build?
- How to use Gradle to generate Eclipse and Intellij project files for Android projects
- How to remove native support from an Android Project in eclipse because eclipse is showing errors in jni?
- How to create a new layout for an Android project (using Eclipse)
- How do you compile an Android project into an .apk file in Eclipse without launching the emulator?
- How to import eclipse library project from github to android studio project?
- How to remove a dependency from my Android project in Eclipse
- How to start an android project with downloaded sample code
- How to include a Java project in an Android project?
- How to create n project with ADT r20 without including the android support library?
- How to use Linked Files in Eclipse for PhoneGap project with Android
- How to create new android project in eclipse and share in local git repository?
- How to properly clone an Android project using Eclipse and Mercurial
- How to import android studio project in eclipse which use library?
- How to build a Maven Android project in eclipse
- Cocos2d-x: How to port a Cocos2d-x project developed with XCode to Android (via Eclipse)?
- How To Exclude Files in "/res" Folder of an Android Eclipse Project
- How to import .dll to Android java project (working with eclipse)
- How to use the same source from PhoneGap Build and PhoneGap Android project in Eclipse
- How to use forked git project in Android Studio
- How to auto-increment build number of Android project in Eclipse (prefer portable solution)
- How to include http library in Android Project using M preview in Eclipse ant build
- How can I upload my Eclipse Android project to GitHub?
More Query from same tag
- Eclipse "go to definition" problem
- Error "A JNI error has occurred. Please check your installation and try again in Eclipse x86 Windows 8.1"
- android 14 update
- Eclipse autocomplete in switch-case
- Eclipse code format merge to repository
- Eclipse Building Workspace always slow due to Invoking "Maven Project Builder"
- EMF for Eclipse
- Maven Eclipse plugin - classpath entries for each?
- Error when trying to compile java files in project with Protocol Buffers
- Eclipse unresolved symbol with Play Framework
- What is target directory in maven-archetype-webapp in Eclipse and shall I add it to .gitignore?
- the project was not build since the source file could not be read
- Inserting data into a database using servlet returns a blank page
- Java Eclipse Create Heap-Dump on Breakpoint
- How to properly set spring context on javaFX with spring?
- hotkey copy-paste functionality in Properties window while developing Android app
- Use Ant for post-processing code optimization
- Is it possible to mock all the objects around an eclipse RCP application?
- Importing nodejs project in to eclipse IDE
- Struts 2 in eclipse giving "requested resource not found"
- CVS - Create Zip when comparing
- Can't import javax.servlet.annotation.WebServlet
- Rate my app dialog when the user want to exit my app
- CVS not working after switching windows user
- Eclipse doesn't add files to workspace when they are added through windows explorer
- Where is Java 1.8 installed on OS X El Capitan?
- Eclipse preference - Multiple listener in radio buttons
- Eclipse often run as XSL transformation
- Eclipse CDT Generate method stubs from header file?
- Eclipse Doesn't List Classes Within Java Packages