Difference between revisions of "Team Algol"
From mn/ifi/inf5750
m (Tag: Visual edit) |
(→Application layout before vs. now) |
||
(47 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | Team Algol : Android Messenger | + | Team Algol : Android Messenger application for DHIS2 |
== Group members == | == Group members == | ||
Line 18: | Line 18: | ||
#* REST calls to DHIS2 for authentication and user information | #* REST calls to DHIS2 for authentication and user information | ||
#* XMPP messaging | #* XMPP messaging | ||
− | # DHIS2 instance | + | #* Google cloud services communication ? |
− | # XMPP server | + | # DHIS2 instance |
+ | # XMPP server (previously: https://github.com/niclashalvorsen/DHISOpenfire and:https://github.com/niclashalvorsen/Openfire-DHISAuthentication) | ||
+ | # Google Cloud services on DHIS2 server ? (https://github.com/niclashalvorsen/DHIS2-GCMSupport) | ||
+ | [[File:messenger-architecture.png|Architecture]] | ||
== Project details == | == Project details == | ||
− | + | Importing to android studio: | |
+ | #Open android studio. | ||
+ | #Click import project | ||
+ | #Select Gradle project. | ||
+ | #Find the "build.gradle" file inside the app folder and select it. | ||
+ | (This way you use the gradle plugin from android studio) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Details about how we will solve the task, and component-like view of it go here... | |
− | 1. Rest interface/layer redesign. | + | # Go over the libraries and decide which is worth using: (time to implement the functionality ourselves + testing vs the resource cost of using the library + going over the library interface |
− | + | #* asmack.jar (Xmpp code redesign to comply with maven): https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide | |
− | + | #* <s>reactiveX (Observables): https://github.com/ReactiveX/RxAndroid</s> | |
− | + | #* butterknife (activities & ui): http://jakewharton.github.io/butterknife/ | |
− | + | #* Material Design (UI ): https://www.google.com/design/spec/material-design/introduction.html | |
− | + | #* <s>ormLite (sql orm for android): http://ormlite.com/sqlite_java_android_orm.shtml</s> | |
− | + | #* <s>DHIS2 Android sdk: https://github.com/dhis2/dhis2-android-sdk</s> | |
− | + | # Rest interface/layer redesign. | |
− | + | #* Rest Session storage? Use Persistance layer or Cache layer ? | |
− | + | #* How would the rest calls hit/miss the cache? | |
− | + | #* Is the DHIS2 api satisfactory ? | |
− | + | # Persistance layer | |
− | + | #* <s>Use the OrmLite library ?</s> | |
− | + | #* Store data on app start/exit | |
− | + | #* Provide interface for the Rest Layer | |
− | + | # Cache layer. | |
− | + | #* If requested object in memory return it. If not use persistance layer to get it. If not on disk return null/empty list, informing that it is not cached. | |
+ | # Go over all the ui and redo it to use Material design. Maybe use butterknife for activities as well ? | ||
+ | # Test the app. Test all the corner cases. | ||
+ | #* Unit tests on android : https://developer.android.com/training/activity-testing/activity-unit-testing.html | ||
== Work schedule == | == Work schedule == | ||
# Milestone ('''8th November''') | # Milestone ('''8th November''') | ||
#* Analysis of previous solution | #* Analysis of previous solution | ||
− | #* Work planning according to the findings | + | #* Work planning according to the findings: Result: We split the app up in four sections/areas, assigning people to each. |
+ | #** Xmpp client/server/api (Thomas) | ||
+ | #** Caching (REST/XMPP) (Vladislav) | ||
+ | #** REST client/server/api (Mathias and Jiader) | ||
+ | #** GUI and Matherial Design (Hans) | ||
# Milestone ('''22nd November''') | # Milestone ('''22nd November''') | ||
+ | #* Run own instance of [https://www.dhis2.org/ DHIS2] (all) | ||
+ | #* Update REST API calls, use [https://github.com/ReactiveX/RxAndroid ReactiveX] library and reduce the number of calls and amount of data transfered (Mathias and Jiader) | ||
+ | #* Fix [https://github.com/dhis2msg/Openfire-DHISAuthentication Openfire DHIS authentication] library and run [http://www.igniterealtime.org/projects/openfire/ Openfire] XMPP server (Tomas) | ||
+ | #* Caching: Fix problem with long reopening of the application and improve local storage (Vladislav) | ||
+ | #** Analyze XMPPSessionStore.[done] | ||
+ | #** Compare RESTClient to XMPPClient.[done] | ||
+ | #** Go trough Activities, Fragments and anonymous asynchronious tasks that relate to REST calls and caching. [done] | ||
+ | #** Implement RESTSessionStorage class and methods to set/get *Model lists of objects/objects [done] | ||
+ | #** Refactor XMPPSessionStorage if nessesary [not nessesary] | ||
# Milestone ('''4th December''') | # Milestone ('''4th December''') | ||
+ | #* Update [https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide Smack] client library and fix XMPP issues (Tomas) | ||
+ | #* Run DHIS with Openfire on publicly accessible server (Tomas) | ||
+ | #* Improve GUI using [http://jakewharton.github.io/butterknife/ Butter Knife] and [https://www.google.com/design/spec/material-design/introduction.html Material design] (Hans) | ||
+ | #* Inprove the caching of InboxModel, implement conversation caching and analyze InterpretationsModel's data usage. Possibly implementing caching for interpretations. (Vladislav). | ||
+ | #** Implement caching for the User Profile. [done] | ||
+ | #** Implement ways to store cache for different users.[done] RESTSessionStorage can select an instance of the class for the user. | ||
+ | #** Implement ways to intentionally skip the cache. (ex: when clicking the refresh button). [done] | ||
+ | #** Implement caching for the conversations. [done] A list of the conversation messages is attached to InboxModel.messages, and InboxModel.members holds the users. And this is refreshed when the InboxModel.read == false. Also when a conversation is updated (ie already in cache), the REST call only gets the messages from the server, without the users. This saves data. | ||
+ | #** Merge pages retrieved from the server into the cached inboxModel page. [done] | ||
+ | #** Improve the overall caching class structure. [done] By abstracting the page/list caching methods into a CacheList<Type extends CopyAttributes> class and CopyAttributes<Type> interface. | ||
+ | #** Analyze the Interpretations. [done] Result: Interpretations functionality is incomplete: Cannot get next page, there is no reload button. Thus implementing caching for it is unnecessary. But I have written initial implementation /stub for the caching, similiar to the inboxModel one, bothi in RESTSessionStorage.java and in InterpretationFragment.java. I also cleaned up the InterpretationsFragment class in the process. | ||
+ | #** Overall REST client debugging. [done] There is a bug that I couldn't figure out: Sometimes pages start being added twice to the lists. Also for some reason every single AsyncTask is ran twice. | ||
+ | # Final delivery ('''11th December''') | ||
+ | #* Run [https://www.dhis2.org/ DHIS2] with [https://github.com/niclashalvorsen/DHIS2-GCMSupport GCM extension] (Tomas) | ||
+ | #* Store the memory caches to a file and restore from that file on app start. Using plain files & json or https://github.com/Jearil/SimpleNoSQL or https://github.com/couchbase/couchbase-lite-android (Vladislav) | ||
+ | #* Stabilize the application | ||
+ | #* Measure traffic usage | ||
+ | #* Write unit tests for every component of the application | ||
+ | |||
+ | == How to run the application == | ||
+ | Follow the instructions. If you do not want to run your own local server, skip first two steps and choose address '''''88.80.187.109''''' (our testing server) from the list. | ||
+ | |||
+ | Note: The app works with the DHIS2 demo servers as well. (The xmpp chat functionality however, won't work with the DHIS2 demo server.) | ||
+ | # DHIS Server | ||
+ | #* download [https://www.dhis2.org/download/live/dhis2-live.zip DHIS 2 Live] package | ||
+ | #* unzip it somewhere on your machine | ||
+ | #* run the script based on your platform (either '''''dhis2-live.exe''''' or '''''startup.sh''''') | ||
+ | # Openfire XMPP Server | ||
+ | #* clone [https://github.com/dhis2msg/Openfire-DHISAuthentication Openfire-DHISAuthentication] repository | ||
+ | #* build the project using Maven ('''''dhis.provider-1.0.0-SNAPSHOT.jar '''''should be created in '''''target''''' directory) | ||
+ | #* download the latest [http://www.igniterealtime.org/downloads/index.jsp Openfire] server for your platform | ||
+ | #* run the installer or unzip the archive | ||
+ | #* copy '''''dhis.provider-1.0.0-SNAPSHOT.jar '''''generated before to '''''openfire/lib''''' directory | ||
+ | #* copy '''''~/.m2/repository/net/iharder/base64/2.3.8/base64-2.3.8.jar''''' to '''''openfire/lib''''' directory | ||
+ | #* run Openfire from '''''openfire/bin''''' directory ('''''./openfire start''''' for Linux systems) | ||
+ | #* go to [http://localhost:9090/ Openfire Admin Console] and go throught the basic setup if you want | ||
+ | #* go to '''''System Properties''''' and change '''''provider.auth.className''''' to '''''org.hisp.dhis.provider.DHISAuthProvider''''' | ||
+ | #* restart the server ('''''./openfire restart''''' for Linux systems) | ||
+ | #* make sure your firewall does not block port '''''5222''''' | ||
+ | # DHIS Messenger for Android | ||
+ | #* clone [https://github.com/dhis2msg/DHISmessenger DHISmessenger] repository and open the project in [http://developer.android.com/tools/studio/index.html Android Studio] | ||
+ | #* build and run the application (either using [http://developer.android.com/tools/help/emulator.html Android Emulator] or your [http://developer.android.com/tools/device.html Android smartphone]) | ||
+ | #* make sure your phone is connected to the Internet | ||
+ | #* in the application enter your computer's external IP address (you can find it with '''''ifconfig''''' command on Linux systems) | ||
+ | #* log in using username '''''admin''''' and password '''''district''''' | ||
== Group organization == | == Group organization == | ||
− | * Source code | + | * Source code ([https://github.com/dhis2msg dhis2msg] organization on GitHub) |
− | + | ** [https://github.com/dhis2msg/DHISmessenger DHISmessenger] repository with Android application | |
− | ** [https://github.com/dhis2msg/DHISmessenger DHISmessenger] repository | + | ** [https://github.com/dhis2msg/Openfire-DHISAuthentication Openfire-DHISAuthentication] repository with DHIS2 authentication provider for Openfire |
− | * Weekly meetings | + | * Weekly in-person meetings |
− | ** Group 1 Tuesday 10:15 - 12:00 | + | ** group sessions (Group 1, Tuesday 10:15 - 12:00) |
− | ** | + | ** during or after the lecture (Thursday 12:15 - 14:00) |
− | * | + | * Online communication |
− | ** [https://slack.com/ Slack] service for group comunication | + | ** [https://slack.com/ Slack] service for real-time group comunication |
+ | ** [https://github.com/dhis2msg/DHISmessenger/issues GitHub issues] for discussing larger changes | ||
+ | |||
+ | == Application layout before vs. now == | ||
+ | *The layout before we started working on the application: | ||
+ | [[File:Chat_old.png|250px|Chat before]] | ||
+ | [[File:Drawer_old.png|250px|Drawer before]] | ||
+ | [[File:Inbox_old.png|250px|Inbox before]] | ||
+ | [[File:new_message_old.png|250px|New message before]] | ||
+ | |||
+ | *The layout after we worked on the application: | ||
+ | [[File:Chat_new.png|250px|Chat after]] | ||
+ | [[File:Drawer_new.png|250px|Drawer after]] | ||
+ | [[File:Inbox_new.png|250px|Inbox after]] | ||
+ | [[File:new_message_new.png|250px|New message after]] | ||
== Assignment text == | == Assignment text == | ||
Can be found at: https://www.uio.no/studier/emner/matnat/ifi/INF5750/h15/group-projects/messenger-app/index.html | Can be found at: https://www.uio.no/studier/emner/matnat/ifi/INF5750/h15/group-projects/messenger-app/index.html |
Latest revision as of 00:01, 12 December 2015
Team Algol : Android Messenger application for DHIS2
Contents
Group members
- Vladislav Georgiev Alfredov <vladisla@ifi.uio.no>
- Tomáš Livora <tomasliv@student.matnat.uio.no>
- Mathias Ciarlo Thorstensen <mathiact@ifi.uio.no>
- Hans Fredrik Fahle <hansffa@student.matnat.uio.no>
- Jiader Chou <jiaderc@ifi.uio.no>
Summary of Requirements
- Reduce data usage
- Implement local data storage
- Implement local data caching
- Redesign user interface to follow Material design guidelines
Architecture
- Android application
- REST calls to DHIS2 for authentication and user information
- XMPP messaging
- Google cloud services communication ?
- DHIS2 instance
- XMPP server (previously: https://github.com/niclashalvorsen/DHISOpenfire and:https://github.com/niclashalvorsen/Openfire-DHISAuthentication)
- Google Cloud services on DHIS2 server ? (https://github.com/niclashalvorsen/DHIS2-GCMSupport)
Project details
Importing to android studio:
- Open android studio.
- Click import project
- Select Gradle project.
- Find the "build.gradle" file inside the app folder and select it.
(This way you use the gradle plugin from android studio)
Details about how we will solve the task, and component-like view of it go here...
- Go over the libraries and decide which is worth using: (time to implement the functionality ourselves + testing vs the resource cost of using the library + going over the library interface
- asmack.jar (Xmpp code redesign to comply with maven): https://github.com/igniterealtime/Smack/wiki/Smack-4.1-Readme-and-Upgrade-Guide
-
reactiveX (Observables): https://github.com/ReactiveX/RxAndroid - butterknife (activities & ui): http://jakewharton.github.io/butterknife/
- Material Design (UI ): https://www.google.com/design/spec/material-design/introduction.html
-
ormLite (sql orm for android): http://ormlite.com/sqlite_java_android_orm.shtml -
DHIS2 Android sdk: https://github.com/dhis2/dhis2-android-sdk
- Rest interface/layer redesign.
- Rest Session storage? Use Persistance layer or Cache layer ?
- How would the rest calls hit/miss the cache?
- Is the DHIS2 api satisfactory ?
- Persistance layer
-
Use the OrmLite library ? - Store data on app start/exit
- Provide interface for the Rest Layer
-
- Cache layer.
- If requested object in memory return it. If not use persistance layer to get it. If not on disk return null/empty list, informing that it is not cached.
- Go over all the ui and redo it to use Material design. Maybe use butterknife for activities as well ?
- Test the app. Test all the corner cases.
- Unit tests on android : https://developer.android.com/training/activity-testing/activity-unit-testing.html
Work schedule
- Milestone (8th November)
- Analysis of previous solution
- Work planning according to the findings: Result: We split the app up in four sections/areas, assigning people to each.
- Xmpp client/server/api (Thomas)
- Caching (REST/XMPP) (Vladislav)
- REST client/server/api (Mathias and Jiader)
- GUI and Matherial Design (Hans)
- Milestone (22nd November)
- Run own instance of DHIS2 (all)
- Update REST API calls, use ReactiveX library and reduce the number of calls and amount of data transfered (Mathias and Jiader)
- Fix Openfire DHIS authentication library and run Openfire XMPP server (Tomas)
- Caching: Fix problem with long reopening of the application and improve local storage (Vladislav)
- Analyze XMPPSessionStore.[done]
- Compare RESTClient to XMPPClient.[done]
- Go trough Activities, Fragments and anonymous asynchronious tasks that relate to REST calls and caching. [done]
- Implement RESTSessionStorage class and methods to set/get *Model lists of objects/objects [done]
- Refactor XMPPSessionStorage if nessesary [not nessesary]
- Milestone (4th December)
- Update Smack client library and fix XMPP issues (Tomas)
- Run DHIS with Openfire on publicly accessible server (Tomas)
- Improve GUI using Butter Knife and Material design (Hans)
- Inprove the caching of InboxModel, implement conversation caching and analyze InterpretationsModel's data usage. Possibly implementing caching for interpretations. (Vladislav).
- Implement caching for the User Profile. [done]
- Implement ways to store cache for different users.[done] RESTSessionStorage can select an instance of the class for the user.
- Implement ways to intentionally skip the cache. (ex: when clicking the refresh button). [done]
- Implement caching for the conversations. [done] A list of the conversation messages is attached to InboxModel.messages, and InboxModel.members holds the users. And this is refreshed when the InboxModel.read == false. Also when a conversation is updated (ie already in cache), the REST call only gets the messages from the server, without the users. This saves data.
- Merge pages retrieved from the server into the cached inboxModel page. [done]
- Improve the overall caching class structure. [done] By abstracting the page/list caching methods into a CacheList<Type extends CopyAttributes> class and CopyAttributes<Type> interface.
- Analyze the Interpretations. [done] Result: Interpretations functionality is incomplete: Cannot get next page, there is no reload button. Thus implementing caching for it is unnecessary. But I have written initial implementation /stub for the caching, similiar to the inboxModel one, bothi in RESTSessionStorage.java and in InterpretationFragment.java. I also cleaned up the InterpretationsFragment class in the process.
- Overall REST client debugging. [done] There is a bug that I couldn't figure out: Sometimes pages start being added twice to the lists. Also for some reason every single AsyncTask is ran twice.
- Final delivery (11th December)
- Run DHIS2 with GCM extension (Tomas)
- Store the memory caches to a file and restore from that file on app start. Using plain files & json or https://github.com/Jearil/SimpleNoSQL or https://github.com/couchbase/couchbase-lite-android (Vladislav)
- Stabilize the application
- Measure traffic usage
- Write unit tests for every component of the application
How to run the application
Follow the instructions. If you do not want to run your own local server, skip first two steps and choose address 88.80.187.109 (our testing server) from the list.
Note: The app works with the DHIS2 demo servers as well. (The xmpp chat functionality however, won't work with the DHIS2 demo server.)
- DHIS Server
- download DHIS 2 Live package
- unzip it somewhere on your machine
- run the script based on your platform (either dhis2-live.exe or startup.sh)
- Openfire XMPP Server
- clone Openfire-DHISAuthentication repository
- build the project using Maven (dhis.provider-1.0.0-SNAPSHOT.jar should be created in target directory)
- download the latest Openfire server for your platform
- run the installer or unzip the archive
- copy dhis.provider-1.0.0-SNAPSHOT.jar generated before to openfire/lib directory
- copy ~/.m2/repository/net/iharder/base64/2.3.8/base64-2.3.8.jar to openfire/lib directory
- run Openfire from openfire/bin directory (./openfire start for Linux systems)
- go to Openfire Admin Console and go throught the basic setup if you want
- go to System Properties and change provider.auth.className to org.hisp.dhis.provider.DHISAuthProvider
- restart the server (./openfire restart for Linux systems)
- make sure your firewall does not block port 5222
- DHIS Messenger for Android
- clone DHISmessenger repository and open the project in Android Studio
- build and run the application (either using Android Emulator or your Android smartphone)
- make sure your phone is connected to the Internet
- in the application enter your computer's external IP address (you can find it with ifconfig command on Linux systems)
- log in using username admin and password district
Group organization
- Source code (dhis2msg organization on GitHub)
- DHISmessenger repository with Android application
- Openfire-DHISAuthentication repository with DHIS2 authentication provider for Openfire
- Weekly in-person meetings
- group sessions (Group 1, Tuesday 10:15 - 12:00)
- during or after the lecture (Thursday 12:15 - 14:00)
- Online communication
- Slack service for real-time group comunication
- GitHub issues for discussing larger changes
Application layout before vs. now
- The layout before we started working on the application:
- The layout after we worked on the application:
Assignment text
Can be found at: https://www.uio.no/studier/emner/matnat/ifi/INF5750/h15/group-projects/messenger-app/index.html