[go: up one dir, main page]

0% found this document useful (0 votes)
29 views25 pages

Android Development

The document provides an overview of Android development, focusing on the Android SDK, AVD Manager, Eclipse IDE, resources, APK files, and the build process. It explains how applications are developed using Java, the role of resources in localization and device configuration, and the importance of the R class and assets. Additionally, it covers debugging tools like the Dalvik Debug Monitor Server and Android Debug Bridge, as well as logging mechanisms in Android applications.

Uploaded by

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

Android Development

The document provides an overview of Android development, focusing on the Android SDK, AVD Manager, Eclipse IDE, resources, APK files, and the build process. It explains how applications are developed using Java, the role of resources in localization and device configuration, and the importance of the R class and assets. Additionally, it covers debugging tools like the Dalvik Debug Monitor Server and Android Debug Bridge, as well as logging mechanisms in Android applications.

Uploaded by

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

ANDROID DEVELOPMENT

THE ANDROID SDK


 A Software development kit that enables
developers to create applications for the
Android Platform.
 The Android SDK includes sample projects

with source code, development tools, an


emulator and required libraries to build
Android applications.
 Applications are written using the Java

programming language and run on Dalvik a


custom virtual machine designed for
embedded use which runs on top of a Linux
kernel.
THE SDK AND AVD MANAGERS
 An Android Virtual Device (AVD) is a device
configuration that is run with the Android
Emulator. It works with the emulator to
provide a virtual device specific environment
in which to install and run Android apps.
 The Android SDK provides the AVD Manager

tool for creating and managing AVDs. You can


run this tool directly or run SDK Manager and
select Manage AVDs from the Tools menu.
CONFIGURING THE EMULATOR
 Please Refer PDF file for details.
ECLIPSE
 Eclipse is an integrated development
environment (IDE). It contains a base
workspace and an extensible plugin system
for customizing the environment.
 Written mostly in Java, Eclipse can be used to

develop applications. By means of various


plug-ins, Eclipse may also be used to develop
applications in other programming
language : C, C++, Perl, PHP etc.
 Development environments include the

Eclipse Java development tools (JDT) for java.


ECLIPSE
 The Eclipse software development kit (SDK),
which includes the Java development tools, is
meant for Java developers.
 Users can extend its abilities by installing

plug-ins written for the Eclipse Platform, such


as development toolkits for other
programming languages and can write and
contribute their own plug-in modules.
 Released under terms of the Eclipse Public

License, Eclipse SDK is free and open source


software.
RESOURCES
 An Android application is seldom just source
code. There are often many other files that
make up an application: video, images, and
audio files just to name a few. Collectively,
these non-source code files are referred to as
resources and are compiled (along with the
source code) during the build process and
packaged as an APK for distribution and
installation onto devices:
RESOURCES
 Resources offer several advantages to an
Android application:
 Code-Separation - Separates source code

from images, strings, menus, animations,


colors, etc. As such resources can help
considerably when localizing.
 Target multiple devices – Provides simpler

support of different device configurations


without code changes.
 These resources are called Default

Resources and are used by all devices unless


a more specific match is specified.
RESOURCES
 Additionally, every type of resource may
optionally have Alternate Resources that
Android may use to target specific devices.
For example, resources may be provided to
target the user’s locale, the screen size, or if
the device is rotated 90 degrees from portrait
to landscape, etc. In each of these cases,
Android will load the resources for use by the
application without any extra coding effort by
the developer.
 Alternate resources are specified by adding a

short string, called a qualifier, to the end of


the directory holding a given type of
resources.
RESOURCES
 For example, resources/drawable-de will specify
the images for devices that are set to a German
locale, while resources/drawable-fr would hold
images for devices set to a French locale.
 Android Resource Basics - Using default

resources programmatically and declaratively,


adding resource types such as images to an
application.
 Device Specific Configurations - Supporting

the different screen resolutions and densities in


an application.
 Localization – Using resources to support the

different regions an application may be used.


APK FILES
 Just like Windows PC systems use a .exe file
for installing software, Android does the
same. Android application package (APK) is
the package file format used to distribute
and install application software and
middleware onto Google's Android operating
system.
 APK files are a type of archive file,

specifically in zip format packages based on


the JAR file format, with .apk as the filename
extension.
APK FILES
 There are many sources of APK files across
the web, but be sure to choose a site which
you trust. Some APK files may contain
malicious software (malware) which could
compromise your phones security, so it is
best to be cautious before downloading or
installing any app from outside of the Play
Store.
BUILD PROCESS
 The Android build process provides project
and module build settings so that your
Android modules are compiled and packaged
into .apk files.
 The apk file for each app contains all of the

information necessary to run your application


on a device or emulator, such as
compiled .dex files (.class files converted to
Dalvik byte code), a binary version of
the AndroidManifest.xml file and uncompiled
resource files for your application.
BUILD PROCESS
 To run an application on an emulator or
device, the application must be signed using
debug or release mode.
 You typically want to sign your application in

debug mode when you develop and test your


application, because the build system uses a
debug key with a known password so you do
not have to enter it every time you build.
When you are ready to release the
application to Google Play, you must sign the
application in release mode, using your own
private key.
BUILD PROCESS
THE R CLASS
 R.java is the dynamically generated class,
created during build process to dynamically
identify all assets (from strings to android
widgets to layouts), for usage in java classes
in Android app. Note this R.java is Android
specific.
 R is a class that contains ONLY public

constants. (public static final).


 R is structured in such a way that you can

refer to resources via its inner classes. For


example, R.id contains id constants
and R.layout contains layout constants
THE R CLASS
 When your application is compiled, AAPT
generates the R class, which contains
resource IDs for all the resources in your res/
directory. For each type of resource, there is
an R subclass (for example, R.drawable for all
drawable resources) and for each resource of
that type, there is a static integer (for
example, R.drawable.icon). This integer is the
resource ID that you can use to retrieve your
resource.
ASSETS
 Assets provide a way to include arbitrary files
like text, xml, fonts, music, and video in your
application. If you try to include these files as
"resources", Android will process them into
its resource system and you will not be able
to get the raw data. If you want to access
data untouched, Assets are one way to do it.
 Assets added to your project will show up just

like a file system that can read from by your


application using AssetManager.
THE DALVIK DEBUG MONITOR SERVER
 The Dalvik Debug Monitor Service (DDMS) is
a debugging tool used in the Android
platform. The Dalvik Debug Monitor Service
is downloaded as part of the Android SDK.
Some of the services provided by the DDMS
are port forwarding, on-device screen
capture, on-device thread and heap
monitoring, and radio state information.
 The Dalvik Debug Monitor Service allows

developers to spot bugs in applications


running on either an emulator or an actual
Android device.
THE ANDROID DEBUGGER (ADB)
 Android Debug Bridge (adb) is a versatile
command line tool that lets you
communicate with an emulator instance or
connected Android-powered device.
 ADB can control your device over USB from a

computer, copy files back and forth, install


and uninstall apps, run shell commands, and
more.
 To test whether ADB is working properly,

connect your Android device to your


computer using a USB cable and run the
following command:
THE ANDROID DEBUGGER (ADB)
 adb devices

 You should see a device in the list. If your


device is connected but nothing appears in
the list, you’ll need to install the appropriate
drivers.
THE ANDROID LOG AND LOGCAT
 One very common trick developers use to
debug their applications is using
Console.WriteLine. However, on a mobile
platform like Android there is no console.
Android devices provides a log that you will
likely need to utilize while writing apps. This
is sometimes referred to as "logcat" due to
the command typed to retrieve it.
 The Android system has a logging facility

that allows system wide logging of


information, from applications and system
components.
THE ANDROID LOG AND LOGCAT
 Application log : An Android application
includes the android.util.Log class, and uses
methods of this class to write messages of
different priority into the log.
 Event log : Event logs messages are created

using android.util.EventLog class, which


create binary-formatted log messages. Log
entries consist of binary tag codes, followed
by binary parameters.
THE ANDROID LOG AND LOGCAT
 System log : Many classes in the Android
framework utilize the system log to keep
their messages separate from (possibly
noisy) application log messages. These
programs use the android.util.Slog class, with
its associated messages.
 In all cases, eventually a formatted message

is delivered through the C/C++ library down


to the kernel driver, which stores the
message in the appropriate buffer.
Thank You

You might also like