Thursday, December 20, 2012

Android Testing Questions

What is Android?
Android is a stack of software for mobile devices which includes an Operating System, middleware and some key applications. The application executes within its own process and its own instance of Dalvik Virtual Machine. Many Virtual Machines run efficiently by a DVM device. DVM executes Java languages byte code which later transforms into .dex format files.

What is the Android Architecture?
Android Architecture is made up of 4 key components:
- Linux Kernel
- Libraries
- Android Framework
- Android Applications

Explain the Boot sequence of Andriod?
Step 1: Power on and boot ROm code execution
Step 2: The Boot Loader Loading
Step 3: Starting of Linux Kernal
Step 4: The init Process
Step 5: Zygote and Dalvin
Step 6: The System Server initation

What is Bootchart and how to use?
Bootchart is a system designed to show a graphical display of the activity of a system during boot. The tool consists of a data collection tool and a graphic generator tool.
Overview of Steps to Use Bootchart
*install the bootchart tool on your host machine
*build 'init' with bootchart support
*install 'init' into your system image
*trigger bootchart functionality on system boot
*retrieve the collected data from the system
*generate the graphic from the data
*view the resulting graphic
*interpret the results

What are the features of Andriod?
1. Software Feature:
*Integrated Browser based on the open source Web Kit Engine
*SQlite for Relational data storage
*Media Support for Common Audio, Video  and still image format
*Dalvik Virtual Machine Optimized for mobile devices
2. Harware Features:
*Celluar networking : GSM, EDGE, 3G
*LAN : Bluetooth and Wifi
*Grafics Hardware and acceleration
*Camera , GPS and Compass
3.Security
*Andriod applications runs in a sandbox, an isolated area of the OS that does not have access to the rest of the sysems's resources,unless access permissions are granted by the user when the application is installed.

What are the core components under the Android application architecture?
There are 5 key components under the Android application architecture:
- services
- intent
- resource externalization
- notifications
- content providers


What is an Activity?
A single screen in an application, with supporting Java code.

What is an Intent?
A class (Intent) which describes what a caller desires to do. The caller will send this intent to Android’s intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF document is an intent, and the Adobe Reader apps will be the perfect activity for that intent (class).

What is the AndroidManifest.xml?
This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.

What is the APK format? ( Android Package file)
The APK file is compressed AndroidManifest.xml file with extension .apk. It also includes the application code (.dex files), resource files, and other files which are compressed into a single .apk file.


How to sync Kernel time and logcat time?
$adb shell  
$logcat -v time -f /dev/kmsg | cat /proc/kmsg > /data/klog_plog_log.txt
you can differentiate both the logs using time stamps in the platform logs. And then pull the file to your local drive using
adb pull /data/klog_plog_log.txt > sample.txt

How To Boot the Android mobile device into Recovery Mode?
Step 1. Turn your phone off.
Step 2. Hold down “Volume Up keys” +“Home” and press “Power” until the screen light ups.
Step 3. Press the three keys unlit green screen like below appears:

How to get kernel messages from Android? - BootLoader
http://bootloader.wikidot.com/linux:android:kmsg

Uses of android : -
  1. Android is useful because:
  2. It is simple and powerful SDK
  3. Licensing, Distribution or Development fee is not required
  4. Easy to Import third party Java library
  5. Supporting platforms are – Linux, Mac Os, Windows
Overview of the steps you must follow to set up the Android SDK:
  1. Prepare your development computer and ensure it meets the system requirements.
  2. Install the SDK starter package. (If you're on Windows, download the installer for help with the initial setup.) Download Link : http://developer.android.com/sdk/index.html
  3. Install the ADT Plugin for Eclipse (if you'll be developing in Eclipse).
  4. Add Android platforms and other packages to your SDK.
  5. Explore the contents of the Android SDK (optional). 
What are the advantages of Android?
The following are the advantages of Android:
  1. The customer will be benefited from wide range of mobile applications to choose, since the monopoly of wireless carriers like AT&T and Orange will be broken by Google Android.
  2. Features like weather details, live RSS feeds, opening screen, icon on the opening screen can be customized
  3. Innovative products like the location-aware services, location of a nearby convenience store etc., are some of the additive facilities in Android
How can I get logs from my Android device?
You can get platform logs with the following command:
adb logcat > platform.log &
And kernel logs with:
adb shell cat /proc/kmsg > kmsg.log &

Features of Android:
  1. Application framework enabling reuse and replacement of components
  2. Dalvik virtual machine optimized for mobile devices
  3. Integrated browser based on the open source WebKit engine
  4. Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
  5. SQLite for structured data storage
  6. Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
  7. GSM Telephony (hardware dependent)
  8. Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
  9. Camera, GPS, compass, and accelerometer (hardware dependent)
  10. Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE.
What is ANR?
ANR = Application Not Responding
which means, in android it is a general rule of thumb, if an application doesn't respond with 5 seconds android takes control and shows the Application Not Responding dialog and gives control to the user to close the application.


What Is ADB??
ADB stands for Android Debug Bridge. It comes as a part of the standard Android SDK, which you can grab here. Basically, it provides a terminal-based interface for interacting with your phone’s file system. Since Android platform is based on Linux, command-line is the only way to obtain and manipulate root access often required to perform certain advanced operations on your device using root access.

While these things can be done directly on the device itself using some terminal emulator, it will be rather difficult to execute complex commands on such a small screen. ADB provides the bridge between your machine and your computer

For example,the following ADB commands:

adb push BurritoRoot2.bin /data/local/
adb shell chmod 777 /data/local/BurritoRoot2.bin
adb shell /data/local/BurritoRoot2.bin
adb root
adb shell id
adb remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 06755 /system/xbin/su
adb remount
adb install Superuser.apk

Using ADB
One of the first things to remember is to put your device in USB debugging mode. This can be found by navigating to Menu>Settings>Applications>Development and checking the box for USB debugging. Without doing this, your PC won’t recognize your device.

The most important thing to know is simply how to get to your ADB folder via the command line. This is done with the cd (change directory) command. So if (on Windows) your SDK folder is called “android-SDK” and it’s in your root (c:) directory, you would type the following to get there:
cd c:/android-SDK
Then, to get into the ADB folder, you would add the following:
cd platform-tools
at that point, you should see a prompt that says:
C:\android-SDK\platform-tools>
At this point you can connect your device and test your ADB connection. After you’ve located and installed the drivers for your particular device, type the following:
adb devices
If everything is set up properly, you should see a list of devices attached. Your phone or tablet will have a number assigned to it, so don’t be surprised if it doesn’t say “Droid Razr” or “Galaxy Nexus.”







What is Dalvik virtual machine?
The name of Android’s virtual machine. The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format, a format that is optimized for efficient storage and memory-mappable execution.

The virtual machine is register-based, and it can run classes compiled by a Java language compiler that have been transformed into its native format using the included “dx” tool.

Android Testing:



6 comments: