You are on page 1of 82

Android Project

Android Project
PROJECT
REPORT
Root Finder and Measurements

Root Finder and Measurements project is based on Android Platform that helps to find the root
between two places and gives the distance between them. It makes very easy for travellers to travel at
different location.

ON
ON

ANDROID

Submitted By:NAME:-

ROHIT YADAV

ROLL NO:- CS/12/52

Project Guide & Trainer:Trainer Name Abhishek saxena

College Name with Address


Al-falah university dhauj Faridabad Haryana
(121004)

Page 0 of 82

Android Project

ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of any task would
be incomplete without the mention of people whose ceaseless cooperation made
it possible, whose constant guidance and encouragement crown all efforts with
success.

I would like to take this opportunity to express my gratitude towards all the
people who have in various ways, helped in the successful completion of my
project. Many books are the result of a collection from various sources, such as
internet, newspapers, magazines etc. Unfortunately, sources were not always
noted or accurate acknowledgement.

Regardless, I am grateful to my friend, for his guidance, inspiration &


constructive suggestions that helped me in the preparation & execution of this
project.

Page 1 of 82

Android Project
CONTENTS

Introduction to Android

Application Building Block


Android Activities.............................................
The Application Manifest.
Implementation.
KeyTools
Layout

Layout File
Create Layout File
Attributes
Attributes Id
References view in java code
Layout Types
Linear Layout
Relative Layout
Table Layout
Frame Layout
Tab Layout

Software Development
Eclipse With Emulator..
Camera Hardware And Application..

Permission
Image Capture Intent
Video Capture Intent
Building A Camera Application
Checking Camera Features
Placing Preview a Layout

View.

Advantages
Disadvantages
Android Architecture
Applications
Application Framework
Libraries
Android Runtime
Linux Kernel

Widgets
Text View
Auto Text
Editable

Release Process..
Animation.

Tweened Animation
Alpha Animation
Rotate Animation
Translate Animation
Page 2 of 82

Android Project
Scale Animation
Conclusion

Page 3 of 82

Android Project

Page 4 of 82

Android Project

INTRODUCTION
TO ANDROID

Page 5 of 82

Android Project

INTRODUCTION TO ANDROID
Android is an open source software stack that includes the
operating system, middleware and key applications along with the set
of API Libraries for writing mobile applications that can shape the
look, feel and functions of the mobile handsets. It uses the java
programming language with XML, Android SDK tools (Software
development toolkit) and necessary API to develop the applications
on android platform.
Android will ship with a set of core applications including an
email client, SMS Program, Calendar, maps, browser, contacts and
many other applications. All applications are written in Java
Programming language and XML By using Android SDK and APIs.
Android provides many features that help to create a new
application for mobile handsets. It provides the following features to
develop the new applications.
Application framework enabling reuse and replacement of
components.
Dalvik Virtual Machine (DVM) optimized for mobile devices.
Integrated Web Browser based on open source web kit Engine.
Optimized Graphics powered by a custom 2D Graphics
library; 3D Graphics based on the openGL ES 1.0 specifications
(hardware acceleration optional).
SQLite for structure data storage.
Media Support for common audio, video, and still image
formats (MPEG4, MP3, H.264, AAC, AMR, JPEG, PNG, and
GIF).
GSM Telephony (hardware dependent).
Bluetooth, Edge, 3G and WIFI (hardware dependent).
Page 6 of 82

Android Project
Camera, GPS, Compass, accelerometer (hardware
dependent).
Rich Development Environment including a device emulator,
tools for debugging, memory and performance profiling, and a
plugin for Eclipse IDE.
ADVANTAGES
Fast & easy application development
Android is open-source Linux software.
Android is free of cost.
The ability for anyone to customize the Google Android
platform will open up the applications playing field to small and
new companies.
In addition, as a result of many mobile phones carrying Google
Android, companies will come up with such innovative products
like the location aware services that will provide users with any
information they might be in need of. This information could
include knowing the location of a nearby convenience store or
filling station.

DISADVANTAGE
Android is an open source platform driving all Android phones,
it could significantly increase the risk of hacking these devices.
It only best suited for high-end phones.

ANDROID ARCHITECTURE
Page 7 of 82

Android Project
The following diagrams show the major components of the
android operating system. Each section is described in detail in
below.

Page 8 of 82

Android Project
Applications

Android will Ship with a set of core applications including an


email client, SMS program, calendar, maps, browser, contacts, and
others. All applications are written using java programming language.
All applications, both native and third party, are built on the
application layer using the same API libraries. The application layer
runs within the Android run time using the classes and services made
available from the application framework.
Application Framework

The application framework provides the classes used to create


Android applications. It also provides a generic abstraction for
hardware access and manages the user interface and application
resources. Android offers developers the ability to build extremely
rich and innovative applications.
Developers have full access to the same framework APIs used
by the core applications. The application architecture is designed to
simplify the reuse of components; any application can publish its
capabilities and any other application may then make use of those
capabilities (subject to security constraints enforced by the
framework). This same mechanism allows components to be replaced
by the user.
Page 9 of 82

Android Project
Underlying all applications is a set of services and systems, including:

A rich and extensible set of Views that can be used to build an


application, including lists, grids, text boxes, buttons, and
even an embeddable web browser

Content Providers that enable applications to access data


from other applications (such as Contacts), or to share their
own data

A Resource Manager, providing access to non-code resources


such as localized strings, graphics, and layout files

A Notification Manager that enables all applications to


display custom alerts in the status bar

An Activity Manager that manages the lifecycle of


applications and provides a common navigation back stack

Libraries

Android includes a set of C/C++ libraries used by various


components of the Android system. These capabilities are exposed to
developers through the Android application framework. Some of the
core libraries are listed below:

Page 10 of 82

Android Project
System C library - a BSD-derived implementation of the
standard C system library (libc), tuned for embedded Linuxbased devices
Media Libraries - based on Packet Videos Open CORE; the
libraries support playback and recording of many popular audio
and video formats, as well as static image files, including
MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
Surface Manager - manages access to the display subsystem and
seamlessly composites 2D and 3D graphic layers from multiple
applications
Lib Web Core - a modern web browser engine which powers
both the Android browser and an embeddable web view
SGL - the underlying 2D graphics engine
3D libraries - an implementation based on OpenGL ES 1.0 APIs;
the libraries use either hardware 3D acceleration (where
available) or the included, highly optimized 3D software
rasterizer
Free Type - bitmap and vector font rendering
SQLite - a powerful and lightweight relational database engine
available to all applications
C/C++ libraries
Interface through Java
Surface manager Handling UI Windows
2D and 3D graphics
Media codecs, SQLite, Browser engine

Android Runtime
What makes an Android phone an Android phone rather than a
mobile Linux implementation is the Android run time. Including the
core libraries and the Dalvik virtual Machine, the Android run time is
Page 11 of 82

Android Project
the engine that powers your applications and, along with the libraries,
forms the basis for the application framework.

Core Libraries While Android development is done in Java,


Dalvik is not a Java VM. The core Android libraries provide
most of the functionality available in the core Java libraries as
well as the Android-specific libraries.
Dalvik Virtual Machine Dalvik is a register-based virtual
machine thats been optimized to ensure that a device can run
multiple instances efficiently. It relies on the Linux kernel for
threading and low-level memory management.

Linux Kernel

Page 12 of 82

Android Project

Core services (including hardware drivers, process and memory


management, security, network, and power management) are handled
by a Linux 2.6 kernel. The kernel also provides an abstraction layer
between the hardware and the remainder of the stack.

APPLICATION BUILDING BLOCKS


Activities
Services
Broadcast Receivers
Content Providers
Intents
Activities

Presents a visual user interface for one


focused endeavor the user can undertake.
List of menu items a user can choose from or
display photographs along with their captions

Page 13 of 82

Android Project
Services

Doesnt have a visual user interface, instead


runs in the background
Play background music as the user attends to
other matters

Broadcast Receivers

Receives
and
reacts
to
broadcast
announcements
An application can announce to whoever is
listening that a picture was taken.

Content Providers

Makes a specific set of the applications data


available to other applications.
An application uses a contact list component

Intents

A simple message passing framework. Using


intents you can broadcast messages systemwide or to a target Activity or Service.

THE ANDROID ACTIVITIES


An Activity is an application component that provides a screen
with which users can interact in order to do something, such as dial
the phone, take a photo, send an email, or view a map. Each activity is
given a window in which to draw its user interface.
An application usually consists of multiple activities that are
loosely bound to each other. Each activity can then start another
activity in order to perform different actions. Each time a new activity
starts, the previous activity is stopped, but the system preserves the
activity in a stack (the "back stack").
For instance, when stopped, your activity should release any
large objects, such as network or database connections. When the
Page 14 of 82

Android Project
activity resumes, you can reacquire the necessary resources and
resume actions that were interrupted. These state transitions are all
part of the activity lifecycle.
Android Activity Lifecycle
Application run in their own processes (VM, PID)
Processes are started and stopped as needed to run an application's
components
Processes may be killed to reclaim resources
Method
On Create()

On Restart()

Description

Killabl Next
e after?
Called when the activity is first No
On Start()
created. This is where you should
do all of your normal static set up
create views, bind data to lists,
and so on. This method is passed a
Bundle object containing the
activity's previous state, if that
state was captured (see Saving
Activity State, later).
Always followed by on Start ().
No

Called after the activity has been


stopped, just prior to it being
started again.
Always followed by on Start()
On Start()
Called just before the activity No
becomes visible to the user.
Followed by on Resume() if the
activity comes to the foreground,
or on Stop() if it becomes hidden
On Resume() Called just before the activity No
starts interacting with the user. At

On Start()

On Resume()
or
on Stop()
On Pause()

Page 15 of 82

Android Project

On Pause()

On Stop()

on Destroy()

this point the activity is at the top


of the activity stack, with user
input going to it.
Always followed by on Pause().
Called when the system is about to Yes
start resuming another activity.
This method is typically used to
commit unsaved changes to
persistent data, stop animations
and other things that may be
consuming CPU, and so on. It
should do whatever it does very
quickly, because the next activity
will not be resumed until it
returns.
Followed either by on Resume ()
if the activity returns back to the
front, or by on Stop () if it
becomes invisible to the user.
Called when the activity is no Yes
longer visible to the user. This
may happen because it is being
destroyed, or because another
activity (either an existing one or a
new one) has been resumed and is
covering it.
Followed either by on Restart () if
the activity is coming back to
interact with the user, or by on
Destroy () if this activity is going
away.
Called before the activity is Yes
destroyed. This is the final call
that the activity will receive. It
could be called either because the
activity is finishing (someone
called finish () on it), or because

On Resume()
or
on Stop()

On Restart()
or
on Destroy()

Nothing

Page 16 of 82

Android Project
the
system
is
temporarily
destroying this instance of the
activity to save space. You can
distinguish between these two
scenarios with the is Finishing()
method.

Page 17 of 82

Android Project

Services
Faceless components that run in the background
E.g. music player, networks download etc

Page 18 of 82

Android Project
Broadcast Receivers
Base class for code that will receive intents sent by sendBroadcast
(). You can either dynamically register an instance of this class with
Context.registerReceiver () or statically publish an implementation
through the <receiver> tag in your AndroidManifest.xml. Note: If
registering a receiver in your Activity.onResume ()
implementation, you should unregister it in Activity.onPause (). Do
not unregister in Activity.onSaveInstanceState (), because this
won't be called if the user moves back in the history stack.
There are two major classes of broadcasts that can be received:
Normal broadcasts (sent with Context. SendBroadcast) are
completely asynchronous. All receivers of the broadcast are
run in an undefined order, often at the same time. This is
more efficient, but means that receivers cannot use the result
or abort APIs included here.
Ordered broadcasts are delivered to one receiver at a time.
As each receiver executes in turn, it can propagate a result to
the next receiver, or it can completely abort the broadcast so
that it won't be passed to other receivers. The order receivers
run in can be controlled with the android: priority attribute of
the matching intent-filter; receivers with the same priority
will be run in an arbitrary order.
Content Providers
Enables sharing of data across applications
E.g. address book, photo gallery
Provides uniform APIs for:
querying
delete, update and insert.
Page 19 of 82

Android Project
Content is represented by URI and MIME type
Intents
Think of Intents as a verb and object; a description of what you
want done
E.g. VIEW, CALL, PLAY etc..
System matches Intent with Activity that can best provide the
service
Activities and Intent Receivers describe what Intents they can
service
The Applications Manifest
Declares the permissions the application will need
permission)

(uses-

Declare permissions that activities or services might require to


use your app (permission)
Provides instrumentations elements (instrumentation)
Defines the guts of the application
Provides hooks to connect to optional Android components such
as mapping (uses-library)
APPLICATION
Devices
Phones
Tablets
Netbooks
Embedded and control units
Page 20 of 82

Android Project
App.
IMPLEMENTATION
Cheap: Install the tools
Java, Eclipse, Android SDK
Your computer: Windows, Linux, Mac
Phone emulator included
Easy: Create your first program
Android Development Toolkit (ADT)
Plugin for Eclipse, written by Google
Examples and tutorials available
Run on the Emulator
Verify by USB connecting a phone to computer
Rewarding: Prepare to publish e.g. Google Market

KEY TOOLS
Linux, Windows, Mac OSX
Java (Oracle/Sun)
o Java SDK 6 update 22
SDK (Google)
o Android SDK r7
Eclipse
o Eclipse 3.6.1

What is a Layout ?
Page 21 of 82

Android Project
1. Your layout is the architecture for the user interface an
Activity.
2. It defines the layout structure and holds all the visual elements
that appear to the user.

How to declare a Layout? Two Options


Option #1: Declare UI elements in XML (most
common and preferred)
Android provides a straightforward XML vocabulary that
corresponds to the View classes and subclasses, such as those
for UI controls called widgets (Text View, Button, etc.) and
layouts.
Option #2: Instantiate layout elements at runtime
(programmatically in Java code)
Your application can create View and ViewGroup objects (and
manipulate their properties) programmatically (in Java code).
Using both options
You can use either or both of these options for declaring and
managing your application's UI
Android system create Java objects for the visual elements
defined in the XML
Every View and ViewGroup has a corresponding Java
class (We use the terms View element and Viewclass
interchangeably)
Example usage scenario of using both
Page 22 of 82

Android Project
You could declare your application's default layouts in XML,
including the visual elements that will appear in them and their
properties. (Option #1).
You could then add code in your application that would modify
the state of the visual elements declared in XML, at run time.
(Option #2).
Advantages of Option #1:

Declaring UI in XML

Separation of the presentation from the code that controls


its behavior
You can modify UI without having to modify your
source code and recompile
For example, you can create XML layouts for different
screen orientations, different device screen sizes, and
different languages
Easier to visualize the structure of your UI (without writing
any code)
Easier to design/debug UI
Visualizer tool (like the one in Eclipse IDE)

Layout File
Layout File Structure
A layout specifies a hierarchical tree structure of
ViewGroup and View elements
A ViewGroup is considered as a branch
A View is considered as leaf.

Page 23 of 82

Android Project
A layout file must contain exactly one root element, which
must be one of the following
ViewGroup element (i.e., LinearLayout) - typical
View element (Button, for example)
A ViewGroup element can have child elements, Which
themselves can be ViewGroup or View elements
Example: Layout File
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>

Where to create Layout file?


Save the file with the .xml extension, in your
Android project's res/layout/ directory

Page 24 of 82

Android Project

Load the Layout XML Resource


Each XML layout file is compiled into a layout resource
A layout resource is referred to as
R.layout.<layout_file_name>
The layout resource is loaded through
setContentView(R.layout.<layout_file_name>)
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
Page 25 of 82

Android Project
}

Attributes
Attributes
Every View and ViewGroup element has a set of attributes.
Some attributes are specific to a View element (for
example, TextView supports the textSize attribute)
but these attributes are also inherited by any View
elements that may extend this element.
Some are common to all View elements, because
they are inherited from the root View element (like
the id attribute).
Other attributes are considered "layout parameters,"
which are attributes that describe certain layout
orientations of the View element, as defined by that
Objects parent ViewGroup object.
These attributes are typically in XML form but can be
set programmatically

Attributes: ID
ID Attribute
A View element has an integer ID associated
with it, to uniquely identify the View within the
tree.
When the application is compiled, this ID is
referenced as an integer, but the ID is typically
assigned in the layout XML file as a string, in
the id attribute
android:id="my_own_id"
Syntax - @+id specifies that you ask the
Android system to generate an ID
android:id="@+id/my_button"
Page 26 of 82

Android Project
Android's Built-in Resource ID
Android framework comes with its own built-in
resources
When referencing an Android's built-in resource
in the layout resource file, you do not need the
plus-symbol, but must add the android package
namespace
android:id="@android:id/empty"
When referencing an Android's built-in resource
in the Java code, it is referenced throug
android.R.id.empty

How to reference views in Java code?


Assuming a view/widget is defined in the layout
file with a unique ID
<Button android:id="@+id/my_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_button_text"/>
Then you can make a reference to the View
element via findViewById(R.id.<string-id>).
// The value of R.id.my_button is defined in the
// mypackage.R.java
Button myButton = (Button) findViewById(R.id.my_button);

Attributes:
Layout Parameters
What Are Layout Parameters?
XML layout attributes named
layout_<something> define layout parameters

Page 27 of 82

Android Project
for the View that are appropriate for the ViewGroup in
which it resides
Parent view group defines layout parameters for each child view
(including the child view group)

Values of layout_width & layout_height


wrap_content
tells your view to size itself to the dimensions required by
its content
fill_parent
tells your view to become as big as its parent view group
will allow.
match_parent
Page 28 of 82

Android Project
Same as fill_parent
Introduced in API Level 8
<Button android:id="@+id/my_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/my_button_text"/>

layout_weight attribute
Is used in a LinearLayout to assign
"importance" to child Views within that layout.
All Views have a default layout_weight of zer
They take up only as much room on the screen as they need to
be displayed
Assigning a value higher than zero will split up the rest of
the available space in the parent View
<each View's layout_weight>/<total value of layout_weight of
all View's>
Layout Types
All layout types are subclass of ViewGroup class
Layout types
LinearLayout
RelativeLayout
TableLayout
Page 29 of 82

Android Project
FrameLayout
Tab layout

LinearLayout
Aligns all children in a single direction vertically or horizontally,
depending on how you define the orientation attribute.
All children are stacked one after the other, so a vertical
list will only have one child per row, no matter how wide
they are
A LinearLayout respects
margins between children
gravity (right, center, or left alignment) of each child.
weight to each child

Page 30 of 82

Android Project
LinearLayout organizes elements along a single line. You
specify whether that line is verticle or horizontal using
android:orientation. Here is a sample Layout XML using
LinearLayout.
RelativeLayout
RelativeLayout lets child views specify their position
relative to the parent view or to each other (specified by
ID)
You can align two elements by right border, or make one
below another, centered in the screen, centered left, and so
on
Elements are rendered in the order given
If the first element is centered in the screen, other
elements aligning themselves to that element will be
aligned relative to screen center.
RelativeLayout Example
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/blue"
android:padding="10px" >
<TextView android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:" />
<EditText android:id="@+id/entry"
Page 31 of 82

Android Project
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/label" />
<Button android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
android:layout_alignParentRight="true"
android:layout_marginLeft="10px"
android:text="OK" />
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok"
android:layout_alignTop="@id/ok"
android:text="Cancel" />
</RelativeLayout>

TableLayout
TableLayout positions its children into rows and
columns
TableRow objects are the child views of a
TableLayout
Page 32 of 82

Android Project
Each TableRow defines a single row in the table
Each row has zero or more cells, each of which is
defined by any kind of other View.
Columns can be
Hidden
Stretch and fill the available screen space
Shrinkable to force the column to shrink until the
table fits the screen.
TableLayout Example
<?xml version="1.0" encoding="utf-8"?>
<Tablelayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<TextView
android:text="@string/table_layout_4_open"
android:padding="3dip" />
<TextView
android:text="@string/table_layout_4_open_shortcut"
android:gravity="right"
android:padding="3dip" />
</TableRow>
<TableRow>
<TextView
android:text="@string/table_layout_4_save"
android:padding="3dip" />
<TextView
Page 33 of 82

Android Project
android:text="@string/table_layout_4_save_shortcut"
android:gravity="right"
android:padding="3dip" />
</TableRow>
</TableLayout>

FrameLayout
FrameLayout is the simplest type of layout
object. It's basically a blank space on your
screen that you can later fill with a single object
For example, a picture that you'll swap in and out.
All child elements of the FrameLayout are
pinned to the top left corner of the screen; you
cannot specify a different location for a child
view.
Subsequent child views will simply be drawn over
previous ones, partially or totally obscuring them
(unless the newer object is transparent).
FrameLayout Example
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/androi"
android:layout_width="match_parent"
android:layout_height="match_parent">
Page 34 of 82

Android Project
<TextView
android:text="yellowyellowyellow"
android:gravity="bottom"
android:background="#aaaa00"
android:layout_width="wrap_content"
android:layout_height="120dip"/>
<TextView
android:text="greengreengreen"
android:gravity="bottom"
android:background="#00aa00"
android:layout_width="wrap_content"
android:layout_height="90dip" />
<TextView
android:text="blueblueblue"
android:gravity="bottom"
android:background="#0000aa"
android:layout_width="wrap_content"
android:layout_height="60dip" />
<TextView
android:text="redredred"
android:gravity="bottom"
android:background="#aa0000"
android:layout_width="wrap_content"
android:layout_height="30dip"/>
</FrameLayout>

Page 35 of 82

Android Project

Tab Layout
A tab has
Tab indicator
Content
Tag
Tab indicator can be
Label or
Label and Icon
Tab content
View
Runtime creation via TabHost.TabContentFactory
Activity

Page 36 of 82

Android Project

Two Schemes of Creating Tab Content


Use the tabs to swap Views within the same
Activity - two sub-schemes
The view can be static
The view can be created during run-time
Use the tabs to change between entirely
separate activities
Use it when each tab triggers a distinct user activity
APIs - TabHost class
Container for a tabbed window view.
This object holds two children:
Page 37 of 82

Android Project
A set of tab labels that the user clicks to select a
specific tab.
FrameLayout object that displays the contents of
that page.
SOFTWARE DEVELOPMENT

ECLIPSE WITH EMULATOR

The Device Framework component is responsible for providing an


extensible platform to support mobile devices and their aggregate
services.
To define an extensible framework for a real device or emulator. The
design goal is to keep the device generic enough to accommodate
implementations using different technologies like: virtualization
servers, operating system, communication protocols and others. The
framework shall provide for ways to:
Page 38 of 82

Android Project

Support different launching parameters and configurations


Infrastructure for Eclipse control components to communicate
with devices executing in the real or emulated context

Provide Properties pages to define device configurations and


arguments, including arguments to be passed on to the device
system

Support launching of and connection to remote devices

The figure above shows the relevant components for the integration of
an emulator into Eclipse. The device or emulator type corresponds to
the emulator type; the states and operations describe the state machine
whereby the user controls the emulator from the Eclipse workbench;
the service definitions link the operations (or services) to the
device/emulator type; and the wizard is used to create instances of a
given device or emulator type.

Page 39 of 82

Android Project

Deployment framework
One vital part in mobile development is testing on real devices. To
make that as easy as possible the developer must have methods to
transfer mobile applications to handheld devices using local methods
(e.g. Bluetooth, USB, IrDA). The idea of MTJ is to develop a
framework that provides an API for vendor specific plug-ins, which
then do the actual deployment.

Page 40 of 82

Android Project

Camera Hardware and Application

The Camera class is used to set image capture settings, start/stop


preview, snap pictures, and retrieve frames for encoding for
video. This class is a client for the Camera service, which
manages the actual camera hardware.
Permission
<uses-permission
android:name="android.permission.CAMERA"
<uses-feature android:name="android.hardware.camera"
<uses-feature
android:name="android.hardware.camera.autofocus" />

/>
/>

Page 41 of 82

Android Project
he Android framework supports capturing images and video
through the Camera API or camera Intent. Here are the relevant
classes:
1-Camera:- This class is the primary API for controlling device
cameras. This class is used to take pictures or videos when you
are building a camera application.
2-SurfaceView:- This class is used to present a live camera
preview to the user.
3-MediaRecorder:- This class is used to record video from the
camera.
4-Intent:-An
intent
action
type
of MediaStore.ACTION_IMAGE_CAPTUREor MediaStore.A
CTION_VIDEO_CAPTURE can be used to capture images or
videos without directly using the Camera object.
Using Existing Camera Apps
First Step-Compose a Camera Intent - Create an Intent that
requests an image or video, using one of these intent
types:MediaStore.ACTION_IMAGE_CAPTURE - Intent
action type for requesting an image from an existing
camera application.
MediaStore.ACTION_VIDEO_CAPTURE - Intent action type
for requesting a video from an existing camera application
Second
Step-Start
the
Camera
Intent Use
the startActivityForResult() method to execute the camera
intent. After you start the intent, the Camera application
user interface appears on the device screen and the user
can take a picture or video.

Page 42 of 82

Android Project
Third Step-Receive the Intent Result - Set up
an onActivityResult() method in your application to
receive the callback and data from the camera intent.
When the user finishes taking a picture or video (or
cancels the operation), the system calls this method

Image capture intent


Capturing images using a camera intent is quick way to enable
your application to take pictures with minimal coding. An image
capture intent can include the following extra information:
MediaStore.EXTRA_OUTPUT - This setting requires a Uri object
specifying a path and file name where you'd like to save the picture.
This setting is optional but strongly recommended. If you do not
specify this value, the camera application saves the requested picture
in the default location with a default name, specified in the returned
intent's Intent.getData() field

Page 43 of 82

Android Project

private static final int CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE = 100;


Private Uri fileUri;

@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main); // create Intent to take a picture
and
return
control
to
the
calling
application
Intent
intent
=
new
Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
//create a file to save the image
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set
the
image
file
name
startActivityForResult(intent,
CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}

Page 44 of 82

Android Project
When the startActivityForResult() method is executed, users
see a camera application interface. After the user finishes taking
a picture (or cancels the operation), the user interface returns to
your application, and you must intercept the onActivityResult()
method to receive the result of the intent and continue your
application execution. For information on how to receive the
completed intent, see Receiving camera intent result.
Video capture intent
MediaStore.EXTRA_OUTPUT- This setting requires a Uri
specifying a path and file name where you'd like to save the
video. This setting is optional but strongly recommended. If you
do not specify this value, the Camera application saves the
requested video in the default location with a default
name,specified in the returned intent's Intent.getData() field.
MediaStore.EXTRA_VIDEO_QUALITY- This value can be 0
for lowest quality and smallest file size or 1 for highest quality
and larger file size.
MediaStore.EXTRA_DURATION_LIMIT - Set this value to
limit the length, in seconds, of the video being captured.
MediaStore.EXTRA_SIZE_LIMIT- Set this value to limit the
file size, in bytes, of the video being captured.
Private static final
intCAPTURE_VIDEO_ACTIVITY_REQUEST_CODE=200;
privateUrifileUri;
@Override
public
void
onCreate(Bundle
savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);//create
new
Intent
Intent
intent
=
new
Page 45 of 82

Android Project
Intent(MediaStore.ACTION_VIDEO_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
//create
a
file
to
save
the
video
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set
the
image
file
name
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); //
set the video image quality to high// start the Video Capture
Intent
startActivityForResult(intent,
CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);
}
Building a Camera App
Detect and Access Camera - Create code to check for the
existence of cameras and request access.
Create a Preview Class - Create a camera preview class that
extends SurfaceView and
implements
the SurfaceHolder
interface. This class previews the live images from the camera.
Build a Preview Layout - Once you have the camera preview
class, create a view layout that incorporates the preview and the
user interface controls you want.
Setup Listeners for Capture - Connect listeners for your
interface controls to start image or video capture in response to
user actions, such as pressing a button.
Capture and Save Files - Setup the code for capturing pictures
or videos and saving the output.
Release the Camera - After using the camera, your application
must properly release it for use by other applications.

Page 46 of 82

Android Project
Checking camera features
Once you obtain access to a camera, you can get further
information
about
its
capabilities
using
the Camera.getParameters() method and checking the
returnedCamera.Parameters object for supported capabilities.
When
using
API
Level
9
or
higher,
use
the Camera.getCameraInfo() to determine if a camera is on the
front or back of the device, and the orientation of the image
Creating a preview class
For users to effectively take pictures or video, they must be able
to see what the device camera sees. A camera preview class is
a SurfaceView that can display the live image data coming from
a camera, so users can frame and capture a picture or video.
The following example code demonstrates how to create a basic
camera preview class that can be included in a View layout.
This class implements SurfaceHolder.Callback in order to
capture the callback events for creating and destroying the view,
which are needed for assigning the camera preview input.

Placing preview in a layout


A camera preview class, such as the example shown in the
previous section, must be placed in the layout of an activity
along with other user interface controls for taking a picture or
video. This section shows you how to build a basic layout and
activity for the preview.

Page 47 of 82

Android Project
The Camera class uses different callback interface to report
different events to the application. The following callback
interfaces are used to notify the events Camera.AutoFocusCallback

Camera.ErrorCallback

Camera.PictureCallback

Camera.PreviewCallback

Camera.ShutterCallback

To take pictures with this class, use the following steps:


1.Obtain an instance of Camera from open(int).
2.Get existing (default) settings with getParameters().
3.Ifnecessary, modify the returned Camera.Parameters object
and
call setParameters(Camera.Parameters).
If
desired,
call setDisplayOrientation(int).
4.Important:Passafullyinitialized SurfaceHolder to setPreviewDi
splay(SurfaceHolder). Without a surface, the camera will be
unable to start the preview.

1-Important: Call startPreview() to start updating the preview


surface. Preview must be started before you can take a picture.
2-When you want, call takePicture(Camera.ShutterCallback,
Camera.PictureCallback,Camera.PictureCallback,
Camera.PictureCallback) to capture a photo. Wait for the
callbacks to provide the actual image data.
Page 48 of 82

Android Project
3-After taking a picture, preview display will have stopped. To
take more photos, call startPreview() again first.
4-Call stopPreview() to stop updating the preview surface.
5-Important: Call release() to release the camera for use by other
applications. Applications should release the camera
immediately in onPause() (and re-open() it in onResume()).

View
This class represents the basic building block for user interface
components. A View occupies a rectangular area on the screen
and is responsible for drawing and event handling. View is the
base class for widgets, which are used to create interactive UI
components (buttons, text fields, etc.). The ViewGroup subclass
is the base class for layouts, which are invisible containers that
hold other Views (or other ViewGroups) and define their layout
properties.
All of the views in a window are arranged in a single tree. You
can add views either from code or by specifying a tree of views
in one or more XML layout files. There are many specialized
subclasses of views that act as controls or are capable of
displaying text, images, or other content.

Widgets
TextView
EditText
Button
Page 49 of 82

Android Project
ImageView
ImageButton
Spinner
List
Property Of Widgets
ID
Position
Size
Padding
Margin
Layout
EventHandling And Threading
Focus
TouchMode
Scrolling
Animation
Security

TextView
The simplest widget is the label, referred to in Android as a
TextView. Like in most GUI toolkits, labels are bits of text not
editable directly by users
Page 50 of 82

Android Project
TextView control usage would be to display textual labels for
other controls, like Enter a Date:, Enter a Name: or Enter a
Password:.
AutoText
If set (true), finds and corrects simple spelling errors in the text.
Editable
If set (true), indicates that the program has defined an input method
to receive input text (default is false for TextView
RELEASE PROCESS

Animation
There are two ways to create animations via XML
declaration or in a Java class. Were going to focus on
Page 51 of 82

Android Project

XML declaration if youre interested in java based


declaration take a look at the Android JavaDocs and the
subclasses ofandroid.view.animation.Animation.
Android supports two types of animations: Tweened
Animations and Frame-by-frame animations.
Tweened animations are applied to Views and transform
them in size, position or opacity. For example you can
fade in a view or rotate him.
Frame-by-frame animations shows different drawables in
a View. Both animations are limited to the original size
of the view.
Tweened Animations
Tweened animations are instances of the Animation abstract
class. You have pre-defined Animations via the Java classes
AlphaAnimation
RotateAnimation
ScaleAnimation
TranslateAnimation.
Animations can be defined via XMl resource files in the
directory "res/anim" or via code. You can load the resource
filevia AnimationUtils.loadAnimiation(this,R.anim.Animation).
Per default the animation will have the same speed in getting
applied. You can change this via an "Interpolator" class. This
class can control the speed of the animation. You have several
default
classes,
e.g.
AccelerateInterpolator,
DecelerateInterpolator, LinearInterpolator, BounceInterpolator,
Page 52 of 82

Android Project
OvershootInterpolator and CycleInterpolator. For example the
BounceInterpolator gives an bouncing effect once the animation
is almost over. Please check the Javadoc for the rest of the
Interpolator classes

Tweened animations.
Alpha Animation
Alpha animations allows us to create fade-in/fade-out effects
All animations are stored in res/anim so we create a new xml
file named alpha.xml there.
An animation that controls the alpha level of an object. Useful
for fading things in and out. This animation ends up changing
the alpha property of a Transformation.
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android=http://schemas.android.com/apk/res/android

android:fromAlpha="0.0"

android:toAlpha="0.9"

android:duration="4000" />
fromAlphaStarting alpha value for the animation, where 1.0 means fully opaque and
0.0 means fully transparent.
Page 53 of 82

Android Project

toAlphaEnding alpha value for the animation.


Rotate Animation
An animation that controls the rotation of an object. This
rotation takes place int the X-Y plane. You can specify the point
to use for the center of the rotation, where (0,0) is the top left
point. If not specified, (0,0) is the default rotation point
<?xml version="1.0" encoding="utf-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:toYScale="0.0"
android:pivotX="40%"
android:pivotY="30%"

android:duration="4000" />

fromDegreesRotation
o offset to apply at the start of the animation.
toDegreesRotation
o offset to apply at the end of the animation.
pivotX
Page 54 of 82

Android Project
o The X coordinate of the point about which the
object is
being rotated, specified as an absolute number where 0 is
the left edge.
pivotYo The Y coordinate of the point about which the object is
being rotated, specified as an absolute number where 0 is
the top edge.
Translate Animation
TranslateAnimation Lets you move the selected View around the
screen (although it will only be drawn within its original
bounds).
<translate
xmlns:android="http://schemas.android.com/apk/res/androi"
android:fromXDelta="200%"
android:toXDelta="0%"
android:fromYDelta="200%"
android:toYDelta="0%"
android:duration="3000"
android:zAdjustment="top" />

fromXDelta
Change in X coordinate to apply at the start of the
animation.
toXDelta

Page 55 of 82

Android Project
Change in X coordinate to apply at the end of the
animation.
fromYDelta
Change in Y coordinate to apply at the start of the
animation to.

Ydelta
Change in Y coordinate to apply at the end of the
animation .
Scale Animation
ScaleAnimation Allows you to zoom in to or out from the
selected View.
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="4"
android:toXScale="1"
android:fromYScale="3"
android:toYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:duration="4000" />
fromX
Horizontal scaling factor to apply at the start of the animation
toX

Page 56 of 82

Android Project
Horizontal scaling factor to apply at the end of the

animation

QUIZ APPLICATION
INTRODUCTION--We are Quizter, a project created to make learning fun. Our vision was to create
a cross-platform application that combines elements such as gaming, quizzing
and competition based on content that the user is interested to learn. The
application should give users an easy way to repeat curriculum, learn about new
topics and work as a place to look for references and tips. The application
should be easy to use and pause making it easy to work with at any time in
any place.

Overview--In this report, we will present the application called Crack Qizzed. At first, we
will present the theoretical concepts relevant to the learning in technological
environment. Later, the functionality and visual layout of the application are
explained and argued. The findings from the project are being analyzed using
the knowledge we acquired during the development of the application.

Background--The motivation behind the project was in the interest towards


enhancing the experience of learning by using mobile technology as a
medium.

Project Goals
The goal of the project was to have a functional running prototype of the application and
fulfil the requirements of the course.

Our application specific goals were:

Have to revise the main concept of java.


Have to revise the main concept of HTML 5.
Page 57 of 82

Android Project

Have to revise the main concept of Php.

Words and concepts--Here are the words and concepts that are not familiar to the reader, or which
might produce confusions with their special use. The assumption is
that the readers are familiar with mobile applications and operating systems.
In addition, the notation used in the document can be defined in this section.
The example of this is shown in table.
Table 1 Notation used in the document.

Quiz
Quiz modes

--

Informal, game-like test

-- Similar to a game mode, examples include singleplayer..

APPROACH-Aims

Create a new aspect for learning school curriculum

Develop a prototype quiz app for students in 8th-10th grade

Increase the students motivation to learn by making it fun

Objectives
This project is connected with the course Android - Development of mobile
information systems and services at the AL-FALAH UNIVERSITY. Our
project started in March 2016 and will finish in April 2016.
As mentioned in our aims our goal was to create a new aspect for learning
school curriculum through, and increase the students motivation through
mobile technology.
During this period we will develop a cross platform prototype for this quiz app,
named Quiz app. The prototype will be developed in the software ECLIPSE
MARS 1. .

Page 58 of 82

Android Project

Making a project-----In eclipse we are going to making a project and thats named is Crack Quizzed and
screenshort is givin below..

Screen short--Step 1-

Step 2-

Page 59 of 82

Android Project

Step 3-

Page 60 of 82

Android Project
Step 4

Step 5--

Programming--Page 61 of 82

Android Project

Java fileMain Activitypackage com.exam.crackquizzed;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class MainActivity extends Activity {

ImageButton img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main)
img = (ImageButton) findViewById(R.id.imageButton1);
img.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent k = new Intent(MainActivity.this,Start.class);
startActivity(k);
}
});
Page 62 of 82

Android Project
}

XML file<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"


android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/back">
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="220dp"
android:src="@drawable/qui" />
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="65dp"
android:src="@drawable/str" />
</LinearLayout>

Content ActivityPage 63 of 82

Android Project

Java file
package com.exam.crackquizzed;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class Content extends Activity {


ImageButton btn1,btn2,btn3,btn4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_content);
btn1 = (ImageButton) findViewById(R.id.button1);
btn2 = (ImageButton) findViewById(R.id.button2);
btn3 = (ImageButton) findViewById(R.id.button3);
btn4 = (ImageButton) findViewById(R.id.button4);

btn1.setOnClickListener(new OnClickListener() {

Page 64 of 82

Android Project
@Override
public void onClick(View v) {
Intent n= new Intent(Content.this,Java1.class);
startActivity(n);

}
});

btn2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent n= new Intent(Content.this,Html1.class);
startActivity(n);

}
});

btn3.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent n= new Intent(Content.this,Php1.class);
startActivity(n);
Page 65 of 82

Android Project
}
});
btn4.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent n= new Intent(Content.this,Andr1.class);
startActivity(n);
}

});

}
}

XML file<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"

Page 66 of 82

Android Project
android:orientation="horizontal" >

<ImageButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/java"
android:layout_weight="1.0"
/>

<ImageButton
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/html"
android:layout_weight="1.0"
/>

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0"
Page 67 of 82

Android Project
android:orientation="horizontal" >

<ImageButton
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/php"
android:layout_weight="1.0"
/>

<ImageButton
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/and"
android:layout_weight="1.0"
/>

</LinearLayout>
</LinearLayout>

Question Code--Java file-Page 68 of 82

Android Project
package com.exam.crackquizzed;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.Toast;

public class Andr1 extends Activity {


RadioButton b1,b2,b3,b4;
Button Back,Answer,Next;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_andr1);
b1=(RadioButton) findViewById(R.id.radio0);
b2=(RadioButton) findViewById(R.id.radio1);
b3=(RadioButton) findViewById(R.id.radio2);
b4=(RadioButton) findViewById(R.id.radio3);
Back = (Button) findViewById(R.id.button1);
Page 69 of 82

Android Project
Answer = (Button) findViewById(R.id.button2);
Next = (Button) findViewById(R.id.button3);

Back.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
//
Intent n= new Intent(Andr1.this,Content.class);
startActivity(n);
}
});
Answer.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(getBaseContext(), "All of these are
components of the APK " , Toast.LENGTH_SHORT).show();

}
});
Next.setOnClickListener(new OnClickListener() {

@Override
Page 70 of 82

Android Project
public void onClick(View v) {
// TODO Auto-generated method stub
Intent n= new Intent(Andr1.this,Andr2.class);
startActivity(n);
}
});
}

public void fun(View v){


boolean checked =((RadioButton) v).isChecked();
switch (v.getId()) {
case R.id.radio0:
if(checked){
b1.setEnabled(false);
b3.setEnabled(false);
b4.setEnabled(false);
b2.setBackgroundColor(Color.GREEN);
b1.setBackgroundColor(Color.RED);
b2.setEnabled(true);
}
else{
b1.setEnabled(false);
}
break;
Page 71 of 82

Android Project
case R.id.radio1:
if(checked){
b2.setBackgroundColor(Color.GREEN);
b1.setEnabled(false);
b3.setEnabled(false);
b2.setBackgroundColor(Color.GREEN);
b2.setEnabled(true);
}
else{
b2.setEnabled(false);
}
break;
case R.id.radio2:
if(checked){
b1.setEnabled(false);
b2.setBackgroundColor(Color.GREEN);
b4.setEnabled(false);
b3.setBackgroundColor(Color.RED);
b3.setEnabled(true);
}
else{
b3.setEnabled(false);
}
break;
Page 72 of 82

Android Project
case R.id.radio3:
if(checked){
b1.setEnabled(false);
b3.setEnabled(false);
b2.setBackgroundColor(Color.GREEN);
b4.setBackgroundColor(Color.RED);
b4.setEnabled(true);
}
else{
b4.setEnabled(false);
}
break;
}

}
}

XML File-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"


xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Page 73 of 82

Android Project
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/back"
tools:context="com.example.successquizapp.Gk1Activity" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="1.Which of the following are not a component of an APK
file?"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignLeft="@+id/textView1"
android:layout_alignParentBottom="true"
android:layout_marginBottom="59dp"
android:background="@drawable/num_back"
android:text="Back" />

Page 74 of 82

Android Project
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_centerHorizontal="true"
android:background="@drawable/enter_back"
android:text="Answer" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/button1"
android:background="@drawable/num_back"
android:text="Next" />

<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
Page 75 of 82

Android Project
android:layout_marginTop="14dp" >

<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignTop="@+id/radioGroup1"
android:layout_marginTop="20dp"
android:onClick="fun"
android:text="Resources"
android:textSize="20dp" />

<RadioButton
android:id="@+id/radio1"
android:layout_width="209dp"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/radio3"
android:layout_below="@+id/radio3"
android:onClick="fun"
android:text="All of these are components of the APK "
android:textSize="20dp" /
<RadioButton
android:id="@+id/radio2"
Page 76 of 82

Android Project
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/radio0"
android:layout_below="@+id/radio0"
android:onClick="fun"
android:text="Native Libraries"
android:textSize="20dp" />

<RadioButton
android:id="@+id/radio3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/radio2"
android:layout_below="@+id/radio2"
android:onClick="fun"
android:text="Dalvik executable"
android:textSize="20dp" />
</RadioGroup>
</RelativeLayout>

Screen Shorts of running app


Step 1-

Page 77 of 82

Android Project

Step 2-

Page 78 of 82

Android Project

Step 3-

Step4--

Page 79 of 82

Android Project

Step5-

Step6--

Page 80 of 82

Android Project

********************************************
*

Page 81 of 82

You might also like