Making 'Meetups' - a distributed realtime multi-party monitoring android application, with a Google Cloud Console/Endpoints stateless backend.
Made at IIITD, under Dr. H. B. Acharya.
Made with: Vedant Das Swain, Shubham Singh
Code: https://github.com/ca9/meetup-backend
6. Backend Pointers
• Security
• OAuth2 Authentication (took 2 months to get right),
Google library changes. Google API token management.
• POST encapsulation, SHA1 identification
• Documented Client library generation, with code completion
• UTC timezones
• Checking for duplication. Object deletion.
• Stateless (No GCM dependency). No ‘session’.
6
8. Frontend Architecture
https://github.com/vedantswain/Meetup-Android
• Integration
• Interaction with backend server via client libraries
• Simplified development of client side and maintained consistency in
responses and requests
• Security
• Credentials create user and data api instances for (secure) communication
with the server
• One-time-login: Saved state of authenticated state on client’s
SharedPreferences
8
9. Frontend Contd.
• Time
• Default timezones on Mobile Devices
• DateTime object sent to server as
epoch (independent of timezone)
• Server stores time in UTC
• Ensures consistency between the clients
(irrespective of timezone) and with the server
• Exclusive Functions for Meetup Owner
• Certain functions (activate, deactivate) can
only be executed by the owner of the
metope
• Prevents anarchic behaviour
9
Frontend Structure
10. Frontend Contd.
• Single Service
• Optimisation: Single background service that
sends periodic heartbeats for a given user to all
the meetups
• Local Database
• Locations of users for different meetups at
different times are stored in the a local db
• Avoids fetching bulk data from server; simply
handles light weight latest locations
• Visualisation
• Plots path of every user on the map
• Heartbeat locations are nodes
• Colour coordinated paths to ease interpretation
10
public static abstract class LocationEntry implements BaseColumns {
public static final String TABLE_NAME = "Location";
public static final String TIME = "Time";
public static final String LATITUDE = "Latitude";
public static final String LONGITUDE="Longitude";
public static final String USERNAME="User_Name";
public static final String MEETUPNAME="Meetup_Name";
public static final String SQL_CREATE_ENTRIES =
"CREATE TABLE " + LocationEntry.TABLE_NAME + " (" +
LocationEntry._ID + " INTEGER PRIMARY KEY," +
LocationEntry.TIME + REAL_TYPE + COMMA_SEP +
LocationEntry.LATITUDE + REAL_TYPE +
COMMA_SEP +
LocationEntry.LONGITUDE + REAL_TYPE +
COMMA_SEP +
LocationEntry.USERNAME + TEXT_TYPE +
COMMA_SEP +
LocationEntry.MEETUPNAME +TEXT_TYPE +
" )";
public static final String SQL_DELETE_ENTRIES =
"DROP TABLE IF EXISTS " + LocationEntry.TABLE_NAME;
}
SQLite Local DB
11. Heartbeats
• Lightweight, high frequency messages
• Can be dropped / Can fail
• Trigger all important app functionality
• Status Responses
• Gotta give to get some love.
• Life: Update last location and timestamp of user under
meetup. Check for proximity to destination, other users. Auto
deactivate meetups, return other’s latest heartbeats.
11
12. Work Distribution
• Backend - https://github.com/ca9/meetup-backend
• Frontend - https://github.com/vedantswain/Meetup-Android
12