-
Notifications
You must be signed in to change notification settings - Fork 1
Main Components
migueLoureiro edited this page Sep 3, 2015
·
9 revisions
The architecture shall allow reusing fragments / services among applications. Also it must facilitate contribution of multiple developers. It should be simple and well documented.
- Communications with IMC systems is done with the help of the IMCJava library.
- Support for message logging as LSF format.
- All messages received from external systems are typed on reception and forward to an internal Message Bus (based in Otto).
- Communications between Fragments and Activities will use an Otto Message Bus.
- Subscribers of IMC messages should register with the bus and use a
@Subscribe
annotation. - Other events are generated by the library like
SystemConnected
,SystemDisconnected
,MainSystemSelected
, etc. - Some components may be providers of events, in which case they should be annotated with
@Provider
. - ACCL lib may output some DEBUG/INFO/WARNING/ERROR messages as Strings. These can be caught by developers applications for status checking and debugging.
- In order to support extensibility, each component should provide its own settings and default values.
- For this we will use a custom annotation
@ACCLSetting
that can be used to generate programatically aSharedPreferences
object. This is in line with what Neptus uses.
- The library should provide the following background services:
- Communications - Provide communication with the network.
- Logging - Provide logging of IMC messages in the background.
- WorldState - Provide access to last known state of external systems.
- LocalState - Access the state of this Android device. It may differ from Android if using external sensors for orientation / location.
- In order to have consistency among Activities, Fragments and Services, a Template of these Features is provided, which Application's components should extend in order to provide common functionalities and consistency among different applications. This is done in src-examples.
Keeps track of registered Listenners, allows registering and unregistering.
Simple Load/Removal of Fragments.
Some Android utilites.
Pauses and Resumes [AcclBus](https://github.com/LSTS/accl/blob/master/src/pt/lsts/accl/bus/AcclBus.java) uppon [`onPause()`](http://developer.android.com/reference/android/app/Activity.html#onPause()) and [`onResume()`](http://developer.android.com/reference/android/app/Activity.html#onResume()) Calls.
Stores the [View](http://developer.android.com/reference/android/view/View.html) to be searchable for sub components.
Provides access to its Activity's Android Utilities methods.
Provides a simples start method.
Auto register itself as listenner on [AcclBus](https://github.com/LSTS/accl/blob/master/src/pt/lsts/accl/bus/AcclBus.java).
Services that extend this can start Subscribing to IMCMessages right away with the `@Subscribe` annotation.
Check the Settings Example.