Skip to content

Selvipr/SpeedTrackerPro

Repository files navigation

Android Speed Tracker with Google Maps

A simple Android application to track your current speed using GPS and visualize your location on a Google Map in real-time.

Features

  • 🚀 Real-time speed display (in MPH or KPH - configurable).
  • 📍 Google Map showing your current location as you move.
  • 📏 Distance tracking for the current trip.
  • ⏱️ Option to start and stop tracking sessions.
  • 📊 Displays maximum and average speed for the current trip.
  • 🔋 Efficient GPS usage (within Android best practices).
  • ✅ Runtime permissions handling for location access.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Android Studio installed.
  • Android SDK (Target SDK and Compile SDK versions specified in app/build.gradle).
  • An Android device or emulator.
  • A Google Cloud Platform account to obtain a Google Maps API key.

Setup

  1. Clone the repository:

    git clone https://github.com/Selvipr/SpeedTrackerPro.git
    cd SpeedTrackerPro
  2. Open in Android Studio:

    • Open Android Studio.
    • Select "Open an existing Android Studio project".
    • Navigate to the cloned directory and open it.
  3. Obtain Google Maps API Key:

    • Go to the Google Cloud Platform Console (https://console.cloud.google.com/).
    • Create a new project (or select an existing one).
    • Navigate to "APIs & Services" > "Library".
    • Search for and enable the "Maps SDK for Android".
    • Go to "APIs & Services" > "Credentials".
    • Click "Create Credentials" and select "API Key".
    • IMPORTANT: Restrict your API key to the "Maps SDK for Android" and add package name and SHA-1 signing certificate fingerprint restrictions for your app to prevent unauthorized usage. See Google's documentation for details.
    • Copy your API key.
  4. Add API Key to Project:

    • Best Practice (Secure): Create a local.properties file in the root directory of your project (if it doesn't exist). Add it to your .gitignore file. Add your API key like this:
      MAPS_API_KEY=YOUR_API_KEY_HERE
      Then, in your AndroidManifest.xml file (usually app/src/main/AndroidManifest.xml), reference it:
      <meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="${MAPS_API_KEY}" />
      You'll need to ensure your app/build.gradle file reads this property. (This step can vary based on implementation, but referencing from local.properties is recommended for security).
    • Alternative (Less Secure): Directly paste the key into your AndroidManifest.xml (replace "YOUR_API_KEY"):
      <meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="YOUR_API_KEY" />
      Warning: Avoid committing API keys directly into files tracked by Git. Use local.properties and .gitignore.
  5. Sync Project: After adding the API key, sync your project with Gradle files (File -> Sync Project with Gradle Files).

How to Run

  1. Connect your Android device or start an emulator.
  2. Ensure GPS/Location services are enabled on the device/emulator.
  3. In Android Studio, click the green 'Run' button (usually a triangle icon).
  4. Select your connected device or running emulator when prompted.
  5. The app should build and install on your device/emulator.

Project Structure

. ├── app/ │ ├── src/ │ │ ├── main/ │ │ │ ├── java/ (Your Kotlin/Java source code) │ │ │ ├── res/ (Layouts, drawables, values, etc.) │ │ │ └── AndroidManifest.xml │ ├── build.gradle (App module build file) ├── gradle/ ├── build.gradle (Project level build file) ├── settings.gradle ├── local.properties (Should be in .gitignore) └── .gitignore

(Adjust this structure tree if your project layout is significantly different)

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes and commit them (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Create a new Pull Request on GitHub.

Please ensure your code adheres to the project's coding style and includes appropriate tests if applicable.

License

This project is licensed under the MIT License - see the LICENSE file for details. (Make sure you have a LICENSE file in your repository)

Author


About

This is A speed tracking Application for Android with Google map integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages