AnitraTask is an Android application that integrates Google Maps to provide location-based functionality. Users can view their current location, place markers on the map, and see the latitude and longitude of the points they mark. A clear button allows users to remove all markers from the map.
- Current Location Display: The app displays the user's current location on the map.
- Marker Placement: Users can place markers on the map by long-pressing any location.
- Location Coordinates Display: The latitude and longitude of the marked location will be displayed on the screen.
- Clear Markers: A button to clear all markers except the current location marker.
- Clone the repository:
git clone https://github.com/Satyam12singh/Anitra_task.git
- Open the project in Android Studio.
- Build the project and run it on an Android device or emulator.
-
Main Activity:
- The app starts with the
MainActivity
. - Click the "Map" button to navigate to the
MapsActivity
.
- The app starts with the
-
Maps Activity:
- The map is displayed with the user's current location.
- Long-press on any location on the map to place a marker.
- The latitude and longitude of the marker will be displayed on the screen.
- Click the "Clear Locations" button to remove all markers.
The app requires the following permissions:
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
Ensure to grant these permissions when prompted.
- MainActivity.kt: Contains the main screen with a button to navigate to the map. (View Code)
- MapsActivity.kt: Handles the map display, marker placement, and location updates. (View Code)
- ActivityMainBinding.kt: Used for view binding in the Main Activity.
- ActivityMainBinding.kt: Used for view binding in the Main Activity.
- ActivityMapsBinding.kt: Used for view binding in the Maps Activity.
This project is licensed under the MIT License - see the LICENSE file for details.