Veo App Challenge - David Hagen

Related tags

App VeoAppChallenge
Overview

VeoAppChallenge - David Hagen

App Capabilities:

  • MapsActivity

    • On launch the app loads a Google Maps fragment and will request the user for location permissions (both Coarse and Fine)

    • Users can tap a location on the map and the app will draw a polyline to the location based on the response from the Google Directions API

    • The start button will be enabled at this point, when the user clicks it the app will begin tracking their location and drawing their path on the map

    • Once the user arrives at the location or they click the "End Trip" button, they will be prompted by a dialog to store their trip data

    • After a trip is ended, the activity will still show their directions route polyline, taken path polyline, time, and distance traveled

    • The user can reset the map and select a new location

    • The user can start the ViewTripsActivity by clicking a floating action button

  • ViewTripsActivity

    • This simply activity will display a recycler view to the user containing all of the stored Trips from the database

    • Users can tap individual rows and they will be prompted to delete them

    • Or users can tap the "Clear all" button to delete all stored Trips


Development Decisions

In developing this app I utilized current conventions and industry best practices such as MVVM, Dagger for dependency injection, and more. I knew I would use the Google Maps API as the base driver due to Google's comprehensive documentation and integration. I have worked with Google's location APIs before, but not to this level so I dove into their documentation to familiarize myself with real time location tracking and drawing polylines.

Once I had an idea of what exact API calls I would need to do I began creating the ApiClient using Retrofit to handle the calls themselves, and Dagger2 to handle providing access to the client from the activities. I used Postman to test the call I was trying to build to determine what information I needed to parse out of the response. I then created the necessary Model classes to handle this data. Finally, I implemented the polyline creation from the overview polyline element from the response.

Once that was done I began working on drawing the real time path the user was taking, this required a bit of experimenting with different location update parameters (interval, accuracy, and smallestDisplacement). I settled on updating every 3 seconds with high accuracy and a displacement of 3 meters. I believe Veo currently uses a 5 second interval before scanning a scooter, but I'm not sure what the interval is while a ride is active. There are two ways the trip will end, either the user gets within ~15 meters of their destination or they click the "End Trip" button. When a trip is ended, the user will be prompted to store their trip data.

This storage is implemented using Room. Dagger is used to provide the DAO to the activities. The data class for the trip is the TripEntity class. The fields being stored that end up displayed to the user are duration, distance, and start time. The DAO contains methods to insert a trip, get a list of all trips, and delete either 1 or all trips.

Once the storage was finished I began working on the second activity that would allow the users to view their stored trips. To start this activity, the user can click on a floating action button showing a floppy disk icon. This activity shows the full list of trips stored in the database in a recycler view. I also added an average speed text view that is calculated based on the totalDistance (in meters) and the duration (in second) to be displayed in miles per hour. The user can tap on a recycler view list item to bring up a dialog asking if they would like to delete it. Or they can tap on the "Clear All Trips" button to delete every Trip at once.


Dependencies

  • Google maps play-services, maps-services - The play-services are required to track location in real time and control the map fragment

  • Coroutines - Used to access the database asynchronously in the background to not hold up the UI thread

  • Retrofit - Allows us to make calls to the Directions API via a custom client I wrote. Also includes the Gson converter for database type converting

  • Dagger - Dependency injection

  • RxJava adapter - Used to handle observables/live data

  • Room - Database library. I had to use their latest release candidate build (rc01) due to a bug present in their latest stable release that causes the library to break when developing on an Apple ARM chip.

  • RecyclerView - Ensure we have latest version, used to display live data from the database


Demo Video

Demo Video Link


Screenshots

Get permission dialog

Get permission

Initial screen when app is opened

Initial screen

After user taps the map

Path Mapped

While the trip is active/being tracked

Trip Active

Dialog prompt to store the trip

Store Trip

The list of all trips

Trip List

Dialog prompt to delete trip

Delete Trip Prompt

You might also like...
PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture
PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture

A simple project to Chiper challenge taken data from The Movie DB based on Kotli

YelpAndroidChallenge - Yelp Android Challenge

Weedmaps Android Code Challenge! Hi there! Thank you for taking the time to cond

Google Developer Student Clubs 2022 Solution Challenge - Team East River's Android Application
Google Developer Student Clubs 2022 Solution Challenge - Team East River's Android Application

Solution-Challenge-2022-VEGATHER Google Developer Student Clubs 2022 Solution Challenge - Team East River's Android Application VEGATHER is an app ser

Food Recipe App is an app for collecting most of food recipe in one app

Food Recipe App is an app for collecting most of food recipe in one app

Library to change Android launcher App Icon and App Name programmatically !

AppIconNameChanger Change Android App launcher Icon and App Name programmatically ! Download Demo APK from HERE Kindly use the following links to use

The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.
The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

Il Bil App Introduction I will introduce you to how to implement Account Kit, Map Kit, Game Service. About the game: The app has got fullscreen Turkey

HideDroid is an Android app that allows the per-app anonymization of collected personal data according to a privacy level chosen by the user.
HideDroid is an Android app that allows the per-app anonymization of collected personal data according to a privacy level chosen by the user.

HideDroid An Android App for preserving user privacy HideDroid is an Android app that allows the per-app anonymization of collected personal data acco

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.
Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Owner
null
Android-coding-challenge - Vien Health Android coding challenge

Vien Health Android coding challenge Tasks There's a series of tasks to complete

Ezekiel Sebastine 1 Jun 27, 2022
remote technical interview Android challenge app

Android challenge We would like to learn more about how you approach a challenge as an Android Engineer. There is a simple app that isn’t made with be

GetYourGuide 0 Jan 9, 2023
code for the Mobiquity QA challenge assignment

MOBIQUITY QA CODE CHALLENGE This repository contains the code for Mobiquity code assignment for the Senior QA engineer position. Tech Stack the tools

ricardo larrahondo 1 Jan 3, 2022
Coding Challenge for ParadoxCat

WavDecoder Coding Challenge for ParadoxCat WavHeaderReader This class takes the ByteArray which supposed to be a 44 bytes length array from the very s

Alexander Styagov 0 Nov 5, 2021
Fourthwall Android Challenge

Fourthwall Android Challenge This is the implementation of Fourthwall Android Coding Challenge Technologies used: Kotlin + Android Studio This project

Santiago Carrillo 0 Nov 8, 2021
An Android application sample for ClearScore coding challenge

ClearScoreChallenge An Android application sample for ClearScore coding challenge Libraries Coroutines for managing background threads. (A coroutine i

Ozan Topuz 1 Nov 18, 2021
A template for Advent of Code challenge with input downloading and prepared test classes

Advent of Code Kotlin Template A template which will help you concentrate on the puzzle solutions. It brings Downloading and caching of the puzzle inp

Henning B 2 Dec 1, 2021
Advent of Code in Kotlin. Jetbrains challenge.

aoc-kotlin-2021 Welcome to the Advent of Code1 Kotlin project created by xreaper95 using the Advent of Code Kotlin Template delivered by JetBrains. In

Luis Ernesto Del Toro Peña 9 Mar 1, 2022
Solution to the 2021 Advent of code challenge in Kotlin. aoc-2021-in-kotlin

advent-of-code-2021 Welcome to the Advent of Code1 Kotlin project created by aniobistanley using the Advent of Code Kotlin Template delivered by JetBr

null 0 Dec 24, 2021
UP42 backend coding challenge

UP42 backend coding challenge by Paweł Radecki Build and deploy locally ./gradle

Paweł Radecki 0 Jan 10, 2022