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

Mobile Application Development

The document outlines various aspects of mobile application development in Android, including attributes of UI components, the use of Intents, methods for obtaining location data, and the significance of content providers. It also details the steps for deploying an app on the Google Play Store, the Android security model, and the lifecycle of services. Additionally, it discusses the Google Play Developer Console and the Android multimedia framework, providing insights into their features and functionalities.

Uploaded by

Vedant Shelke
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Mobile Application Development

The document outlines various aspects of mobile application development in Android, including attributes of UI components, the use of Intents, methods for obtaining location data, and the significance of content providers. It also details the steps for deploying an app on the Google Play Store, the Android security model, and the lifecycle of services. Additionally, it discusses the Google Play Developer Console and the Android multimedia framework, providing insights into their features and functionalities.

Uploaded by

Vedant Shelke
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Mobile Application Development

1.List any four attributes of check box.

 Id
 Checked
 Gravity
 TextColor
 TextSize
 textStyle
 background
 padding

2.State syntax to display built in zoom control.

ANS- Built in Zoom control in Google map can be displayed with:


mMap.getUiSettings().setZoomControlsEnabled(true);

3.State the uses of Intent in Android.

ANS- An Intent is a messaging object you can use to request an action from another app
component. Intents are used for facilitating communication between components like
Activities, Services and Broadcast Receivers.

4.Name any four methods to get location data in android.

 float distanceTo(Location dest)


 float getAccuracy()
 float getBearing()
 double getAltitude()
 double getLatitude()
 float getSpeed()

5.Explain significance of content provider.

ANS- Content Providers are used to share data between two applications. This can be
implemented in two ways:

1. When you want to implement the existing content provider in another application.

2. When you want to create a new content provider that can share its data with other
Applications
6.Develop a simple calculator using relative layout.
7.Develop a program to implement

i) List view of 5 items

ii) Grid view of 4 x 4 items

iii) Image view.


8.Write a program to display a rectangular progress bar.
9.Explain the steps to deploy app on Google Play Store.

ANS- Step 1: Create a Developer Account Before you can publish any app on Google Play,
you need to create a Developer Account. You can easily sign up for one using your existing
Google Account. You’ll need to pay a one-time registration fee of $25 using your
international credit or debit card. It can take up to 48 hours for your registration to be fully
processed.

Step 2: Plan to Sell? Link Your Merchant Account If you want to publish a paid app or plan to
sell in-app purchases, you need to create a payments center profile, i.e. a merchant account.
A merchant account will let you manage your app sales and monthly payouts, as well as
analyze your sales reports right in your Play Console.

Step 3: Create an App After creating application by clicking on ‘Create Application'. Here you
have to select your app’s default language from the drop-down menu and then type in a title
for your app. The title of your app will show on Google Play after you’ve published.

Step 4: Prepare Store Listing Before you can publish your app, you need to prepare its store
listing. These are all the details that will show up to customers on your app’s listing on
Google Play. You not necessarily complete it at once, you can always save a draft and revisit
it later when you’re ready to publish. The information required for your store listing is
divided into several categories such as Product Details containing title, short and full
description of the app, your app’s title and description should be written with a great user
experience in mind. Use the right keywords, but don’t overdo it. Make sure your app doesn’t
come across as spam-y or promotional, or it will risk getting suspended on the Play Store.
Graphic Assets where you can add screenshots, images, videos, promotional graphics, and
icons that showcase your app’s features and functionality.

Languages & Translations, Categorization where in category can be selected to which your
app belong to. Contact Details, Privacy Policy for apps that request access to sensitive user
data or permissions, you need to enter a comprehensive privacy policy that effectively
discloses how your app collects, uses, and shares that data.

Step 5: Upload APK to an App Release Finally upload your app, by uploading APK file. Before
you upload APK, you need to create an app release. You need to select the type of release
you want to upload your first app version to. You can choose between an internal test, a
closed test, an open test, and a production release. The first three releases allow you to test
out your app among a select group of users before you make it go live for everyone to
access. This is a safer option because you can analyze the test results and optimize or fix
your app accordingly if you need to before rolling it out to all users. Once you create a
production release, your uploaded app version will become accessible to everyone in the
countries you choose to distribute it in and click on ‘Create release.’

Step 6: Provide an Appropriate Content Rating If you don’t assign a rating to your app, it will
be listed as ‘Unrated’. Apps that are ‘Unrated’ may get removed from Google Play. To rate
your app, you need to fill out a content rating questionnaire An appropriate content rating
will also help you get to the right audience, which will eventually improve your engagement
rates.

Step 7: Set Up Pricing & Distribution Before you can fill out the details required in this step,
you need to determine your app’s monetization strategy. Once you know how your app is
going to make money, you can go ahead and set up your app as free or paid. You can always
change your app from paid to free later, but you cannot change a free app to paid. For that,
you’ll need to create a new app and set its price.

Step 8: Rollout Release to Publish Your App The final step involves reviewing and rolling out
your release after making sure you’ve taken care of everything else. Before you review and
rollout your release, make sure the store listing, content rating, and pricing and distribution
sections of your app each have a green check mark next to them. Once you’re sure about
the correctness of the details, select your app and navigate to ‘Release management’ – ‘App
releases.’ You can always opt for reviews by clicking on ‘Review’ to be taken to the ‘Review
and rollout release’ screen. Here, you can see if there are any issues or warnings you might
have missed out on. Finally, select ‘Confirm rollout.’ This will also publish your app to all
users in your target countries on Google Play.
10.Explain the Android security model.

The Android security model is primarily based on a sandbox and permission mechanism.
Each application is running in a specific Dalvik virtual machine with a unique user ID assigned
to it, which means the application code runs in isolation from the code of all other
applications. Therefore, one application has not granted access to other applications’ files.
Android application has been signed with a certificate with a private key Know the owner of
the application is unique. This allows the author of the application will be identified if
needed. When an application is installed in the phone is assigned a user ID, thus avoiding it
from affecting it other applications by creating a sandbox for it. This user ID is permanent on
which devices and applications with the same user ID are allowed to run in a single process.
This is a way to ensure that a malicious application has Cannot access / compromise the data
of the genuine application. It is mandatory for an application to list all the resources it will
Access during installation. Terms are required of an application, in the installation process
should be user-based or interactive Check with the signature of the application.

Declaring and Using Permissions

The purpose of a permission is to protect the privacy of an Android user. Android apps must
request permission to access sensitive user data (such as contacts and SMS), as well as
certain system features (such as camera and internet). Depending on the feature, the system
might grant the permission automatically or might prompt the user to approve the request.
Permissions are divided into several protection levels. The protection level affects whether
runtime permission requests are required. There are three protection levels that affect third
party apps: normal, signature, and dangerous permissions.

Normal permissions: Normal permissions cover areas where your app needs to access data
or resources outside the app’s sandbox, but where there’s very little risk to the user’s
privacy or the operation of other apps. For example, permission to set the time zone is a
normal permission. If an app declares in its manifest that it needs a normal permission, the
system automatically grants the app that permission at install time. The system doesn’t
prompt the user to grant normal permissions, and users cannot revoke these permissions.

Signature permissions: The system grants these app permissions at install time, but only
when the app that attempts to use permission is signed by the same certificate as the app
that defines the permission.

Dangerous permissions: Dangerous permissions cover areas where the app wants data or
resources that involve the user’s private information, or could potentially affect the user’s
stored data or the operation of other apps. For example, the ability to read the user’s
contacts is a dangerous permission. If an app declares that it needs a dangerous permission,
the user must explicitly grant the permission to the app. Until the user approves the
permission, your app cannot provide functionality that depends on that permission. To use a
dangerous permission, your app must prompt the user to grant permission at runtime. For
more details about how the user is prompted, see Request prompt for dangerous
permission.

11.State syntax to create Text View and Image button with any two attributes of each.

Text View:

Syntax :

android:text="@+id/textView1”

android:layout_width="<width value>”

android:layout_height="<height_value>"

android:text=”<text to be displayed>”/>

Attributes/Properties of TextView:

● id: Supply an identifier name of this view, to later retrieve it with View.findViewByID() or
Activity.findViewById()

● alpha: alpha property of the view as a value between 0 (entirely transparent) and
1(Completely Opaque). [flag]

● auto link: Controls whether links such as urls and email addresses are automatically found
and converted to clickable links.[flag]

● gravity: The gravity attribute is an optional attribute which is used to control the alignment
of the text like left, right, center, top, bottom, center_vertical, center_horizontal etc

● text: text attribute is used to set the text in a text view. We can set the text in xml as well
as in the java class.

● textColor: textColor attribute is used to set the text color of a text view. Color value is in
the form of “#argb”, “#rgb”, “#rrggbb”, or “#aarrggbb”.

● textSize: textSize attribute is used to set the size of text of a text view. We can set the text
size in sp(scale independent pixel) or dp(density pixel).

● textStyle: textStyle attribute is used to set the text style of a text view. The possible text
styles are bold, italic and normal. If we need to use two or more styles for a text view then
“|” operator is used for that.

● background: background attribute is used to set the background of a text view. We can set
a color or a drawable in the background of a text view.
● padding: padding attribute is used to set the padding from left, right, top or bottom. In
above example code of background we also set the 10dp padding from all the sides of text
view.

ImageButton:

Syntax :

<ImageButton

android:id=”@+id/imageButton”

android:layout_width=”<width_value>”

android:layout_height=”<height_value>”

app:srcCompat=”<image source from drawable folder”/>

Attributes/Properties of ImageButton:

● id: id is an attribute used to uniquely identify a image button. Below is the example code in
which we set the id of a image button.

● src: src is an attribute used to set a source file of image or you can say image in your image
button to make your layout look attractive.

● background: background attribute is used to set the background of an image button. We


can set a color or a drawable in the background of a Button.

● padding: padding attribute is used to set the padding from left, right, top or bottom of the
ImageButton.

12.Describe Android service life cycle along with diagram.

● A service is an application component which runs without direst interaction with the user
in the background.

● Services are used for repetitive and potentially long running operations, i.e., Internet
downloads, checking for new data, data processing, updating content providers and the like.

● Service can either be started or bound we just need to call either startService() or
bindService() from any of our android components. Based on how our service was started it
will either be “started” or “bound”
Service Lifecycle

1. Started

a. There is always only a single instance of service running in the app. If you are calling
startService() for a single service multiple times in our a. A service is started when an
application component, such as an activity, starts it by calling startService().

b. Now the service can run in the background indefinitely, even if the component that
started it is destroyed.

2 Bound

a. A service is bound when an application component binds to it by calling bindService().

b. A bound service offers a client-server interface that allows components to interact with
the service, send requests, get results, and even do so across processes with InterProcess
Communication (IPC).

c. Like any other components service also has callback methods. These will be invoked while
the service is running to inform the application of its state. Implementing these in our
custom service would help you in performing the right operation in the right state.

d. There is always only a single instance of service running in the app. If you are calling
startService() for a single service multiple times in our application it just invokes the
onStartCommand() on that service. Neither is the service restarted multiple times nor are its
multiple instances created.

1. onCreate(): This is the first callback which will be invoked when any component starts the
service. If the same service is called again while it is still running this method wont be
invoked. Ideally one time setup and intializing should be done in this callback.
2. onStartCommand() /startSetvice() This callback is invoked when service is started by any
component by calling startService(). It basically indicates that the service has started and can
now run indefinetly.

3. onBind() To provide binding for a service, you must implement the onBind() callback
method. This method returns an IBinder object that defines the programming interface that
clients can use to interact with the service.

4. onUnbind() This is invoked when all the clients are disconnected from the service.

5. onRebind() This is invoked when new clients are connected to the service. It is called after
onRebind

6. onDestroy() This is a final clean up call from the system. This is invoked just before the
service is being destroyed.

13.Discuss developer console with at least four features.

● Google Play Developer Console is the platform that Google provides for Google Play and
Android developers to publish their apps.

● The Google Play Developer console allows app developers and marketers to better
understand how their apps are performing in terms of growth, technical performance such
as crashes or display issues, and financials.

● The console offers acquisition reports and detailed analysis which can help app devs find
out how well an app is really performing.

● The platform is important as it provides developers with access to first party data
(trustworthy information collected about an app’s audience that comes straight from Google
Play) that highlights the real performance of an app.

● It shows the number of impressions an app listing receives and the number of Installs an
app receives from different sources over time.

14.Describe multimedia framework of Android with diagram.

● The android multimedia system includes multimedia applications, multimedia frameworks,


OpenCore engine and hardware abstract for audio/video input/output devices. And the goal
of the android multimedia framework is to provide a reliable interface for java services. The
multimedia framework consists of several core dynamic libraries such as libmediajni,
libmedia, libmediaplayservice and so on.
● Java classes call the Native C library Libmedia through Java JNI(Java Native Interface).
Libmedia library communications with Media Server guard process through Android’s Binder
IPc (inter process communication) mechanism.

● Media Server process creates the corresponding multimedia service according to the Java
multimedia applications.

● The whole communication between Libmedia and Media Server forms a Client/Server
model

Android Multimedia Framework Architecture

● Typical video/audio data stream works in Android as follows. Particularly, Java applications
first set the URI of the media (from file or network) to PVPlayer through Java framework, JNI
and Native C. In this process, there are no data stream flows.

● Then PVPlayer processes the media data stream with the steps: demux the media data to
separate video/audio data stream, decode video/audio data, sync video.audio time, send
the decoded data out.

● The below is the description of media codec/format, container and network protocol
supported by the Android platform.

1. Container: The audio file format is a file for storing digital audio data on a system. This
data can be manipulated to reduce the size or change the quality of the audio. It is a kind of
container to store audio information.

2. Audio Format: Any format or codec can be used including the ones provided by Android or
those which are specific devices. However it is recommended to use the specified file
formats as per devices.
3. Network Protocol: Protocols such as RTSP, HTTP,HTTPS are supported in audio and video
playback.

15.Write a program to capture an image using camera and display it.

(Note: Consider the appropriate XML file. All attributes are not required.

In java file all imports are not expected. Different relevant logic/code can be

considered.)
16.Develop a program for providing bluetooth connectivity.
17.State and elaborate the syntax of required class and methods for

Geocoding.

Geo-Coding:

• If we know the latitude and longitude of a location, we can find out its address using a
process known as Geocoding. Google Maps in Android supports this via the Geocoder class.

• The following code shows how we can find out the address of a location we have just
touched using the getFromLocation() method:
18.Write a program to implement Android Activity Life Cycle. Use toast messages

to display message through life cycle.

(Note: No XML code is required. In java file all imports are not expected.)

You might also like