0% found this document useful (0 votes)
112 views14 pages

Mad Final Project

The document describes integrating Google Maps into a mobile application. It includes code snippets for the XML layout file and Java activity class to display a map fragment and add buttons to toggle between map types like satellite, terrain and hybrid views. The activity gets the user's location on map load and centers the camera on this position.
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)
112 views14 pages

Mad Final Project

The document describes integrating Google Maps into a mobile application. It includes code snippets for the XML layout file and Java activity class to display a map fragment and add buttons to toggle between map types like satellite, terrain and hybrid views. The activity gets the user's location on map load and centers the camera on this position.
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
You are on page 1/ 14

GOVERNMENT POLYTECHNIC AMBAD

DEPARTMENT OF INFORMATION TECHNOLOGY


MOBILE APPLICATION DEVELOPMENT (22617)

A MICRO-PROJECT REPORT ON

“GOOGLE MAP INTEGRATION”

FOR THE AWARD OF

DIPLOMA IN INFORMATION TECHNOLOGY

(Computer Engineering – CO6I )


2023-24
UNDER THE GUIDANCE OF
Mr. P.T.Zhunjare

Roll no. Name Signature

325 Pawar Yogesh Sanjay


329 Rathod Sachin Dnyaneshwar
332 Satpute Amarnath Purushottam
CERTIFICATE

GOVERNMENT POLYTECHNIC AMBAD


DEPARTMENT OF COMPUTER ENGINEERING
MOBILE APPLICATION DEVELOPMENT (22617)

This is to certify that the Micro-project entitled “GOOGLE MAP INTEGRATION” being submitted
herewith for the award of DIPLOMA IN ENGINEERING & TECHNOLOGY in Computer Engineering
Of Maharashtra State Board & Technical Education (MSBTE) is the result of Microproject work
completed under my supervision and guidance by Mr.P.T.Zhunjare

Place : Ambad

Date :

Mr..P.T.Zhunjare Mr.B.S.Pawar Dr. A.M. Agarkar

Micro-project Guide H.O.D Principal


DECLARATION

We, the undersigned, hereby declare that the project entitled “GOOGLE MAP INTEGRATION”
is written and submitted by us to Government Polytechnic Ambad during Year 2023-24, Sixth
Semester for partial fulfillment of the ‘Micro Project’ requirement of ‘Mobile Application
Develoapment ’ subject under Maharashtra State Board of Technical Education, Mumbai
curriculum, under the guidance of Mr.P.T.Zhunjare

Roll no. Name Signature

325 Pawar Yogesh Sanjay


329 Rathod Sachin Dnyaneshwar
332 Satpute Amarnath Purushottam
ACKNOWLEDGEMENT

We have great pleasure to express my immense gratitude towards a dynamic person


and my project guide Mr.P.T.Zhunjare Department of Computer Engineering Government
Polytechnic, Ambad for giving me an opportunity to work on an interesting topic over one
semester. The work presented here could not have been accomplished without his most
competent and inspiring guidance, incessant encouragement, constructive criticism and
constant motivation during all phases of our group Micro-project work. I am greatly indebted
to him.
We have very much thankful to Mr.B.S.Pawar, head of Computer Engineering, all
HODs of various departments and Prof. Dr A.M. Agarkar, Principal, Government
Polytechnic, Ambad, for his encouragement and providing me a motivating environment and
project facilities in the Institute to carry out experiments and complete this Micro-project
work.
We would like to extend our thanks to all our professors, staff members and all our
friends who extended their co-operation to complete the project.
We have indeed indebted to my parents and other family members for their immense
help at all levels with moral, social & financial support, care and support throughout my
studies without which my work would not have seen light of the day.
With warm regards,

Yours Sincerely,

Place: Ambad 1.Pawar Yogesh Sanjay


2.Rathod Sachin Dnyaneshwar
3.Satpute Amarnath Purushottam
Date:
Introduction:

Google Maps integration:


"Google Maps integration offers developers a powerful tool to enhance the
functionality of their applications with location-based services. By integrating
Google Maps, developers can provide users with interactive maps, real-time
navigation, and geospatial data visualization. This integration opens up a world of
possibilities, from displaying nearby points of interest to tracking user locations in
real-time.
With Google Maps API, developers can customize map styles, add markers and
overlays, and implement features such as street view and satellite imagery. Whether
it's creating custom maps for delivery tracking apps or integrating location-based
recommendations into social networking platforms, Google Maps integration
empowers developers to create rich and engaging user experiences.
Moreover, Google Maps provides access to a wealth of geolocation data, including
traffic information, transit routes, and business listings. Developers can leverage
this data to provide users with valuable insights and personalized recommendations
based on their location. From finding the nearest restaurant to plotting the most
efficient route, Google Maps integration adds a layer of convenience and
functionality to mobile and web applications alike.
In addition, Google Maps integration is seamless and well-documented, with
comprehensive documentation and resources available to assist developers at every
step of the integration process. With easy-to-use APIs and SDKs, developers can
quickly incorporate Google Maps into their applications and unlock its full
potential.
Overall, Google Maps integration is a game-changer for developers looking to add
location-aware features to their applications. With its robust features, rich data sets,
and ease of integration, Google Maps opens up endless possibilities for creating
innovative and immersive user experiences."
Files in this Activity

activity_my_location.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MyLocationActivity" >
<fragment android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true">
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_my_location_normal"
android:text="Normal"
android:textSize="12sp"
android:textColor="@color/white"
android:textStyle="bold"
android:backgroundTint="@color/skyblue"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_my_location_satellite"
android:text="Satellite" android:textStyle="bold"
android:textSize="12sp"
android:textColor="@color/white"
android:backgroundTint="@color/skyblue"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_my_location_terrain"
android:text="Terrain" android:textSize="12sp"
android:textColor="@color/white"
android:textStyle="bold"
android:backgroundTint="@color/skyblue"/>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn_my_location_hybride"
android:text="Hybride"
android:textSize="12sp"
android:textColor="@color/white"
android:textStyle="bold"
android:backgroundTint="@color/skyblue"/>
</LinearLayout>
</RelativeLayout>

MyLocationActivity.java

package com.example.apk;
import androidx.fragment.app.FragmentActivity;
import android.graphics.Color; import
android.os.Bundle; import android.view.View;
import android.widget.Button;
import com.google.android.gms.maps.CameraUpdateFactory; import
com.google.android.gms.maps.GoogleMap; import
com.google.android.gms.maps.OnMapReadyCallback; import
com.google.android.gms.maps.SupportMapFragment; import
com.google.android.gms.maps.model.CircleOptions; import
com.google.android.gms.maps.model.LatLng; import
com.google.android.gms.maps.model.MarkerOptions; import
com.example.apk.databinding.ActivityMyLocationBinding; import
com.google.android.gms.maps.model.PolygonOptions; import
com.google.android.gms.maps.model.PolylineOptions; public class
MyLocationActivity extends FragmentActivity implements
OnMapReadyCallback { private GoogleMap mMap;
private ActivityMyLocationBinding binding;
Button btn_satellite,btn_terrine,btn_hybride,btn_normal;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMyLocationBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); btn_satellite =
findViewById(R.id.btn_my_location_satellite); btn_terrine =
findViewById(R.id.btn_my_location_terrain); btn_hybride =
findViewById(R.id.btn_my_location_hybride); btn_normal =
findViewById(R.id.btn_my_location_normal); // Obtain the
SupportMapFragment and get notified when the map is ready to be
used.
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager() .findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}

/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used. * This is
where we can add markers or lines, add listeners or move the camera.
In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be
prompted to install
* it inside the SupportMapFragment. This method will only be triggered
once the user has
* installed Google Play services and returned to the app. */
*
@Override
public void onMapReady(GoogleMap googleMap) { mMap
= googleMap;
// Add a marker in Sydney and move the camera LatLng
mylocation = new LatLng(19.868721, 76.004675);
mMap.addMarker(new MarkerOptions().position(mylocation).title("Marker
in Pirkalyan"));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mylocation, 16),
5000, null);
mMap.addCircle(new CircleOptions()
.center(mylocation)
.radius(100)
.strokeColor(getColor(R.color.red))
.fillColor(Color.parseColor("#972B4283"))
);
btn_satellite.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
}
});
btn_terrine.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
}
});
btn_hybride.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
}
});
btn_normal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
});
LatLng gpambad = new LatLng(19.617648, 75.780000);
mMap.addMarker(new MarkerOptions().position(gpambad).title("Marker on
Government Polytechnic ,Ambad")); mMap.addPolyline(new
PolylineOptions()
.add(mylocation,gpambad)
.width(10)
.color(getColor(R.color.red))
.geodesic(true));
}
}

AndroidMinifest.xml

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


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<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/Theme.Apk"
tools:targetApi="31">
<activity
android:name=".SplashLocationActivity" android:exported="false"
android:theme="@style/Noactionbar"/>
<!--
TODO: Before you run your application, you need a Google Maps API
key.
To get one, follow the directions here:
https://developers.google.com/maps/documentation/androidsdk/get-api-key
Once you have your API key (it starts with "AIza"), define a new property
in your
project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace
the
"YOUR_API_KEY" string in this file with "${MAPS_API_KEY}".
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCY-BdAJNuEOFHfdkpwNdJtx5mEeP0VxrM" />
<activity
android:name=".MyLocationActivity"
android:exported="false"
android:label="@string/title_activity_my_location" />
<activity
android:name=".AboutUsActivity" android:exported="false"
/>
<activity
android:name=".ContactUsActivity" android:exported="false"
/>
<activity android:name=".SettingActivity"
android:exported="false" />
<activity
android:name=".MyProfileActivity" android:exported="false"
/>
<activity
android:name=".HomeActivity" android:exported="false"
/>
<activity
android:name=".RegistrationActivity" android:exported="true"
android:theme="@style/Noactionbar" />
<activity
android:name=".LoginActivity" android:exported="true"
/>
<activity android:name=".SplashActivity"
android:exported="true"
android:theme="@style/Noactionbar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Outputs:
References:

https://www.android.com/intl/en_in/
https://www.google.com/android/find https://twitter.com/Android
https://www.youtube.com/channel/UC9M7-jzdU8CVrQo1JwmIdWA

Conclusion:

In conclusion, Google Maps integration offers developers a powerful tool to


enhance their applications with location-based services. By leveraging Google
Maps API, developers can provide users with interactive maps, real-time
navigation, and geospatial data visualization. This integration opens up a wide
range of possibilities for creating engaging user experiences, from displaying
nearby points of interest to providing personalized recommendations based on
user location.

You might also like