0% found this document useful (0 votes)
12 views3 pages

Geo Coding App

The document contains code for an Android application that integrates Google Maps functionality. It includes an XML layout for the map fragment, a Java activity that initializes the map and retrieves location data using Geocoder, and an AndroidManifest.xml file that declares necessary permissions and application metadata. The app allows users to view a specific location on the map with zoom controls and location markers.

Uploaded by

rupeshpawar214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Geo Coding App

The document contains code for an Android application that integrates Google Maps functionality. It includes an XML layout for the map fragment, a Java activity that initializes the map and retrieves location data using Geocoder, and an AndroidManifest.xml file that declares necessary permissions and application metadata. The app allows users to view a specific location on the map with zoom controls and location markers.

Uploaded by

rupeshpawar214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

**activity_maps.

xml

<?xml version="1.0" encoding="utf-8"?>


<fragment xmlns:android="[Link]
xmlns:map="[Link]
xmlns:tools="[Link]
android:id="@+id/map"
android:name="[Link]"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />

**[Link]

package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link];

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {

private GoogleMap mMap;


private ActivityMapsBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
binding = [Link](getLayoutInflater());
setContentView([Link]());
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById([Link]);
[Link](this);
}
@SuppressLint("MissingPermission")
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
[Link](true);
Geocoder oGC=new Geocoder(this);
LatLng latLng=null;
try {
List<Address> list= [Link]("Pandharpur,Maharashtra,India",1);
Address oAdr=[Link](0);
Log.d("LATIDUDE_VALUE",""+[Link]());
Log.d("LOGITUDE_VALUE",""+[Link]());
latLng=new LatLng([Link](),[Link]());
[Link](new MarkerOptions().position(latLng).title([Link]()));
[Link]([Link](latLng));
} catch (IOException e) {
throw new RuntimeException(e);
}
[Link]().setZoomControlsEnabled(true);
[Link]().setZoomGesturesEnabled(true);
[Link]().setCompassEnabled(true);
[Link]().setScrollGesturesEnabled(true);
}
}

**[Link]

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="[Link]
xmlns:tools="[Link]
<uses-permission android:name="[Link].ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="[Link]"/>
<uses-permission android:name="[Link].ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]"
tools:targetApi="31">
<meta-data
android:name="[Link].API_KEY"
android:value="AIzaSyB3ToCWeB51xXTS93R-3GkE6t3DL7FdfhU"/>

<activity
android:name=".MapsActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />

<category android:name="[Link]" />


</intent-filter>
</activity>
</application>

</manifest>
**Output

You might also like