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

Unit 1 Mobile Application Development

The document outlines the fundamentals of mobile application development using Android, covering topics such as the advantages of Android, setting up the development environment, and creating user interfaces. It details the components of Android applications, including the use of Java and XML, as well as how to handle interactivity and data management through content providers and intents. The document serves as a comprehensive guide for beginners to understand and develop Android applications effectively.

Uploaded by

vsuriya037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Unit 1 Mobile Application Development

The document outlines the fundamentals of mobile application development using Android, covering topics such as the advantages of Android, setting up the development environment, and creating user interfaces. It details the components of Android applications, including the use of Java and XML, as well as how to handle interactivity and data management through content providers and intents. The document serves as a comprehensive guide for beginners to understand and develop Android applications effectively.

Uploaded by

vsuriya037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

DEPARTMENT OF INFORMATION TECHNOLOGY

MOBILE APPLICATION DEVELOPMENT

UNIT : 1

Prepared by

Senthil Kumar S
Assistant Professor,
Department of Information Technology,
Sri Ramakrishna Mission Vidyalaya
College of Arts and Science
(Autonomous), Coimbatore
MOBILE APPLICATION DEVELOPMENT
Unit – I
Introducing Android: Before we get started – Advantages of android – Preparing SDK
tools to download – Android development IDE – Java, XML and how android works –
Android application framework – Screen layout design – User Interface Design – Graphics
and animation Design – Interactivity – Content providers – Intent and intent filters. (Pg
No: 1-19). Introducing the basics in android application techniques.*

Unit – II
Setting up your android development environment – Installing Java, Eclipse and Android –
Setting up AVDs and Smart Phone – Understanding Java SE and the Dalvik Virtual
Machine– The directory structure of an android project – Leveraging android XML – Using
your android application resources – The AndroidManifest.xml file – Creating your first
android application.(PgNo:21-85).
Launching the android development environment.*

Unit – III
Android application components – Android Intent Objects: Messaging for Components
– Android Manifest XML: Declaring Your Components – Android View Hierarchies –
Defining Screen Layouts: Using XML. (Pg No: 115-160)
The various components used in android intent objects.*

Unit – IV
UI Design: Buttons, Menus and Dialogs – Using Android UI Elements (Widgets) –
Adding an Image Button to Your Layout – Adding a Text View Widget to Your Layout –
Adding an Image – Using Menus in Android – Creating the Menu Structure with XML –
Defining Menu Item Strings – Inflating the Menu Structure via Java – Running the
Application in the Android Emulator – Making the Menu Work – Adding Dialogs –
Using Custom Dialog Subclasses – Displaying an Alert Dialog. (Pg No: 163-207)
Using Android UI elements.*

Unit - V
Adding Interactivity: Handling UI Events – An Overview of UI Events in Android
– HandlineonClick Events – Android Touchscreen Events: onTouch – Android Right-
click Equivalent: onLongClick – Key Event Listeners: onKeyUp and onKeyDown –
Context Menus in Android: onCreateContextMenu. (Pg No: 235-266)

Unit – I
Introducing Android: Before we get started – Advantages of android – Preparing SDK
tools to download – Android development IDE – Java, XML and how android works –
Android application framework – Screen layout design – User Interface Design – Graphics
and animation Design – Interactivity – Content providers – Intent and intent filters. (Pg
No: 1-19). Introducing the basics in android application techniques.*
INTRODUCTION TO ANDROID:
 Andy Rubin’s creation called Android was purchased by Google in 2005
and made freely available to developers to create mobile device
applications using Java and XML.
 Android was originally created by Andy Rubin as an operating system for
mobile phones.
 In 2005, Google acquired Android Inc., and made Andy Rubin the
Director of Mobile Platforms for Google.
 Android has the power of a full-blown computer operating system. It is
based on the Linux open source platform and Oracle’s (formerly Sun
Microsystems’s) Java, one of the world’s most popular programming
languages.
 Android is a software package and Linux based operating system for
mobile devices such as tablet computers and smart phones.
 It is developed by Google and later the OHA (Open Handset Alliance).
 Java language is mainly used to write the android code even though other
languages can be used.
 The goal of android project is to create a successful real-world product
that improves the mobile experience for end users.
 Android has expanded beyond a pure mobile phone platform to provide a
development platform for an increasingly wide range of hardware,
including tablets and televisions.
Android is an ecosystem made up of a combination of three components:
 A free, open-source operating system for embedded devices
 An open-source development platform for creating applications
 Devices, particularly mobile phones, that run the Android operating
system and the applications created for it
Android is made up of several necessary and dependent parts, including
the following:
 A Compatibility Definition Document (CDD) and Compatibility Test
Suite (CTS) that describe the capabilities required for a device to support
the software stack.
 A Linux operating system kernel that provides a low-level interface with
the hardware, memory management, and process control, all optimized
for mobile and embedded devices.
 Open-source libraries for application development, including SQLite,
WebKit, OpenGL, and a media manager.
 A run time used to execute and host Android applications, including the
Dalvik Virtual Machine (VM) and the core libraries that provide
Android-specific functionality. The run time is designed to be small and
efficient for use on mobile devices.
 An application framework that agnostically exposes system services to
the application layer, including the window manager and location
manager, databases, telephony, and sensors.
 A user interface framework used to host and launch applications.
 A set of core pre-installed applications.
 A software development kit (SDK) used to create applications, including
the related tools, plug-ins, and documentation.

ADVANTAGES OF ANDROID:

 Android is based on open source technology. However, over the past


two decades, open source software technology has become equally as
sophisticated as conventional development technologies.
 In addition to being free for commercial use, Android has one of the
largest, wealthiest, and most innovative companies in modern-day
computing.
 Finally, and most important, it’s much easier to get your Android
applications published. Publishing your app on Android Market is as
easy as paying $25, uploading your .apk file, and specifying free or paid
download.
Categories of Android applications
There are many android applications in the market. The top categories
are:
 Entertainment
 Tools
 Communication
 Productivity
 Personalization
 Music and Audio
 Social
 Media and Video
 Travel and Local etc.

Preparing SDK Tools to Download:


 There are three major components of an Android development
environment:
 Java
 Eclipse
 Android
Java:
 Let’s start with the foundation for everything we are doing, the Java
Platform, Standard
 Edition (Java SE). Java SE contains the core Java programming language.
 To download Java SE, simply go to the Java SE Downloads section of
Oracle’s web
 site, which is in the Technology Network section under the Java
directory, at this URL:
 http://www.oracle.com/technetwork/java/javase/downloads/index.html

ECLIPSE
 Eclipse is an integrated development environment (IDE), which is a
piece of software dedicated to allowing you to more easily write
programming code, and run and test that code in an integrated
environment. In other words, you write all your code into its text editor,
before running and testing that code using commands in Eclipse, without
ever needing to switch to another program.

 Go to the Eclipse web site’s Downloads section at this URL:


 http://www.eclipse.org/downloads/packages/release/galileo/sr2

Android SDK
 The Android Software Development Kit (SDK) is a collection of files and
utilities that work hand in hand with the Eclipse IDE to create an
Android-specific development tool.
 To dowload the Android SDK, go to the Android Developers web site,
located at this URL:
 http://developer.android.com/sdk/index.html

ANDROID DEVELOPMENT IDE:


 The Eclipse IDE is a sophisticated programming environment that
features code highlighting, device emulation, logic tracing, debugging,
and running
Java, XML and how android works:
 An Android application is different. Its functionality is spelled out in Java
code, XML markup, and the Android manifest in a way that is truly
unique.
 XML is used in Android to define everything from UIs to data access,
and even programmatic constructs like Java object definitions and
configurations.
 XML markup tags are easier for beginners to comprehend than a complex
programming language like Java.
INTRODUCING THE BASICS IN ANDROID APPLICATION
TECHNIQUES:
CREATING FIRST ANDROID APPLICATION
 In this Section, you will know how to create the simple hello android
application. We are creating the simple example of android using the
Eclipse IDE. For creating the simple example:
 Create the new android project
 Write the message (optional)
 Run the android application

 Hello Android Example


 You need to follow the 3 steps mentioned above for creating the Hello
android application.
 1) Create the New Android project
For creating the new android project:
Select File > New > Project...
 2) Select the android project and click next
3) Fill the Details in this dialog box and click finish

Now an android project have been created. You can explore the android project
and see the simple program, it looks like this:
For writing the message we are using the TextView class. Change the onCreate
method as:
TextView textview=new TextView(this);
textview.setText("Hello android! How r u");
setContentView(textview);

Let's see the full code of MainActivity.java file.

package com.example.helloandroid;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textview=new TextView(this);
textview.setText("Hello Android!");
setContentView(textview);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}

3) Run the android application


To run the android application: Right click on your project > Run As .. >
Android Application

The android emulator might take 2 or 3 minutes to boot. So please have


patience. After booting the emulator, the eclipse plugin installs the
application and launches the activity. You will see something like this:
ANDROID APPLICATION FRAMEWORK:

 Android software development environment and acquired a basic


understanding of the components that make up an application
development project.
 Java programming code and XML, along with any new media resources,
are compiled, compressed, and bundled into Android’s signature .apk file
type (APK stands for Android PacKage), and how logical Android
components talk to each other in an application.

SCREEN LAYOUT DESIGN:


 Android is a mixture of Java code and XML markup that controls the
hierarchy of View and ViewGroup objects and Layout containers.
 We extend these classes to create your own custom View objects and
Layout containers when you need a more complex design.
 These containers ultimately hold the other visual and UI content in your
application in its proper place, and thus finally the foundation of your
application design.

USER INTERFACE DESIGN:

 Android has a large number of UI (User Interface Design) elements, such


as buttons, text fields, radio buttons, check boxes, menus, alert dialogs,
and all of those familiar controls that allow users to interface with
application software.
 These items can be implemented both in Java and in XML.
Creating the UI Image Button Project in Eclipse:
Creating the button1.xml File
 In the New File dialog, ask Eclipse to create the file button1.xml in the
Chapter7/res/drawable folder, as shown in Figure

 Click the button1.xml tab at the top of your screen, and then type in the
XML code that defines the selector and item tags for setting the three
different image button states:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/button1_pressed" />
<item android:state_focused="true"
android:drawable="@drawable/button1_focused" />
<item android:drawable="@drawable/button1_normal" />
</selector>

After you’ve entered the XML, you’ll notice that Eclipse shows that there
are three errors in the markup relating to missing file assets. Place your
mouse over the red X on the left margin by the markup code. This pops up a
diagnostic message regarding why Eclipse thinks this code needs your
attention, as shown in Figure
GRAPHICS AND ANIMATION DESIGN:
 We’ll start adding application media elements through images, video, and
animation. These elements are key to making your application look great
across all Android phones.
 The central set of classes used to control the graphics-related content
within your Android application is called the drawable package. This
package handles classes and methods related to drawing the following
onto the Android display screen:
 Bitmaps: In a bitmap, a collection of pixels make up an image—it’s a
map of image bits.
 Shapes: Shapes are line drawings. They also known as vectors, like
the lines architects use in CAD drawings
 Gradients: Gradients are smooth transitions from one color to another
color. They can be shaped in a straight line or circular.
 Transitions: Shape transitions are smooth vector changes between
one shape to another shape. This process is sometimes referred to as
morphing.
 Animation: Animation is an image that moves in some way.
 Image transitions: These are smooth fades between one image to
another image. They are usually used to transition from one image to
another image.
 In Android development, graphics-related items like gradients, image
transitions, animated transformations, and frame-based animation can all be
termed drawables.
INTERACTIVITY:
 Adding interactivity to applications, so that they respond to user input and
actually does something. You do this by handling UI events.
 Android has provided a way to facilitate event handling.
 The most efficient way of handing events that are triggered by your users
using the UI elements that are attached to the views and layouts defined in
your XML files.
 Event listeners, which execute the proper code in response to an event that is
triggered when a UI element is used by the user (for instance, you can run
some code when a user touches a UI element or presses a key on the
keyboard)
 Default event handlers that allow you to build event handling right into your
UI elements
 Example: For instance, if a Button is touched, an onTouchEvent() method is
called on that object, because Android knows to call a method of that name
when that event occurs.
CONTENT PROVIDERS:
 Content providers in Android provide a way to make data available to your
application and to other applications
 Content providers handle data and database management issues.
 These content providers allow you to access databases of system information
that are available through the Android operating system, as well as your own
databases of information.
 Content providers, which are often databases filled with information, such as
a contact list, that applications may want to access to provide functionality of
their own.
 Content providers are the only method Android provides for sharing data
across applications
 Content providers expose their data via data models similar to databases, and
how to use cursors to traverse the database in various ways.
 We’ll investigate URI objects and how to use them to identify and access
data sets. Each set of data in the database will have its own Uniform
Resource Identifier (URI), which is similar to an HTTP URL.
 An Android content provider provides you with access to sharable data
structures commonly called databases.
 The basic procedure is as follows:
1. Get permission to open the database.
2. Query the data.
3. Access the data.

INTENT AND INTENT FILTERS:


 An intent is an abstract description of an operation to be performed,” so
intents can be used to quickly accomplish many tasks that would otherwise
take more programming code
 Intents are asynchronous messages (members of the Intents class) that travel
between Android’s activities, services, and broadcast receiver components.
 Asynchronous means not synchronized; that is, messages can be sent and
received independently (not in sync, but without pattern or reason) from each
other.
 An intent is represented by the android.content.Intent class.
 It is in the content package because intents can be used to quickly access
content providers
 Using intents allows you to take your current Android applications to an
entirely new level of complexity.
 An Intent object is basically a passive data object (a bundle of
instructions, if you will) that both provides a description of some sort of
standard operating system or developer created “action” that needs to be
performed and passes the data which that action needs to operate on to the
code receiving the intent.
 There are three types of Intent objects that can be used inside the Android
OS to communicate with activities, services, and broadcast receivers.
 Intent filters allow you to filter out events that your apps do not need to be
concerned with, allowing you to optimize the progress of internal
communications.

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