Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Final report Images/Room architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/badge_room_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/edit_user_profile.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/games_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/home_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/home_screen_analysis.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/medicineStore_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/medicine_store_warning.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/merged powerup work.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/old_apk_overdraw.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/over_new_apk.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/performanceGifUpdated.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/performanceOldapk.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/play_games.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
162 changes: 162 additions & 0 deletions Final report Images/report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Infrastructure Android - GSoC'18 Final Report
![Google summer of code 2018 - Systers](https://github.com/geekanamika/malaria-app-android/blob/finalReportImages/Final%20report%20Images/banner.png)

I, Anamika Tripathi, proposed to work for [Google Summer of Code](https://summerofcode.withgoogle.com/) 2018 edition
with [Systers Open Source](https://github.com/systers) for Infrastructure/automation of community's Android projects.

## Purpose
* Maintain consistency in Android projects throughout the community
* Follow Android standard android guidelines
* Improve Android performance (Memory leak, overdraw, cpu usage, etc)
* Improve User Interface
* Improve User Experience


You can checkout about the final presentation [here](https://docs.google.com/presentation/d/1C4k81wwxbFU2T5v290TeWAMDeVRYNw7sGYpsaC2OLBE/edit#slide=id.g402636dd07_0_214)

## Work Done
During the GSoC period, I have worked on two Android repositories:
* [PowerUp Android](http://github.com/systers/powerup-android/)
* [Malaria Android](http://github.com/systers/malaria-app-android/)

## Phase I

I worked mainly on shifting sqlite database to use Room Library - an architecture component.
During the shifting database, I searched various ways to handle background threads in android.
I and my mentors agreed upon using Executors to handle Room queries in background.
After implementing repository pattern for PowerUp-Android database(sqlite and preferences),
I have replaced all usages of old sqlite database to Room queries.
For handling callbacks easily, I shifted all existing activities(with db usages) to Model-View-Presenter architecture.

### Accomplishments
* Completed shifting Sqlite db to use Room library
* Drafted a document for Android standard guidelines
* Replaced old database handler functions with Room's queries
* Removed redundant code, used Model-View-Presenter architecture for various activities
* Implemented Repository pattern for database usage (Room for sqlite + preferences)
* Added comments in repository for better understanding

### Demo


### Links
Click [here](https://github.com/systers/powerup-android/search?q=is%3Apr+author%3Ageekanamika+created%3A2018-05-14..2018-08-14&unscoped_q=is%3Apr+author%3Ageekanamika+created%3A2018-05-14..2018-08-14&type=Issues)
to see PRs during GSoC period for PowerUp-Android

Click [here](https://github.com/systers/powerup-android/search?q=is%3Aissue+involves%3Ageekanamika+created%3A2018-05-14..2018-08-14&unscoped_q=is%3Aissue+involves%3Ageekanamika+created%3A2018-05-14..2018-08-14&type=Issues)
to see issues created during GSoC period for PowerUp-Android


## Phase II + Phase III

I started with implementing repository pattern for project. For sqlite database, I shifted it to Room Library.
Later on, I've shifted all preference usage in application to one file inside data directory.
In next step, I started with shifting project to Model-View-Presenter architecture. Along with MVP implementation,
I have followed Material Design guidelines for user interface. In last phase, I've also measured application's performance, made relevant changes to improve performance.

### Accomplishments
* Completed shifting sqlite db to use Room library
* Implemented Repository pattern for database usage(Room for sqlite + preferences)
* Shifted project to follow MVP architecture
* Created new layouts, improved many layouts to follow material design guidelines
* Measured, improved application performance(Memory, cpu, overdraw)

###Demo

### Demo + UI Comparison

**User Profile**
- Allow user to add name, email, age, medicine
- If already submitted, provide edit option with auto-fill from preference data

<p align="center">

<img title="GSoC 2018" src="https://github.com/geekanamika/malaria-app-android/blob/finalReportImages/Final%20report%20Images/edit_user_profile.gif"
width="250" height="500">

<img title="GSoC 2018" src="https://github.com/geekanamika/malaria-app-android/blob/finalReportImages/Final%20report%20Images/user_profile_old.gif"
width="250" height="500">

</p>


### Performance Comparison
**Memory usage**

New apk - memory usage
![New apk memory usage](https://github.com/geekanamika/malaria-app-android/blob/finalReportImages/Final%20report%20Images/performanceGifUpdated.gif)

Old apk - memormy usage
![Old apk memory usage](https://github.com/geekanamika/malaria-app-android/blob/finalReportImages/Final%20report%20Images/performanceOldapk.gif)

**Overdraw**


### Links
Click [here](https://github.com/systers/malaria-app-android/search?q=is%3Aissue+involves%3Ageekanamika+created%3A2018-05-14..2018-08-14&type=Issues)
to see issues during GSoC period for Malaria-Android

Click [here](https://github.com/systers/malaria-app-android/search?p=1&q=is%3Apr+involves%3Ageekanamika+created%3A2018-05-14..2018-08-14&type=Issues&unscoped_q=is%3Apr+involves%3Ageekanamika+created%3A2018-05-14..2018-08-14)
to see PRs created during GSoC period for Malaria-Android

## Technical Aspects
- [Butterknife library]( http://jakewharton.github.io/butterknife/) to reduce the boilerplate code and make it more structured
- Constraint Layouts to develop flexible layouts and reduce overdraw
- TimeLine view to display User's data analysis in malaria-android
- TapTargetViewer to provide feature detection in malaria-android games
- Room Library to reduce boiler plate code, compile time verification
- Repository pattern for easy database access
- Material design suggested diff types of dialogs, bottom navigation, fonts, colors, styles

## Challenges
- Research for Android best practices for every implementation
- git merge conflicts
- Collaboration with two GSoC student (Due to two android projects)
- Working in background thread for Database, Callbacks
- Working Remotely (Primary Mentor in PST, Admin in ET )
- Codacy errors


## Future Developements
**PowerUp-Android**

- Improve mini-games to follow MVP infrastructure
- Shift Session History to preferences
- Improve performance (remove overdraw, reduce existing boilerplate code, etc)

**Malaria-android**
- Add animation within fragments and activities
- Write Unit tests
- Add feature: create Setting screen instead of resetting database by dialog
- Add feature: show list of Trips created, allow users to delete particular trip details
- Create layouts for larger devices/landscape version


## Take Away
- Learnt Android best practices (MVP, Repository pattern, etc)
- Used Libraries: Room, Butterknife, Constraint layout, TimelineView, TapTargetViewer etc
- Worked as a developer who worries about application performance
- Researched in material design guidelines
- Used Receiver, Services, Alarm manager
- Project documentation
- Improved blogging skills (7/13 blogs published in different publications)
- Improved Soft skills: telephonic conversation, project presentation, time management, etc
- Remote working experience

## Important Links
- [Project Documentation](https://drive.google.com/open?id=1CDMo5UDnyAVoBVvAky9qasYuiacuUj_2jyM2JlJX0lA)
- [Final Demo youtube live](https://www.youtube.com/watch?v=HZUwu-GiDIc&list=PLhVJyXjT75i_T-F70O0DGfz_Fu9aBpnI6&index=3&t=2s)
- [Final Demo powerpoint presentation](https://docs.google.com/presentation/d/1C4k81wwxbFU2T5v290TeWAMDeVRYNw7sGYpsaC2OLBE/edit?usp=sharing)
- [Full application video](https://drive.google.com/open?id=141ZAorloucZSJ9A7xkp_9xse7WCI7UmJ)

## Team
**Student:**
- [Anamika Tripathi](https://github.com/geekanamika)

**Mentors:**
- [Manju](https://github.com/manjumegh) - All phases
- [Nikita](https://github.com/m-murad) - All phases
- [Manisha](https://github.com/manishakeim) - First phase

**Admin:**
- [May](https://github.com/ExactlyMay) - All phases
Binary file added Final report Images/trip_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/trip_screen.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Final report Images/user_profile_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
Expand All @@ -12,8 +11,8 @@ buildscript {
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
google()
jcenter()
}
}

Expand Down
5 changes: 4 additions & 1 deletion malaria-app-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ android {
}

dependencies {
implementation "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion" // v4
implementation "com.android.support:support-v4:$rootProject.ext.supportLibraryVersion"
// v4
implementation "com.viewpagerindicator:library:$rootProject.ext.viewPagerIndicatorVersion"
implementation "com.android.support:design:$rootProject.ext.supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
Expand All @@ -40,6 +41,8 @@ dependencies {
implementation files('libs/GraphView-3.1.2.jar')
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
compile 'com.github.vipulasri:timelineview:1.0.6'
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.12.0'
//Room
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
Expand Down
22 changes: 15 additions & 7 deletions malaria-app-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

<application

android:name=".utils.VolleyApplication"
android:name=".ui.base.MyApp"
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service android:name=".services.AlarmService" />
<service android:name=".notifications.service.AlarmService" />

<receiver android:name=".code.reciever.AlarmAutoStart">
<receiver android:name=".notifications.receiver.DeviceRebootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name=".code.reciever.AlarmHandlerClass"
android:name=".notifications.receiver.AlarmHandlerClass"
android:exported="false">
<intent-filter>
<action android:name="com.peacecorps.malaria.START_ALARM" />
Expand Down Expand Up @@ -55,8 +55,13 @@
</intent-filter>
</activity>
<activity
android:name=".ui.home_screen.MainActivity"
android:name=".ui.main.MainActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:label="@string/app_name" />
<activity android:name=".ui.user_profile.edit_profile.EditProfileActivity"
android:screenOrientation="portrait"
android:label="Edit Profile"/>
<activity android:name=".code.activities.InfoHubFragmentActivity" />
<activity
android:name=".code.activities.PeaceCorpsPolicyFragmentActivity"
Expand All @@ -80,16 +85,19 @@
<activity android:name=".code.activities.DayFragmentActivity" />

<activity
android:name=".code.activities.RemainderToneActivity"
android:name=".ui.home_screen.ReminderToneActivity"
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" />

<activity
android:name=".code.activities.TripAlarmActivity"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Dialog.NoActionBar" />
<activity android:name=".ui.medicine_store.MedicineStoreActivity" />
<activity android:name=".ui.play.myth_vs_fact.MythFactActivity" />
<activity android:name=".ui.play.rapid_fire.RapidFireActivity" />

<service
android:name=".services.TripAlarmService"
android:name=".code.reciever.services.TripAlarmService"
android:enabled="true" />

<receiver android:name=".code.reciever.TripAlarmReceiver" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ public long checkDrugTakenTimeInterval(String time,long day_time) {
calt.add(Calendar.MONTH, 2);
Date start = calt.getTime();
Date end = cal.getTime();
//Todo idk what key it is, check later
SharedPreferenceStore.mEditor.putLong("com.peacecorps.malaria."
+ time, takenDate).apply();
if (SharedPreferenceStore.mPrefsStore.getBoolean("com.peacecorps.malaria.isWeekly", false)) {
Expand Down

This file was deleted.

Loading