0% found this document useful (0 votes)
31 views

Security and Application Deployment

This document discusses publishing and deploying Android applications. It covers SMS and location-based services APIs, including getting the user's location and displaying markers. Methods are described for zooming and controlling maps, as well as geocoding and reverse geocoding of addresses. The document also discusses obtaining an API key, setting map types, and Android's security model for application sandboxing.
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)
31 views

Security and Application Deployment

This document discusses publishing and deploying Android applications. It covers SMS and location-based services APIs, including getting the user's location and displaying markers. Methods are described for zooming and controlling maps, as well as geocoding and reverse geocoding of addresses. The document also discusses obtaining an API key, setting map types, and Android's security model for application sandboxing.
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/ 30

Chapter

Unit VI 04

Networking and Security


Security and Application Deployment

Hours: 10 Marks: 20

Presented by:

Prof. S.S.Bhosale
Pravara Polytechnic, Loni
Specific Objective

Publish Android applications.


6.1 SMS Telephony

-Provides services for all text-based SMS


messages.

Following are the classes of SMS Telephony.


1. Telephony.Sms.Conversations
2. Telephony.Sms.Draft
3. Telephony.Sms.Inbox
4. Telephony.Sms.Intents
5. Telephony.Sms.Outbox
6. Telephony.Sms.Sent
6.1 SMS Telephony
Send SMS via intent

//Getting intent and PendingIntent instance

Intent intent=new Intent(getApplicationContext(),MainActivity.class);

PendingIntent pi=PendingIntent.getActivity(getApplicationContext(), 0
, intent,0);

//Get the SmsManager instance and call the sendTextMessage


method to send message

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.

This becomes possible with the help of Google Play services,


which facilitates adding location awareness to your app with
automated location tracking, geofencing, and activity recognition.

In this chapter shows you how to use Location Services in your


APP to get the current location, get periodic location updates,
look up addresses etc.
6.2 Location Based Services
The Location Object:

The Location object represents a geographic location which can


consist of a latitude, longitude, time stamp, and other information
such as bearing, altitude and velocity.
6.2 Location Based Services
Sr.No. Method & Description
1 float distanceTo(Location dest)
Returns the approximate distance in meters
between this location and the given location.
2 float getAccuracy()
Get the estimated accuracy of this location, in
meters.
3 double getAltitude()
Get the altitude if available, in meters above sea
level.
4 double getLatitude()
Get the latitude, in degrees.
6.2 Location Based Services
Sr.No. Method & Description
5 double getLongitude()
Get the longitude, in degrees.
6 float getSpeed()
Get the speed if it is available, in meters/second
over ground.
7 void setAccuracy(float accuracy)
Set the estimated accuracy of this location, meters.
8 void setAltitude(double altitude)
Set the altitude, in meters above sea level.
6.2 Location Based Services
Sr.No. Method & Description
9 void setLatitude(double latitude)
Set the latitude, in degrees.
10 void setLongitude(double longitude)
Set the longitude, in degrees.
11 void setSpeed(float speed)
Set the speed, in meters/second over ground.
12 String toString()
Returns a string containing a concise, human-
readable description of this object.
6.2.2 To get an API key
-To use the Maps Static API you must have an API key.
-The API key is a unique identifier that is used to authenticate
requests associated with your project for usage and billing
purposes.

To get an API key:

1. Go to the Google Cloud Console.


2. Click the project drop-down and select or create the project
for which you want to add an API key.
3. Click the menu button and select APIs & Services >
Credentials.
4. On the Credentials page, click + Create Credentials > API
key. ...
5. Click Close.
6.2.2 To get an API key

To get key visit bellow page:

https://developers.google.com/maps/documentation/maps-
static/get-api-key

Or
https://console.developers.google.com/project

Add the API key to your request :

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 is required for requests that use an API key, and


recommended for requests that use a client ID.

HTTPS is also required for applications that include sensitive


user data - such as a user's location - in requests.

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.

Types of Google Maps:


There are four different types of Google maps, as well
as an optional to no map at all.
Each of them gives different view on map.
6.2.3 Android Google Map
Normal: This type of map displays typical road map, natural
features like river and some features build by humans.

Hybrid: This type of map displays satellite photograph data with


typical road maps. It also displays road and feature labels.

Satellite: Satellite type displays satellite photograph data, but


doesn't display road and feature labels.

Terrain: This type displays photographic data. This includes


colors, contour lines and labels and perspective shading.

None: This type displays an empty grid with no tiles loaded.


6.2.3 Android Google Map
Syntax of different types of map:

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 :

Zoom − To increase and decease the zoom level of the map, we


will have a slider with + and − buttons, by default. This slider
will be located at the corner of left hand side of the map.
6.2.4 Zoom Controls
Zoom control code in XML

<zoomControls
android:id=“@+id/zm”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”/>

Methods of zoom controls:

1. hide():
2. Show():
6.2.5 Show Marker on a location

-In the GoogleMap instance we have created call method


addMarker by passing marker options as a parameter.

eg.
googleMap.addMarker(new
MarkerOptions().position(TIMES_SQUARE));
6.2.5 Show Marker on a location

A. Steps to get location in android:

1. Provide permissions in manifest file for receiving location


update.

2. Create LocationManager instance as reference to the location


service.

3. Request location from LocationManager.

4. Receive location update from LocationListener on change of


location.
6.2.5 Show Marker on a location

B. Provide permissions for location update

<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

C. Create location manager

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

Android platform uses the Linux user-based


permissions model to isolate application resources.
This process in called application sandbox.
The aim of sandboxing is to prevent malicious external
programs from interacting with the protected app.
6.2.7 Android security model
6.4 Steps for Publishing Android App

Visit bellow web link:

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

Steps for Publishing Android App :

Step 1: Create a Google Developer account


Step 2: Add a Merchant Account
Step 3: Prepare the Documents
Step 4: Study Google Developer Policies
Step 5: Technical Requirements
Step 6: Creating the App on the Google Console
Step 7: Store Listing
Step 8: Content Rating
Step 9: Pricing the Application
Step 10: Upload APK and Send for Review
Socket
Thank You
❑ Network socket is an endpoint of an inter-
process communication flow across a
computer network.

❑ Sockets provide the communication


mechanism between two computers using
TCP/IP.

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