0% found this document useful (0 votes)
61 views22 pages

Mad Microproject Ready

Uploaded by

bhatiom507
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)
61 views22 pages

Mad Microproject Ready

Uploaded by

bhatiom507
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/ 22

JSPM BHIVRABAI SAWANT POLYTECHNIC,

Wagholi

Academic year 2023-2024


MICROPROJECT ON

Android application for Map

Title of microproject: Develop android application for map

Submitted by:

Roll no. Student Name Sign of Student

34 Mayur Kamble

Signature of guide Signature of HOD

Miss. Swati Wale mam


Bhivarabai Sawant Polytechnic Wagholi, PuneANEEXURE II

Evaluation Sheet for the Micro Project

Academic Year: 2023-24 Name of the Faculty: Miss Swati Wale mam

Course: Mobile application devlopment Course code: 22617 Semester: VI

Title of the project: Develop android application for Map..

COs addressed by Micro Project:

A: ……………………………………………………………………………………………………………

B:……………………………………………………………………………………………………….……

C:…………………………………………………………………………………………………………….

D:…………………………………………………………………………………………………………….

Major learning outcomes achieved by students by doing the project

(a) Practical outcome:………………………………………………………………………………

(b) Unit outcomes in Cognitive domain:………………………………………………………………

(c) Outcomes in Affective domain:…………………………………………………………………

Comments/suggestions about team work /leadership/inter-personal communication (if any)

…………………………………………………………………………………………………………………………………..

Roll no. Student Name Marks out off 6 for Marks out off 4 for Total out
performance in group performance in off 10
activity oral/presentation
34 Mayur Kamble

(Name and Signature of Faculty)


INDEX

Sr.no Tittle
1 Abstract
2 Introduction
3 Code Implementation
4 Applications
5 Advantages

6 Disadvantages
7 Conclusion
8 Refferences
Abstract

The mobility of mobile devices has made it possible to develop and use maps and map
based applications for navigation purposes. Since most mobile map applications nowadays
are developed for motor vehicles, there is a demand for portable pedestrian navigation
applications. In this thesis the Android mobile map application with standard navigation
tools for pedestrian navigation was developed, as a platform for facilitating the Lund
Challenge location based demonstrator of the HaptiMap project. The aim of the
demonstrator is to make the sights of Lund city more accessible. The mobile phone
application is being designed as a touristic, historical location based game which will also
assist tourists to navigate themselves in the city. To enable exploration of historical and
current sites of Lund the demonstrator should contain basic components of exploring and
way finding. Prior to the development the OpenStreetMap (OSM) road network data and
Swedish National Road Database (NVDB) were introduced. The main advantage of using
the OSM data over the NVDB dataset is the completeness of the OSM data in terms of
pedestrian paths. The datasets were imported to PostgreSQL spatially extended PostGIS
database, where different routing algorithms provided by pgRouting were used for routing
calculations. As the Lund Challenge demonstrator is intended not only for general users but
also for visually impaired users, the problem of user navigation in the parks and open areas
were also discussed and the feasibility study was performed. The limitation of the developed
application was the problem of the user navigation in the parks and open areas. It is
therefore necessary to upgrade the road database with possible path in the open areas and
parks in order to implement this application.
INTRODUCTION

Maps and route services are vital for navigation. For instance, the personal and interactive
use of maps in mobile environment has several advantages. The mobility of mobile devices
makes it possible to use maps for navigational purposes. On the other hand in desktop
applications maps are used mainly for route planning. The rapid development of new
technologies enables high speed internet in mobile devices which further makes it possible to
use advanced online services for navigation. Most mobile map applications nowadays are
developed for cars; there is a lack of services for pedestrian and cycle navigation.

Prior to Android application development the study of two datasets used in the HaptiMap
project was performed. Additionally the OpenStreetMap (OSM) and Swedish National Road
Database (NVDB) road network data were imported to PostGIS database and the routing
calculation were performed using the pgRouting functionality.

OSM is an example of volunteered geographic information. It is an open source project that


allows adding, editing and retrieving geographic data. The Google Mobile Maps application
provides exploring tools for navigating in the city. Similar application is necessary to develop
based on OSM data. While in the contrast to Google Mobile Maps the OSM data and the
navigation tools based on it include pedestrian paths for routing that have the largest potential
demand. Furthermore, since the development of OSM data is an ongoing process and it is open
source project a lot more pedestrian paths data are expected that will assist better pedestrian
route finding.
IMPLEMENTATION OF MAP
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

<TextView

android:layout_marginTop="20dp"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Get Current Location and City Name"

android:textAlignment="center"

android:layout_centerHorizontal="true"

android:textSize="20sp" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/textView"

android:layout_centerInParent="true"

android:textSize="16sp"

android:textStyle="bold"/>

</RelativeLayout>

Java code:

package com.example.map;
import androidx.annotation.NonNull;

import androidx.appcompat.app.AppCompatActivity;

import androidx.core.app.ActivityCompat;

import androidx.core.content.ContextCompat;

import android.Manifest;

import android.content.Intent;

import android.content.pm.PackageManager;

import android.location.Geocoder;

import android.location.Location;

import android.os.Bundle;

import android.os.Handler;

import android.os.ResultReceiver;

import android.util.Log;

import android.widget.TextView;

import android.widget.Toast;

import com.google.android.gms.location.FusedLocationProviderClient;

import com.google.android.gms.location.LocationCallback;

import com.google.android.gms.location.LocationRequest;

import com.google.android.gms.location.LocationResult;

import com.google.android.gms.location.LocationServices;

public class MainActivity extends AppCompatActivity {

private FusedLocationProviderClient fusedLocationClient;

private static final int LOCATION_PERMISSION_REQUEST_CODE = 2;

private LocationAddressResultReceiver addressResultReceiver;

private TextView currentAddTv;

private Location currentLocation;


private LocationCallback locationCallback;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

addressResultReceiver = new LocationAddressResultReceiver(new Handler());

currentAddTv = findViewById(R.id.textView);

fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);

locationCallback = new LocationCallback() {

@Override

public void onLocationResult(LocationResult locationResult) {

currentLocation = locationResult.getLocations().get(0);

getAddress();

};

startLocationUpdates();

@SuppressWarnings("MissingPermission")

private void startLocationUpdates() {

if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) !=

PackageManager.PERMISSION_GRANTED) {

ActivityCompat.requestPermissions(this, new

String[]{Manifest.permission.ACCESS_FINE_LOCATION},

LOCATION_PERMISSION_REQUEST_CODE);

}
else {

LocationRequest locationRequest = new LocationRequest();

locationRequest.setInterval(2000);

locationRequest.setFastestInterval(1000);

locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null);

@SuppressWarnings("MissingPermission")

private void getAddress() {

if (!Geocoder.isPresent()) {

Toast.makeText(MainActivity.this, "Can't find current address, ",

Toast.LENGTH_SHORT).show();

return;

Intent intent = new Intent(this,GetAddressIntentService.class);

intent.putExtra("add_receiver", addressResultReceiver);

intent.putExtra("add_location", currentLocation);

startService(intent);

@Override

public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull

int[] grantResults) {

super.onRequestPermissionsResult(requestCode, permissions, grantResults);

if (requestCode == LOCATION_PERMISSION_REQUEST_CODE) {

if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {


startLocationUpdates();

} else {

Toast.makeText(this, "Location permission not granted, " + "restart the app if you want the feature",
Toast.LENGTH_SHORT).show();

private class LocationAddressResultReceiver extends ResultReceiver {

LocationAddressResultReceiver(Handler handler) {

super(handler);

@Override

protected void onReceiveResult(int resultCode, Bundle resultData) {

if (resultCode == 0) {

Log.d("Address", "Location null retrying");

getAddress();

if (resultCode == 1) {

Toast.makeText(MainActivity.this, "Address not found, ", Toast.LENGTH_SHORT).show();

String currentAdd = resultData.getString("address_result");

showResults(currentAdd);

private void showResults(String currentAdd) {

currentAddTv.setText(currentAdd);
}

@Override

protected void onResume() {

super.onResume();

startLocationUpdates();

@Override

protected void onPause() {

super.onPause();

fusedLocationClient.removeLocationUpdates(locationCallback);

package com.example.map;

import android.app.IntentService;

import android.content.Intent;

import android.location.Address;

import android.location.Geocoder;

import android.location.Location;

import android.os.Bundle;

import android.os.ResultReceiver;

import android.util.Log;

import java.util.List;

import java.util.Locale;

import java.util.Objects;

import androidx.annotation.Nullable;
GetAddressIntentService class:

//public class GetaddressIntentService {

public class GetAddressIntentService extends IntentService {

private static final String IDENTIFIER = "GetAddressIntentService";

private ResultReceiver addressResultReceiver;

public GetAddressIntentService() {

super(IDENTIFIER);

@Override

protected void onHandleIntent(@Nullable Intent intent) {

String msg;

addressResultReceiver = Objects.requireNonNull(intent).getParcelableExtra("add_receiver");

if (addressResultReceiver == null) {

Log.e("GetAddressIntentService", "No receiver, not processing the request further");

return;

Location location = intent.getParcelableExtra("add_location");

if (location == null) {

msg = "No location, can't go further without location";

sendResultsToReceiver(0, msg);

return;

Geocoder geocoder = new Geocoder(this, Locale.getDefault());

List<Address> addresses = null;

try {
addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);

catch (Exception ioException) {

Log.e("", "Error in getting address for the location");

if (addresses == null || addresses.size() == 0) {

msg = "No address found for the location";

sendResultsToReceiver(1, msg);

else {

Address address = addresses.get(0);

String addressDetails = address.getFeatureName() + " " + address.getThoroughfare() + " " + "Locality: " +
address.getLocality() + " " + "County: " + address.getSubAdminArea() + " " + "State: " + address.getAdminArea() + " " +
"Country: " + address.getCountryName() + " " + "Postal Code: " + address.getPostalCode() + " ";

sendResultsToReceiver(2, addressDetails);

private void sendResultsToReceiver(int resultCode, String message) {

Bundle bundle = new Bundle();

bundle.putString("address_result", message);

addressResultReceiver.send(resultCode, bundle);

gradle.build:

plugins {

id 'com.android.application'
}

android {

namespace 'com.example.map'

compileSdk 33

defaultConfig {

applicationId "com.example.map"

minSdk 24

targetSdk 33

versionCode 1

versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'

implementation 'com.google.android.material:material:1.5.0'

implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

testImplementation 'junit:junit:4.13.2'

androidTestImplementation 'androidx.test.ext:junit:1.1.5'

androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

implementation 'com.google.android.gms:play-services-location:17.0.0'

manifest file:

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

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

package="com.example.map">

<application

android:allowBackup="true"

android:icon="@mipmap/ic_launcher"

android:label="@string/app_name"

android:roundIcon="@mipmap/ic_launcher_round"

android:supportsRtl="true">

<activity

android:name=".MainActivity"

android:exported="true">
<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

<service android:name=".GetAddressIntentService"

tools:ignore="Instantiatable" />

</application>

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

</manifest>

OUTPUT:
Applications

1. Navigation and Directions:

 Provide turn-by-turn navigation for driving, walking, and cycling.

 Real-time traffic updates and alternative route suggestions.

 Estimated time of arrival (ETA) calculations.

2. Location-Based Services:

 Geotagging photos and posts.

 Locating nearby points of interest (POIs), such as restaurants, hotels, gas


stations, etc.

 Local business directories and reviews.

3. Emergency Services:

 Emergency response and disaster management.

 Locating the nearest hospitals, police stations, and fire departments.

4. Fitness and Health:

 GPS tracking for running, cycling, and other outdoor activities.

 Geofencing for tracking and notifying users about specific workout zones.

5. Tourism and Travel:

 Virtual tours and guides for tourist attractions.

 Offline maps for travelers without constant internet access.

 Public transportation information and routes.

6. Social Networking:

 Check-ins and location sharing with friends.

 Meeting up with friends based on real-time location updates.

 Geographically tagged posts and content sharing.


Advantages
Location-Based Services:

Personalization: Users can receive location-based recommendations and services


tailored to their preferences.

Efficient Search: Quickly find nearby points of interest, businesses, and services.

Emergency Services:

Quick Response: Emergency services can utilize accurate location data for faster
response times.

Critical Information: Locating nearby hospitals, police stations, and fire departments
during emergencies is crucial.

Fitness and Health:

Activity Tracking: Users can track outdoor activities, monitor routes, and analyze
performance.

Motivation: Integration with fitness apps provides motivation and goal tracking.

Tourism and Travel:

Exploration: Tourists can explore new places with virtual guides and discover local
attractions.

Offline Accessibility: Offline maps are useful for travelers without consistent internet
access.

Social Networking:

Social Interaction: Location sharing and check-ins enhance social interactions.

Event Coordination: Meeting friends based on real-time location updates becomes


easier.

Education:

Campus Navigation: Students and visitors can navigate campuses more efficiently.

Interactive Learning: Location-based educational games and activities can be


incorporated.
Disadvantages
1.Battery Drain:

 Map applications, especially those using GPS services, can be resource-


intensive and contribute to rapid battery consumption, leading to shorter
device battery life.

2. Data Usage:

 Real-time map updates and navigation can consume a significant amount of


data, which may be a concern for users with limited data plans or in areas
with poor network coverage.

3. Privacy Concerns:

 Continuous location tracking can raise privacy concerns, and users may be
hesitant to share their real-time location data due to potential misuse or
unauthorized access.

4. Dependency on Internet Connectivity:

 Many map features, such as real-time traffic updates and online search, rely
on an internet connection. In areas with poor connectivity, the effectiveness
of the map application may be compromised.

5. Accuracy Issues:

 While GPS technology is generally accurate, there can be instances of signal


interference, leading to inaccuracies in location tracking, especially in urban
areas with tall buildings or in remote regions.

6. Security Risks:

 Location-based services may pose security risks, such as location spoofing or


unauthorized access to user location data.
Conclusion

The purpose of this study was to understand the technology and structure of the Android OS and
application development process which was succeeded in some depth. The standard Android
SDK libraries provides the possibility to integrate the Google Maps in own application with
additional functionalities such as Point overlays while the OSM map integration is only possible
by using supplementary open source libraries such as the Nutiteq Maps Lib SDK for Android
which was used in this study. The Nutiteq API makes possible to integrate many map sources
such as: OSM, CloudMade, Navteq/MapTP, etc. (Nutiteq, 2011a). Despite the map integration
the Nutiteq library supports the offline maps, line and polygon overlays on top of the map, online
and offline KML overlays, route service, etc. Some of these functionalities are part of public
API, nevertheless to use the Nutiteq full library it is necessary to purchase a license. The
CloudMade TMS tiles of the OSM were used in MasterOSM application, and moreover the
routing service was used which includes the direction assistance functionality.
Refferences
AndNav, 2011: www.andnav.org/, (accessed 28 May 2011).

Android Developers, 2011a: http://developer.android.com/guide/basics/what-is-


android.html, (accessed 28 June 2011).

Android Developers, 2011b:


http://developer.android.com/guide/topics/fundamentals.html, (accessed 28 June
2011).

Android Developers, 2011c:


http://developer.android.com/resources/tutorials/views/hello- mapview.html,
(accessed 30 June 2011).

Android Developers, 2011d: http://developer.android.com/index.html, (accessed 30 June 2011).

Android Market Wikipedia, 2011:http://en.wikipedia.org/wiki/Android_Market,


(accessed 28 June 2011)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy