Skip to content

Instantly share code, notes, and snippets.

@geekanamika
Last active August 14, 2018 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geekanamika/9c87c250774e567d889fbe412a93e91e to your computer and use it in GitHub Desktop.
Save geekanamika/9c87c250774e567d889fbe412a93e91e to your computer and use it in GitHub Desktop.
Infrastructure Android - GSoC'18 Final Report

Infrastructure Android - GSoC'18 Final Report

Google summer of code 2018 - Systers

I, Anamika Tripathi, proposed to work for Google Summer of Code 2018 edition with Systers Open Source for Infrastructure/automation Android projects. I would like to thank May, Manju, Nikita, Manisha for their guidance and support throughout the program.

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

Work Done

During the GSoC period, I have worked on two Android repositories:

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

Powerup Android Working GIFs
  • Start New game, select avatar eyes, clothes, hair, skin color
  • Choose NPCs after confirming avatar, atleast one required
  • Hospital scenario
  • At the end of scenario, it leads to memory match mini game
  • Library Scenario
  • At the end, it leads to Sink-to-Swim mini game

Links

Click here to see PRs during GSoC period for PowerUp-Android

Click here 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 + UI Comparison

New Apk Old Apk
User Profile
  • Allow user to add name, email, age, medicine
  • If already submitted, provide edit option with auto-fill from preference data
Plan Trip
  • Allow user to add location, departure date, arrival date, reminder time
  • Select Item screen/dialog will provide option to add item, cash, medicines(automatically quantity calculated based on trip dates)
  • Save data, provide options for selecting location, remind users to pack by notification on selected reminder timing
Analysis screens
  • Displays user medication history, adherence to medicine & no. of regular doses
  • Shifted to user icon in new implementation
Badge screen
  • Three types of badges availabe based on user score(taking medicines timely)
  • Game score(giving right answers), Plan Trip (if user plan their first trip)
Game screen
  • Two games available: Rapid Fire, Myth Vs Fact
  • TapTargetViewer added for first time play
  • Medicine Store shifted to app bar, badge screen to profile screen from old app
Medicine Store
  • Allow user to add medicines to store, provide reminder on home screen with warning
  • Shifted to appbar in new implementation, allow user to order medicine via msg/email
Home Screen
  • Allow user to set "yes" or "no" to medicine consumption
  • set reminder tone, reset database

Performance Comparison

New Apk Old Apk
Over Draw comparison

Memory usage comparison (Android Profiler)

New apk - memory usage New apk memory usage

Old apk - memomy usage Old apk memory usage

Links

Click here to see issues during GSoC period for Malaria-Android

Click here to see PRs created during GSoC period for Malaria-Android

Technical Aspects

  • Butterknife library 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment