MyTaxi - App consuming myTaxi api to show taxi vehicles or otherwise on a map

Related tags

Testing MyTaxi
Overview

MyTaxi App

App consuming myTaxi api to show taxi vehicles list on google maps. The list should show all the vehicle data in the bounds of Hamburg (53.694865, 9.757589 & 53.394655, 10.099891).

Endpont to get the vehicles: https://fake-poi-api.mytaxi.com/?p1Lat={Latitude1}&p1Lon={Longitude1}&p2Lat={Latitude2}&p2Lon={Longitude2}

in this case, https://fake-poi-api.mytaxi.com/?p1Lat=53.694865&p1Lon=9.757589&p2Lat=53.394655&p2Lon=10.099891

Example response:

"poiList": [
        {
            "id": 802714,
            "coordinate": {
                "latitude": 53.66960373842644,
                "longitude": 9.770707237261918
            },
            "fleetType": "POOLING",
            "heading": 74.56956474495095
        },
        {
            "id": 219149,
            "coordinate": {
                "latitude": 53.39808833026627,
                "longitude": 9.800280946838797
            },
            "fleetType": "POOLING",
            "heading": 65.00681325645445
        },

It's a pretty simple app

Launch app -> view a list of all vehicles( horizontal orientation) -> click view all to see all markers of the vehiclles available -> click a single item to isolate the selected vehicle on the map and zoom to its location -> click map to display the steet name.

Screenshots and recordings

sr.mp4

A few gists that I would like to single out in this project;

- To zoom map to given bounds

val builder = LatLngBounds.Builder()
        val locBounds = LatLngBounds(LatLng(53.394655, 10.09989), LatLng(53.694865, 9.75758))
        builder.include(locBounds.southwest)
        builder.include(locBounds.northeast)
        googleMap.animateCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 100))

- Show markers of all vehicles on the map

I saved the list of vehicles in case I would need it in another fragment which I didn't so ;-| In the viewmodel,

val vehicles = MutableLiveData<List<Poi>>()

   fun setVehicles(poi: List<Poi>){
       vehicles.value = poi
   }

- Retrieve the list, I used forEach in place of for loop make the code more concise and add markers at the given locations

 mainViewModel.vehicles.observe(viewLifecycleOwner, {
            val data = it
            Log.d("TAG", "startMapNewList:$data ")
            data.forEach { poi ->
                val latitude = poi.coordinate.latitude
                val longitude = poi.coordinate.longitude
                val location = LatLng(latitude, longitude)
                Log.d("TAG", "Location: $location")
                listLocation.add(location)
            }
            Log.d("TAG", "LocationArray:$listLocation ")
            listLocation.forEach { place ->
               locationMarker = googleMap.addMarker(
                    MarkerOptions()
                        .position(place)
                        .icon(BitmapDescriptorFactory.fromBitmap(getCarBitmap(requireContext())))
                )!!
                allMarkers.add(locationMarker)

            }

        })
You might also like...
This is a repo for implementing Map pan or drag (up, down, right ,left) to load more places on the Google Map for Android

Challenge Display restaurants around the user’s current location on a map ○ Use the FourSquare Search API to query for restaurants: https://developer.

Map-vs-list-comparator - The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list.

Map vs List Comparator The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list. To

Android Taxi-App
Android Taxi-App

TODO Improvement UI design Implement night theme Used libraries AndroidX Kotlin - Language Kotlin Serialization - Json serializ

A collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android.

requireKTX requireKTX is a collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android, using the sam

A collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android.

requireKTX is a collection of small utility functions to make it easier to deal with some otherwise nullable APIs on Android, using the same idea as requireContext, requireArguments, and other similar Android SDK methods.

Taxi - an example of how to create an introductory screen using Jetpack Compose
Taxi - an example of how to create an introductory screen using Jetpack Compose

Taxi - an example of how to create an introductory screen using Jetpack Compose

UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map
UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map

UserLoc This uses a API call using Retrofit to obtain list of users details and

Lynx is an Android library created to show a custom view with all the information Android logcat is printing, different traces of different levels will be rendererd to show from log messages to your application exceptions. You can filter this traces, share your logcat to other apps, configure the max number of traces to show or the sampling rate used by the library.
My Maps displays a list of maps, each of which show user-defined markers with a title, description, and location. The user can also create a new map. The user can save maps and load them in from previous usages of the app.

My Maps Bryant Jimenez My Maps displays a list of maps, each of which show user-defined markers with a title, description, and location. The user can

An Android app built with Kotlin, consuming StarWars API to display characters of the popular StarWars Movie. It is built with the MVVM pattern and the latest Jetpack components.
An Android app built with Kotlin, consuming StarWars API to display characters of the popular StarWars Movie. It is built with the MVVM pattern and the latest Jetpack components.

StarWars An Android app built with Kotlin, consuming StarWars API to display characters of the popular StarWars Movie. It is built with the MVVM patte

An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern
An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern

Images An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern as well as Architecture Components. Min Api

An android app consuming movies api build with Jetpack Compose
An android app consuming movies api build with Jetpack Compose

Movies App An Android app consuming MovieDb API to display list of movies, built with Compose, MVVM pattern as well as Architecture Components. Min Ap

A fake shopping app built using the MVVM archirecture consuming FAKE STORE API
A fake shopping app built using the MVVM archirecture consuming FAKE STORE API

FakeStore A fake shopping app built using the MVVM archirecture consuming FAKE STORE API N/B This API does not provide an endpoint for registering use

Consuming Kanye West quotes REST API (Kanye as a Service)
Consuming Kanye West quotes REST API (Kanye as a Service)

Kanye Quotes A free REST API for random Kanye West quotes (Kanye as a Service) API

Display's information about SpaceX crew members and ships by consuming a rest api and storing the data to display when the user is offline.

Space-X App Display's information about SpaceX crew members(look for ‘Crew’ section in rest api docs) and ships (look for ‘Ships’ section in rest api

RickAndMortyApp - Application developed consuming a rick and morty API
RickAndMortyApp - Application developed consuming a rick and morty API

Rick and Morty App (Android App) Project description (First version) Application

CoinConverterApp - Application developed consuming HG FINANCE API, with MVVM
CoinConverterApp - Application developed consuming HG FINANCE API, with MVVM

CoinConverter (Android App) 💸 Project description (First version) Application c

An Android application consuming the GitHub API to search for users on Github, display their followers, following and repositories. The project is built with Compose, MVVM pattern as well as other architectural components and libraries.
MapSample - Just Sample App using Naver Map API

Sample Project: NaverMap 맛보기 Gradle Dependency // App 단위 Gradle dependencyResolu

Owner
Kakashi
Android Developer🚀 Technical Writer. Forever learning.
Kakashi
YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API.

YASNAC YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API. YASNAC is written w

Rikka 361 Dec 31, 2022
This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5

Kotlin-RestAssured Test Automation This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5 Introduction All the Test Cases kept

Dilshan Fernando 0 Dec 9, 2021
FinnAds - A sample project to fetch advertisements from a mock api

FinnAds ?? FinnAds is a sample project to fetch advertisements from a mock api.

Fatih Giriş 2 Jan 27, 2022
Simple, lightweight, modular components to help conjure your app architecture

Magic Simple, lightweight, modular components and utilities to help conjure your app architecture. Built with Kotlin coroutines to provide flexible as

TeraThought 0 Jan 9, 2022
Lbc-test-app - Test Android Senior Leboncoin

Test Android Senior Leboncoin ?? Mathieu EDET Overview Min API version : 24 This

null 0 Feb 7, 2022
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

Gökhan YILMAZ 4 Aug 2, 2022
Tree View; Mind map; Think map; tree map

A custom tree view for Android, designed for easy drawing some tree nodes (e.g. thind mind and tree nodes). Includes smoothly zoom, move, limit and center fix animation support, and allows easy extension so you can add your own child node's customs view and touch event detection.

怪兽N 304 Jan 3, 2023
Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

Ride-Sharing Uber Lyft Android App - Learn to build a ride-sharing Android Taxi Clone App like Uber, Lyft - Open-Source Project By MindOrks

MindOrks 1.2k Dec 29, 2022
A view abstraction to provide a map user interface with various underlying map providers

AirMapView AirMapView is a view abstraction that enables interactive maps for devices with and without Google Play Services. It is built to support mu

Airbnb 1.8k Dec 4, 2022