Security and Application Deployment
Security and Application Deployment
Unit VI 04
Hours: 10 Marks: 20
Presented by:
Prof. S.S.Bhosale
Pravara Polytechnic, Loni
Specific Objective
PendingIntent pi=PendingIntent.getActivity(getApplicationContext(), 0
, intent,0);
SmsManager sms=SmsManager.getDefault();
sms.sendTextMessage(“9657409806", null, “Welcome to
Pravara", pi,null);
6.2 Location Based Services
Android location APIs make it easy for you to build location-
aware applications, without needing to focus on the details of the
underlying location technology.
https://developers.google.com/maps/documentation/maps-
static/get-api-key
Or
https://console.developers.google.com/project
You must include an API key with every Maps Static API request.
In the following example, replace YOUR_API_KEY with your
API key.
6.2.2 To get an API key
Eg:
https://maps.googleapis.com/maps/api/staticmap?center=40.714
%2c%20-
73.998&zoom=12&size=400x400&key=YOUR_API_KEY
https://developers.google.com/maps/documentation/maps-
static/get-api-key
6.2.3 Android Google Map
Android provides facility to integrate Google map in
our application. Google map displays your current
location, navigate location direction, search location etc.
We can also customize Google map according to our
requirement.
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
googleMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
6.2.3 Methods of Google map
Methods Description
addCircle(CircleOptions This method add circle to map.
options)
addPolygon(PolygonOptions This method add polygon to map.
options)
addTileOverlay(TileOverlayO This method add tile overlay to the map.
ptions options)
animateCamera(CameraUpdat This method moves the map according to the
e update) update with an animation.
clear() This method removes everything from the map.
stopAnimation() This method stops the camera animation if there
is any progress.
6.2.3 Methods of Google map
Methods Description
getMyLocation() This method returns the currently displayed user
location.
moveCamera(CameraUpdate This method reposition the camera according to
update) the instructions defined in the update.
setTrafficEnabled(boolean This method set the traffic layer on or off.
enabled)
snapshot(GoogleMap.Snapsho This method takes a snapshot of the map.
tReadyCallback callback)
stopAnimation() This method stops the camera animation if there
is any progress.
6.2.4 Zoom Controls
Google Maps provides a User Interface with various controls to
let the user interact with the map. We can add, customize, and
disable these controls.
Default Controls
Here is a list of the default controls provided by Google Maps :
<zoomControls
android:id=“@+id/zm”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”/>
1. hide():
2. Show():
6.2.5 Show Marker on a location
eg.
googleMap.addMarker(new
MarkerOptions().position(TIMES_SQUARE));
6.2.5 Show Marker on a location
<uses-permission android:name =
"android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name =
"android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name =
"android.permission.INTERNET" />
6.2.5 Show Marker on a location
LocationManger=(LocationManager)getSystemService
(Context.LOCATION_SERVICE)
6.2.6 Geocoding and Reverse Geocoding
Geocoder :
class is used for handling geocoding and reverse geocoding.
Syntax:
public final class Geocoder extends Object
Geocoding :
Geocoding is the process of transforming street address or any
address into latitude and longitude.
Reverse Geocoding :
Reverse Geocoding is the process of transforming latitude and
longitude into its corresponding street address.
6.2.6 Geocoding and Reverse Geocoding
Method:
1. getFromLocation:
public List <Address> getFromLocation (double latitude, double
longitude, int maxResults)
2. getFromLocationName:
public List <Address> getFromLocationName (String
locationName, int maxResults, double lowerLeftLatitude, double
lowerLeftLongitude, double upperRightLatitude, double
upperRightLongitude)
3. isPresent
public static boolean isPresent ()
6.2.7 Android security model
https://orangesoft.co/blog/how-to-publish-an-android-app-on-
google-play-store
https://www.geeksforgeeks.org/how-to-publish-your-android-
app-on-google-play-store/
6.4 Steps for Publishing Android App