Landmark Remark native Android app fulfills the backlogs below by integrating Google Map SDK and Firebase services. This app uses MVVM architecture to ensure a clear flow, allows ease of maintaining the code and scalability in the future.
Below sub-tasks are created to detail the efforts and steps taken to fulfill the requirements
- Implementation of UI design
- ExploreFragment
- Google MapView
- Implementation of Working flow
- Add Google Mapview to ExploreFragment
- Map info, marker and gesture operation
- Preparation/Study of Firebase Realtime DB services
- Implementation of UI design
- AddLocationNoteActivity : The reasons why adding a location note is an activity level component instead of a fragment in MainActivity are:
- Reduce the complexity of MainActivity
- Decouple working flow for further development such as location update and multimedia support
- AddLocationNoteActivity : The reasons why adding a location note is an activity level component instead of a fragment in MainActivity are:
- Implementation of Working flow
- Integration of Firebase DB relevant APIs
- Implementation of UI design
- My Notes screen "Notes": CollectionFragment + CollectionsAdapter (The component of this screen is named "CollectionFragment" for further support of "Favorite" notes or "Friend's" note)
- Implementation of Working flow
- Integration of DB APIs
- Fetch noted locations based on creatorId
- Implementation of UI design
- Update Location Info view
- Implementation of Working flow
- Other user's location notes will be presented on ExploreFragment
- Location info view to provide detail location info when user click on a location marker
- Integration of get note API
- Implementation of UI design
- Update ExploreFragment: add SearchView + ResultAdapter
- Implementation of Working flow
- Implement functions to search location notes
- Filter results by creator name, note visibility, contained text in note title and description.
- Integration of search note API(search note based on key words, user name)
Among the BaaS providers below
Firebase ( https://firebase.google.com )
Kumulos ( https://www.kumulos.com )
Realm ( https://realm.io/products/realm-mobile-platform)
I chose Firebase as my backend service because I have used Firebase Messaging and Analytics before, it is a familiar service for me, although I have not implemented Realtime DB and Auth services in the past, which are required for this app. I spent some time studying the SDK on how to setup and integrate Firebase service, it was not difficult for me to understand and be able to use the service.
- Preparation of Firebase Auth - https://firebase.google.com/docs/auth/android/custom-auth#kotlin+ktx_1
- Regarding the user authentication, we only support "Email" + "Password" to sign up and sign in. https://firebase.google.com/docs/auth/android/password-auth
- Although Firebase Auth supports other approaches such as Google sign-in, Facebook Login, and etc, the reason why I chose Email + Password for user authentication is because when I started, I used "Email + Password" as custom user id to manage location note data as I thought there would be limited time to integrate a user Auth service. However, later I realised it is not hard to integrate Firebase Auth and its passwordAuthentication API can meets my original design so I move on this approach.
- At the moment, user sign up doesn't require email verification, user can register an account if the the email is not in use by other users.
- After user signs in sucessfully, the app will update the user's profile with Firebase Auth API and the user name used during sign up will be updated.
-
Preparation of Realtime Database - https://firebase.google.com/docs/database/android/start Data scheme of a locationData:
{ title: String description: String createdTime: String [UTC timeStamp, app will convert it to Date time] creatorId: String [hash of email+encryption] creatorName: String [ can be user's email or user name] lat: Double [from -90 to 90] lng: Double [from -180 to 180] tags: Object [list of Strings, for later extension] extra: String [for later extension] visibility: String [To indicate who can view this note: public, private, **friendOnly(has not implemented yet)**] imageUrl: String [for later extension] }
Before integrating Google Maps to the app, here are some pre-integrations to go through.
-
Create Google Project
-
Enabled Google Maps SDK for Android on Google developer console Generate and restrict the API key as mentioned (https://developers.google.com/maps/documentation/android-sdk/start#step_4_set_up_a_google_maps_api_key)
-
With the Google API key above, we can start working on MapView in the app
the diagram below shows overview of the project structure
App components under MVVM architecture
[View] ----------------------> [ViewModel] -----------------------[Model]
| <---------------------- | ----------------------- |
MainActivity MainViewModel Firebase realtime DB
ExploreFragment
CollectionsFragment
ProfileFragment
- After successful sign in, user will be navigated to MainActivity and its default fragment: ExploreFragment will be showing.
- By default, user's current or last known location will be used as default location for ExploreFragment
- User can tap on map view where has no location note. A prompt will be shown on the map and allow the user to add a new note. User can add a new location note from the "Add Note" in the location information view,
- With the location that user selects, the LatLng and address of the location will be passed to AddLocationNoteActivity.
- AddLocationNoteActivity allows user to add "title", "description" and visibility of the editing note. currently the app can only support "public" and "private".
- Tap "Notes" in the bottom navigation bar will navigate to CollectionFragment.
- At CollectionFragment page, user can browse the notes which the user have created before.
- "Location information view" in ExploreFragment presents the content of a location note
- Location notes which are owned by the user or other users are visible if the visibility of the location note is "public"
- Tapping marker in map view and searched items in ExploreFragment will bring up location information view
- Map makers: Green markers are location notes created by current user. Orange markers indicate location notes created by other users.
- SearchView in Fragment provides the function to search notes by keyword in the view.
- If keyword matches title of a location note or it is included in the note description or keyword matches note creator's name, the location note will be added to searched list.
- The floating button at the right bottom in ExploreFragment can toggle the visibility of the SearchView
- When search results are presented, user is not able to swipe or drag to move the map because it holds the focus.
- User can tap "Me" in the bottom navigation bar to navigate to ProfileFragment
- ProfileFragment shows the user's display name which are registered during sign up process
- ProfileFragment shows the email which user signs in
- User can sign out by tapping "Sign out" in ProfileFragment
Hours spent on implementing the app:
- Integration of Firebase + study - 2 hrs
- App Architecture & UX Design - 2 hrs
- Implementation - 12 hrs
- Tuning + bug fix - 4 hrs
- Location info doesn't present after creating a new location note.
- User management flow needs refinement
- User cannot create location note after sign out/sign in with another account, restart app will fix this issue.
Below are points to improve the UX/performance of this app
- Firebase Auth instance can be extracted to repository level
- Support image/multi-media for a location note
- Support location note Update/Delete
- Add "like" count to location note
- Support updating user's profile
- Add "home" icon in top bar in ExploreFragment to allow user to go back to their current location again