You are on page 1of 11

Multimedia

Multimedia capabilities, or the playing and recording of audio


and video, is one such significant task that many users find to be of
great value. Take a quick look around and you will find people using
the phone as a means to enjoy a variety of programs as well as share
self-recorded media among friends. Android provides the APIs to
easily access this capability as well as embed multimedia and its
manipulation directly within an application.

Android Multimedia Location

Ever since mobile phones started to incorporate standalone GPS


receivers, developers have foreseen a new era of location-based
applications. Location awareness enables a new generation of mobile
applications. If your application is looking up restaurants, it’s clearly
advantageous if you can restrict your search to the area around you.
It’s even better if you can see a map of the restaurants’ locations, and
perhaps be able to look up driving or walking directions.

Location-Based Services
Mobile phones use several related methods, alone and in
combination, to determine where they are:

Cell ID
Whether you’re actually talking on the phone or not, as long as
it’s powered up, your mobile phone carries on a constant conversation
with nearby cell towers. It has to do this to be able to respond when
someone calls you, so every few seconds it “pings” the cell tower it
was using last to tell it that it’s still in range and to note network
parameters such as the current time, the current signal strength (uplink
and downlink), and so on.
If you happen to be moving, your phone may initiate a handover
to another cell tower, all in the background and without you having to
intervene. Each cell tower worldwide has a unique identifier called,
appropriately enough, its Cell ID, and each tower knows its latitude
and longitude, so it’s easy enough for a mobile phone to know
approximately where you are located by noting the current Cell ID’s
geo- graphic location. Cell network sizes vary depending on the
expected traffic in an area, but in the United States their radius ranges
from a half mile (cities) to five miles or more (wide-open spaces).

Triangulation
Most of the time your mobile phone is in range of more than one
cell tower. In 2G and later mobile technologies, the cell tower has the
ability to tell what direction your signal is coming from. If there are
two or three towers that can see your phone, together they can
triangulate on your phone’s location. With some operators, your phone
then has the ability to query the network to find out where it’s been
located. This sounds a little backward, but it can be very accurate, and
it doesn’t depend on any extra hardware on the mobile phone.
GPS
The satellite-based Global Positioning System is ubiquitous these
days, found in car navigation units, handheld navigators, and mobile
phones. The good news is that, using GPS, your mobile phone can
determine its location very accurately, including its altitude if that’s
important for some particular application. There are several downsides
to GPS, but it is gaining popularity nonetheless. The downsides are:

Increased cost
GPS radios and processors are fairly inexpensive, but still, an
increase of even$10 in the bill-of-materials cost of a mobile phone is
considerable. Reduced battery life. There have been great strides in
reducing the power required by GPS radios and processors, but they
still suck battery power. Most phones that include GPS also have a
feature that lets the user turn it on and off.
Peer to Peer Architecture

P2P mode is enabled in Android 2.3.3 (API level 10) when one
device is set up to transmit data over NFC to another device that can
receive NFC data. The sending device may also receive data from the
receiving device, and thus peer-to-peer (P2P) communication occurs.
To do this, the enableForegroundNdefPush() method in the
NfcAdapter class is used. This enables the Activity to transmit an
NdefMessage, when it is in the foreground, to another NFC device that
supports the “com.android.npp” NDEF push protocol. The
enableForegroundNdefPush() method must be called from the main
thread (such as in onResume()):

2D Graphics

Android offers a custom 2D graphics library for drawing and


animating shapes and images. It provides methods to draw oval, rectangle,
picture, text, line etc. The android. graphics. Paint class is used with
canvas to draw objects. It holds the information of color and style.
Drawable

A Drawable is a general abstraction for "something that can be


drawn." You'll discover that the Drawable class extends to define a
variety of specific kinds of drawable graphics
including BitmapDrawable, ShapeDrawable, PictureDrawable, LayerD
rawable, and several more.

Shape Drawable

When you want to dynamically draw some two-dimensional


graphics, a ShapeDrawable object will probably suit your needs. With
a ShapeDrawable, you can programmatically draw primitive shapes
and style them in any way imaginable.

A ShapeDrawable is an extension of Drawable, so you can use


one where ever a Drawable is expected — perhaps for the background
of a View, set with setBackgroundDrawable(). Of course, you can
also draw your shape as its own custom View, to be added to your
layout however you please. Because the ShapeDrawable has its
own draw () method, you can create a subclass of View that draws the
ShapeDrawable during the View.onDraw() method.

public class CustomDrawableView extends View {


private ShapeDrawable mDrawable;

public CustomDrawableView(Context context) {


super(context);

int x = 10;
int y = 10;
int width = 300;
int height = 50;

mDrawable = new ShapeDrawable(new OvalShape());


mDrawable.getPaint().setColor(0xff74AC23);
mDrawable.setBounds(x, y, x + width, y + height);
}

protected void onDraw(Canvas canvas) {


mDrawable.draw(canvas);
}
}
Mobile Agents
Mobile Agents are also called as transportable agents. They are
classified into two types:
Mobile Agents with pre-defined path: They have a static
migration path.
Mobile Agents with undefined path i.e., Roamer: They have
dynamic migration paths. The mobile agents choose their path
according to the present network condition.

Features of Mobile Agents

The mobile agents are autonomous with intelligence, social


ability, learning, and the most important feature is their mobility. They
are independent in nature, self-driven and do not require a
corresponding node for communication. They can work efficiently
even after the user gets disconnected from the network.

Intelligence
Autonomous
Mobility
Communicative

Life Cycle of Mobile Agents

The life cycle of mobile agents ensures the following conditions:


They can adapt to the environment. For example, either home or
foreign environment.
They are capable of switching among the positions of one node
to another.
They are autonomous and focused on the final output.

The Google Maps Activity |


Multithreading
An essential component of developing for Android is multithreading, which
enables you to carry out multiple operations at once. Multithreading can be
implemented in Android using a variety of methods, including AsyncTask,
Handler, and Thread.

The Google Maps Activity |


Async Task
Android operating system has a class called AsyncTask that
offers a quick and easy way for implementing experience actions
lacking the need to specifically oversee strings and those who handle
them. It has three different approaches: doInBackground(),
onPostExecute(), and onPreExecute().

OnPostExecute()
Once the download is complete, the onPostExecute() method
will be called, and the downloaded image will be displayed in the
ImageView passed to the ImageDownloadTask.

doInBackground()

Background Tasks − Multithreading is commonly used to


perform background tasks that don't require direct interaction with the
user interface. For example, downloading files, synchronizing data
with a server, or performing complex calculations can be offloaded to
separate threads to prevent blocking the main UI thread and provide a
smooth user experience.

Packaging
In Android, a package is a collection of code, resources, and
manifest files that are bundled together and distributed as a single unit.
Packages are used to organize and distribute code in Android, and they
play a central role in the Android app development process.
Deployment

Mobile app deployment is not a singular event, but rather a series of steps
that take place after the development of the app. It involves preparing the
app for distribution, which can include packaging the app, setting up servers,
and configuring settings. The goal is to ensure that the app is ready for use
on the intended platform, whether that's iOS, Android, or another mobile
The Google Maps Activity |
operating system. Deployment can also involve the process of updating an
existing app. This can include releasing new features, fixing bugs, or improving
performance. In this case, deployment involves not only making the new version
available, but also ensuring that existing users can smoothly transition to the
updated app.

Stages of Mobile App Deployment

The first stage of mobile app deployment is preparation. This involves finalizing
the app's code, testing it thoroughly, and packaging it for distribution. The app
may also need to be configured for the intended platform, which can involve
setting up servers, databases, and other backend systems.

The next stage is distribution. This involves making the app available for
download, either through a public app store like Google Play or the Apple App
Store, or through a private distribution method. The app may also need to be
registered with the appropriate app store, which can involve submitting the app
for review and approval.

Methods of Mobile App Deployment

There are several methods of mobile app deployment, each with its own
advantages and disadvantages. The most common method is through a public
app store. This is a straightforward and widely accepted method of distribution,
but it can also be time-consuming and costly, as app stores often charge fees for
listing and selling apps.

Another method is private distribution, which involves making the app available
for download directly from the developer's website or through a private app
store. This method offers more control over the distribution process, but it can
also be more complex to set up and manage.

The Google Maps Activity |


Mobile App Deployment Platforms

There are several platforms available for mobile app deployment, each with its
own features and capabilities. These platforms provide tools and services to help
developers prepare, distribute, and manage their apps.

Some of the most popular mobile app deployment platforms include Google
Play for Android apps, the Apple App Store for iOS apps, and Microsoft Store
for Windows apps. These platforms offer a wide range of tools and services,
including app testing, distribution, analytics, and monetization options.

Mobile Application Development Platform

Google Play
Google Play is the official app store for Android devices. It offers a
comprehensive set of tools for app deployment, including a developer console
for managing apps, a distribution service for making apps available to users, and
a review process for ensuring app quality.

Apple App Store


The Apple App Store is the official app store for iOS devices. Like Google Play,
it offers a comprehensive set of tools for app deployment, including a developer
portal for managing apps, a distribution service for making apps available to
users, and a review process for ensuring app quality.

The Google Maps Activity |

You might also like