TrackMyBusWAW is an Android application designed to provide real-time tracking of buses and trams in Warsaw. The app uses the Google Maps API and integrates with the Warsaw Public Transport API to display the current locations of vehicles, helping users plan their journeys more efficiently.
- Real-Time Bus/Tram Tracking: View live locations of buses and trams on an interactive map.
- Line Filtering: Select a specific bus or tram line to filter displayed vehicles.
- Location Awareness: Automatically zooms into your current location.
- Dynamic Map Updates: Map refreshes based on zoom level and visible bounds.
- Customizable Markers: Displays buses and trams with custom markers, including line numbers.
- Android Development:
- Minimum SDK: 26
- Target SDK: 31
- APIs:
- Google Maps API
- Warsaw Public Transport API
- Libraries:
- Retrofit (API communication)
- Gson (JSON parsing)
- Robolectric (Unit testing)
- Mockito (Mocking dependencies)
- Development Tools:
- Android Studio
- Java 8
- Android Studio (latest version recommended)
- Google Maps API Key
- Internet connection
- Clone the repository:
git clone https://github.com/your-username/TrackMyBusWAW.git
- Open the project in Android Studio.
- Replace the placeholder in AndroidManifest.xml with your own Google Maps API key:
<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_GOOGLE_MAPS_API_KEY" />
- Build and run the project on an emulator or physical device.
- Open the app to view the interactive map.
- Use the current location button to center the map on your location.
- Tap the menu button to filter vehicles by specific lines.
- Select “SHOW ALL BUSES” to reset the filter and view all vehicles.
- Zoom in/out to adjust the visible range of vehicles on the map.
MainActivity: Core logic for map interaction and API integration.
BusLinesAdapter: Manages the list of bus lines in the RecyclerView.
Bus: Represents a single bus or tram with details like location and line.
ApiResponse: Represents the response structure of the Warsaw API.
WarsawApiService: Interface for communicating with the Warsaw Public Transport API.
The application includes unit tests for key components:
MainActivityTest:
Tests for sorting, filtering, and formatting logic.
WarsawApiServiceTest:
Verifies API calls and interactions using mocked dependencies.
ApiResponseTest:
Tests data handling and response structure.
To run tests:
./gradlew test
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name - Commit your changes:
git commit -m "Add your message" - Push to your branch:
git push origin feature-name - Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy using TrackMyBusWAW! 😊