{"id":16606650,"url":"https://github.com/abdularis/track-my-location","last_synced_at":"2025-03-16T21:30:55.079Z","repository":{"id":111778192,"uuid":"124996432","full_name":"abdularis/Track-My-Location","owner":"abdularis","description":"Android real-time location tracker app (learn using Firebase :fire:, Google Maps \u0026 Location Api) :globe_with_meridians:","archived":false,"fork":false,"pushed_at":"2018-03-25T08:14:47.000Z","size":1840,"stargazers_count":183,"open_issues_count":6,"forks_count":96,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-02-27T14:31:18.692Z","etag":null,"topics":["android","google-maps","google-play-services","location-tracker","mvvm-architecture"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdularis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-13T05:19:54.000Z","updated_at":"2025-02-02T09:01:03.000Z","dependencies_parsed_at":"2023-10-20T16:15:05.893Z","dependency_job_id":null,"html_url":"https://github.com/abdularis/Track-My-Location","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FTrack-My-Location","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FTrack-My-Location/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FTrack-My-Location/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdularis%2FTrack-My-Location/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdularis","download_url":"https://codeload.github.com/abdularis/Track-My-Location/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830939,"owners_count":20354853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","google-maps","google-play-services","location-tracker","mvvm-architecture"],"created_at":"2024-10-12T01:09:31.283Z","updated_at":"2025-03-16T21:30:54.310Z","avatar_url":"https://github.com/abdularis.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Track My Location\nThis is a simple android app where you can brodcast your location and everyone who has your dynamically generated unique key can track you in near real-time.\n\nI created this project just for learning puposes particularly about firebase (firestore db), google maps api and google location api.\n\n- [Backend (Firebase Cloud Functions)](https://github.com/abdularis/Track-My-Location_Cloud-Functions)\n\n***\n### Screenshots\n![](images/screenshots.jpg)\n\n\n***\n### References\n- [Set Up Google Play Services](https://developers.google.com/android/guides/setup)\n- [Getting Started - Google Maps](https://developers.google.com/maps/documentation/android-api/start)\n- [Get API Key](https://developers.google.com/maps/documentation/android-api/signup)\n- [Add Marker in Maps](https://developers.google.com/maps/documentation/android-api/map-with-marker)\n- Firebase Documentation (Guides) ([Link](https://firebase.google.com/docs/guides/))\n- [Get Started with Firebase Firestore](https://firebase.google.com/docs/firestore/quickstart)\n- [Firestore Data Model](https://firebase.google.com/docs/firestore/data-model)\n- [Firestore - Get Data](https://firebase.google.com/docs/firestore/query-data/get-data)\n- [Firestore - Structure Data](https://firebase.google.com/docs/firestore/manage-data/structure-data)\n\n***\n### How it works?\n![](images/hiw.png)\n\n- The first device get continous location update from gps, network etc. then\n- Write and update the location data to a specific firebase firestore document\n- Last, the second device read that firebase firestore document and show the marker in that location\n\n\n***\n### Hot to integrate Google Maps \u0026 Location API\nTo use google maps in an android app you can use `SupportMapFragment` or `MapView`\n\n- Using google maps fragment (inside a layout or as a root tag)\n \n```xml\n\u003cfragment\n\tandroid:id=\"@+id/map\"\n\tandroid:name=\"com.google.android.gms.maps.SupportMapFragment\"\n\tandroid:layout_width=\"match_parent\"\n\tandroid:layout_height=\"match_parent\"/\u003e\n```\n\n- Then you have to add permissions and google maps api key in the *AndroidManifest.xml* file\n\n![](images/as_1.png)\n\u003e Add permisions for coase and fine location also add meta-data tag for API key\n\n***\n### Integrate Google Play Services for Firebase into android project\n- Add this gradle plugin `'com.google.gms:google-services:3.1.1'` into dependencies block of the top-level gradle build file\n\n![](images/gr_1.png)\n\n- Apply the google play services plugin in the app level gradle build file (app project)\n\n![](images/gr_2.png)\n\n- Then you can add google play services library for maps, location, places etc. (firebase needs google play services to operate)\n\n![](images/gr_3.png)\n\n- You need to download and add `google-services.json` file to your `project_name/app/` directory from firebase console when you add an android app to your firebase project\n- Here are the complete figure\n\n![](images/fb_4.png)\n\n![](images/fb_1.png)\n\n\u003e enter the app package name \u0026 SHA-1 key (optional for firebase auth)\n\n\n![](images/fb_2.png)\n\n![](images/fb_3.png)\n\n\n***\n### Getting API Key for Google Maps \u0026 Location\n- Go to the google cloud console page and click credentials submenu (or [Get API Key](https://developers.google.com/maps/documentation/android-api/signup) )\n\n![](images/ga_1.png)\n\n- Then create a new credential\n\n\n![](images/ga_2.png)\n\n\n- New API key has been created, you can copy the key and paste in the manifest file. To restrict access of the key click the restrict button\n\n![](images/ga_3.png)\n\n\n- You can restrict api key usage by selecting the platform or IP address by which the api call would be requested (Application restrictions)\n\n![](images/ga_4.png)\n\n1. Select one of the application restrictions (in this case Android)\n2. Insert your android app package name\n3. Insert SHA-1 fingerprint of your app\n4. Click Save button\n\n___\n\u003e - To get SHA-1 key you can use your android studo by opening your particular project -\u003e select signingReport gradle task -\u003e copy \u0026 paste the SHA-1 key into the android app restriction form\n\n![](images/as_2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdularis%2Ftrack-my-location","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdularis%2Ftrack-my-location","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdularis%2Ftrack-my-location/lists"}