Beruflich Dokumente
Kultur Dokumente
Version#1
Dated: 01/07
Bangalore
12/17/2019 1
Android Introduction
• Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The Android SDK provides the tools and APIs
necessary to begin developing applications on the Android platform using the Java
programming language.
• Android is a mobile operating system initially developed by Android Inc.
• Android was bought by Google in 2005.
• Android is based upon a modified version of the Linux kernel.
• Google and other members of the Open Handset Alliance collaborated to develop
and release Android to the world.
• There are currently over 200,000 apps available for Android.
• Android Market is the online app store run by Google, though apps can be
downloaded from third party sites (except on AT&T, which disallows this).
• 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 the Java programming language.
Features:
• Application framework enabling reuse and replacement of components
• Dalvik virtual machine optimized for mobile devices
• Integrated browser based on the open source WebKit engine
• Optimized graphics powered by a custom 2D graphics library; 3D graphics based
on the OpenGL ES 1.0 specification (hardware acceleration optional)
• SQLite for structured data storage
• Media support for common audio, video, and still image formats (MPEG4, H.264,
MP3, AAC, AMR, JPG, PNG, GIF)
• GSM Telephony (hardware dependent)
• Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
• Camera, GPS, compass, and accelerometer (hardware dependent)
• Rich development environment including a device emulator, tools for debugging,
memory and performance profiling, and a plugin for the Eclipse IDE
• 1.6 (Donut) :
Based on Linux Kernel 2.6.29 On 15 September 2009, the 1.6 (Donut) SDK was
released.
Included in the update were:
o An improved Android Market experience
o An integrated camera, camcorder, and gallery interface
o Gallery now enables users to select multiple photos for deletion
o Updated Voice Search, with faster response and deeper integration with native
applications, including the ability to dial contacts
o Updated search experience to allow searching bookmarks, history, contacts,
and the web from the home screen
o Updated technology support for CDMA/EVDO, 802.1x, VPNs, and a text-to-
speech engine
o Support for WVGA screen resolutions
o Speed improvements in searching and camera applications
o Gesture framework and GestureBuilder development tool
o Google free turn-by-turn navigation
• Android Development Tools Plugin : (for the Eclipse IDE) The ADT plugin adds
powerful extensions to the Eclipse integrated environment, making creating and
debugging your Android applications easier and faster. If you use Eclipse, the ADT
plugin gives you an incredible boost in developing Android applications.
• Android Emulator :A QEMU-based device-emulation tool that you can use to
design, debug, and test your applications in an actual Android run-time
environment.
• Android Virtual Devices :(AVDs) Virtual device configurations that you create, to
model device characteristics in the Android Emulator. In each configuration, you
can specify the Android platform to run, the hardware options, and the emulator
skin to use. Each AVD functions as an independent device with it's own storage for
user data, SD card, and so on.
• Hierarchy Viewer :The Hierarchy Viewer tool allows you to debug and optimize
your user interface. It provides a visual representation of your layout's hierarchy of
Views and a magnified inspector of the current display with a pixel grid, so you can
get your layout just right.
• layoutopt :This tool lets you quickly analyze your application's layouts for
efficiency.
• Draw 9-patch :The Draw 9-patch tool allows you to easily create a NinePatch
graphic using a WYSIWYG editor. It also previews stretched versions of the image,
and highlights the area in which content is allowed.
• Dalvik Debug Monitor Service :(ddms) Integrated with Dalvik, the Android
platform's custom VM, this tool lets you manage processes on an emulator or
device and assists in debugging. You can use it to kill processes, select a specific
process to debug, generate trace data, view heap and thread information, take
screenshots of the emulator or device, and more.
• Android Debug Bridge :(adb) appThe adb tool lets you install your application's
.apk files on an emulator or device and access the emulator or device from a
command line. You can also use it to link a standard debugger to lication code
running on an Android emulator or device. This is located in <sdk>/platform-tools/.
• Android Asset Packaging Tool: (aapt) The aapt tool lets you create .apk files
containing the binaries and resources of Android applications.
• Android Interface Description Language :(aidl) Lets you generate code for an
interprocess interface, such as what a service might use.
• Sqlite3: Included as a convenience, this tool lets you access the SQLite data files
created and used by Android applications.
• Traceview: This tool produces graphical analysis views of trace log data that you
can generate from your Android application.
• Mksdcard: Helps you create a disk image that you can use with the emulator, to
simulate the presence of an external storage card (such as an SD card).
• Dx: The dx tool rewrites .class bytecode into Android bytecode (stored in .dex files.)
Four fundamental concepts in the Android system that are helpful for you to understand
are:
o Applications
o Activities
o Activity Stack
o Tasks
Examples of applications and the activities they might contain:
o Email - activities to view folders, view list of messages, view a message, compose
a message, and set up an account.
o Calendar - activities to view day, view week, view month, view agenda, edit an
event, edit preferences, and view an alert
o Camera - activities for running the camera, viewing the list of pictures, viewing a
picture, cropping a picture, running the camcorder, viewing the list of movies, and
viewing a movie
o Game - one activity to play the game, typically another for setup
o Maps - one activity to view a location on a map, a second for lists (such as turn list
or friend list), and a third for details (friend location, status, photo).
Activity Stack:
As the user moves from activity to activity, across applications, the Android system
keeps a linear navigation history of activities the user has visited. This is the activity
stack, also known as the back stack.
Task:
A task is the sequence of activities the user follows to accomplish an objective,
regardless of which applications the activities belong to
o Send a text message with an attachment
o View a YouTube video and share it by email with someone else
Re-using an Activity:
When activity A starts activity B in a different application, activity B is said to be reused.
• Contacts Re-Uses Gallery to Get a Picture - The Contacts activity has a field for a picture
of a contact, but the Gallery is normally where pictures are kept. So Contacts can re-use the
Gallery activity to get a picture. Notice the Gallery returns a picture to the Contacts
application that started it.
• Gallery Re-Uses Messaging for Sharing a Picture - Sharing is another good example of
one application re-using an activity from a different application. User starts Gallery, picks a
picture to view, chooses MENU > Share, and picks "Messaging". This starts the Messaging
activity, creates a new message and attaches the original picture to it. The user then fills in
the "To" field, writes a short message and sends it. User focus remains in the Messaging
program. If the user wants to go back to the Gallery, they must press the BACK key. In
contrast to the previous example, this re-use of the Messaging activity does not return
anything to the Gallery activity that started it.
1. On the device go to Settings => Applications and select the check box next to
“Unknown Sources” (Allow installation of non-Market applications).
2. On the device go to Settings => Applications => Development and select the
check box next to “USB Debugging” (Debug mode when USB is connected).
3. Connect the Android Device to your PC.
4. Install the USB driver (either using OEM Sync software or using Android AVD
Manager)
5. Go to Android SDK Tools directory (C:\android-sdk-windows-1.6_r1\tools)
6. Copy the .apk files in to the Android tools directory
7. Open the command prompt & locate the Android tools path
8. Check whether the Android device is recognized by the system or not by entering
the command: adb devices
9. Type the command: adb install <.apk file name>
o Enter a Project Name. This will be the name of the folder where your
project is created.
o Under Contents, select Create new project in workspace. Select your
project workspace location.
o Under Target, select an Android target to be used as the project's Build
Target. The Build Target specifies which Android platform you'd like your
application built against.
4. Creating an AVD
5. Running the application on emulator.
6. Creating a Run Configuration (select Run > Run Configurations (or Debug
Configurations)
1. Create an AVD
2. Create a Run Configuration (select Run > Run Configurations (or
Debug Configurations).
3. Go to Android SDK Tools directory (C:\android-sdk-windows-
1.6_r1\tools)
4. Copy the .apk files in to the Android tools directory
5. Open the command prompt & locate the Android tools path
6. Check whether the Android device is recognized by the system or
not by entering the command: adb devices
7. Type the command: adb install <.apk file name>
• If you use Eclipse, the ADT plug-in gives you an incredible boost in developing
Android applications:
• It gives you access to other Android development tools from inside the Eclipse IDE.
For example, ADT lets you access the many capabilities of the DDMS tool: take
screenshots, manage port-forwarding, set breakpoints, and view thread and
process information directly from Eclipse.
• It provides a New Project Wizard, which helps you quickly create and set up all of
the basic files you'll need for a new Android application.
• It automates and simplifies the process of building your Android application.
• It provides an Android code editor that helps you write valid XML for your Android
manifest and resource files.
• It will even export your project into a signed APK, which can be distributed to users.
Monkey Tool:
The Monkey is a command-line tool that you can run on any emulator instance or
on a device. It sends a pseudo-random stream of user events into the system,
which acts as a stress test on the application software we are developing.
The Monkey is a program that runs on your emulator or device and generates
pseudo-random streams of user events such as clicks, touches, or gestures, as
well as a number of system-level events. You can use the Monkey to stress-test
applications that you are developing, in a random yet repeatable manner.
Set up:
• Android sdk should be installed and Set the path for android sdk.
• Eg: Export PATH=/home/partha/Desktop/android-sdk-linux_x86-1.5_r2/android-
sdk-linux_x86-1.5_r2/tools:$PATH
How to find the packages installed path for the application on your device:
• Once the device is connected, Open the Eclipse Platform.
• Go to Window >> Show View >> Other >> File Explore >> Ok.
• From File Explore, select >> System >> App
• Now we can see the entire “packages installed” path for the application.
• From this, copy the path of the specific application and use it in the command.
Advantages:
1. The Monkey is a command-line tool that can run on any emulator instance or on a
device which can user for stress testing on the Application software.
2. If the application crashes or receives any sort of unhandled exception, the Monkey
will stop and report the error.
3. If the application generates an application not responding error, the Monkey will stop
and report the error.
4. Monkey tool can be launch by using a command line on your development machine
or from a script.
5. Using Monkey tool we can set Number of events to attempt.
6. Debugging Options avaliable with monkey tool.
7. Straight-up failures such as crashes, assertion failures, and memory leaks are easy
to detect.
8. Monkey enhances software security and software safety because it often finds odd
oversights and defects which human testers would fail to find, and even careful
human test designers would fail to create tests for.
Disadvantages:
1. In monkey tool there are some Operational constraints, such as restricting the test
to a single package.
2. Monkey have poor code coverage; for example, if the input includes a checksum
which is not properly updated to match other random changes, only the checksum
validation code will be verified.
3. Main disadvantage is the cost of developing the monkey, and a limited range of
testing.
More Information:
Refer http://developer.android.com/guide/developing/tools/monkey.html this link for
more information