1. What is Android qa
1. What is Android qa
**
* * *
[Android](http://www.credosystemz.com/training-in-chennai/best-android-training-in-
chennai/) is a 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 on a DVM device. **DVM** executes Java languages bytecode which
later transforms into **.dex** format files.
* * *
Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode. We
need to convert Java class files into Dalvik Executable files using an Android tool
called “dx”. In normal circumstances, developers will not be using this tool
directly and build tools will care for the generation of DVM compatible files.
* * *
The data can be passed between many services and activities using the following
data types:
– **Primitive Data Types**: This is used to share the activities and services of an
application by using the command as Intent.putExtras(). This primitive data passes
the command to show the persistent data using the storage mechanism. These are
inbuilt data types that are used with the program. They provide a simple
implementation of the type and easy to use commands.
**4\. What needs to be done in order to set Android development environment where
Eclipse IDE is to be used?**
* * *
Download the Android SDK from Android homepage and set the SDK in the preferences.
Windows > Preferences > Select Android and enter the installation path of the
Android SDK. Alternatively, you may use Eclipse update manager to install all
available plugins for the Android Development Tools (ADT)
* * *
- **Activities**: They dictate the UI and handle the user interaction to the
screen.
- **Services**: They handle background processing associated with an application.
- **Broadcast Receivers**: It handles the communication between Applications and
Android Operating system
- **Content Providers**: They handle data and database management stuff.
**6\. Where will you declare your activity so the system can access it?**
* * *
**7.** **Can you deploy executable JARs on Android? Which packaging is supported by
Android?**
* * *
No. Android platform does not support JAR deployments. Applications are packed into
Android Package (.apk) using Android Asset Packaging Tool (aapt) and then deployed
on to Android platform. Google provides Android Development Tools for Eclipse that
can be used to generate Android Package.
* * *
As an Android application developer, you can inject files (XML, JSON, JPEG etc)
into the build process and can load them from the code. These injected files are
revered as resources.
**9\. Where can you define the icon for your Activity?**
* * *
**<activity** android:icon=”@drawable/app\_icon”android:name=”.MyTestActivity”
**></activity>**
* * *
**11\. Which dialog boxes can you use in you Android application?**
* * *
* * *
Dalvik Executable files have .dex extension and are zipped into a single .apk file
on the device.
* * *
It is used to provide interactive screen to the users. It can contain many user
interface components. A typical Android application consists of multiple activities
that are loosely bound to each other. Android developer has to define a main
activity that is launched on the application startup.
* * *
Android system assigns each application a unique ID that is called Linux user ID.
This ID is used to track each application.
**15\. An Android application needs to access device data e.g SMS messages, camera
etc. At what stage user needs to grant the permissions?**
* * *
* * *
**ADT** stands for **Android Development Tools** .The Android SDK includes several
tools and utilities to help you create, test, and debug your projects.
* * *
* * *
* * *
**Service** is like an Activity but has no interface. Probably if you want to fetch
the weather for example you won’t create a blank activity for it, for this you will
use a Service. It is also known as Background Service because it performs tasks in
background. A Thread is a concurrent unit of execution. You need to know that you
cannot update **UI** from a Thread. You need to use a Handler for this.
* * *
* * *
* * *
It consists of a shell script that is used to create new file system structure
required for writing codes in Android IDE.
**23\. What is the difference between a class , a file and an activity in android?
**
* * *
**Class** – Its a compiled form of .Java file . Android finally used this .class
files to produce an executable apk
* * *
These are the essential items that are present each time an Android project is
created:
– AndroidManifest.xml
– build.xml
– bin/
– src/
– res/
– assets/
* * *
**SmsManager class** is responsible for sending SMS from one emulator to another or
device.
You cannot instantiate this class directly; instead of , You can call the
getDefault method static() to obtain an SmsManager object. Then send the SMS
message using the
**sendTextMessage() method:**
– deliveryIntent — Pending intent to invoke when the message has been delivered.
* * *
> _android:screenOrientation=”sensorPortait”_
* * *
– Entire lifetime : The activity happens between onCreate and onDestroy
* * *
The main language supported is Java programming language. Java is the most popular
language for app development, which makes it ideal even for new Android developers
to quickly learn to create and deploy applications in the Android environment.
* * *
The **Android SDK** and Virtual Device Manager-It is used to create and manage
Android Virtual Devices (AVD) and SDK packages. The AVD hosts an emulator running a
particular build of Android, letting you specify the supported SDK version, screen
resolution, amount of SD card storage available, and available hardware
capabilities (such as touch screens and GPS).
**The Android Emulator**– Android virtual machine designed to run within a virtual
device on your development computer. Use the emulator to test and debug your
Android applications.
**Dalvik Debug Monitoring Service (DDMS)** – Use the DDMS perspective to monitor
and control the Dalvik virtual machines on which you’re debugging your
applications.
* * *
– There can be more than one intents, depending on the services and activities that
are going to use them and each component wants to tell which intents they want to
response to.
– Intent filters out the intents that these components are willing to respond to.
**31\. What is the difference between an implicit intent and explicit intent**?
* * *
There are two types of Intent implicit and explicit intent, let see some more
difference between them.
**Implicit:** Implicit intent is when you call system default intent like send
email, send SMS, dial number.
For example,
**Explicit:** Explicit intent when you call you’re on application activity from one
activity to another
**32\. How can your application perform actions that are provided by other
application e.g. sending email?**
* * *
Intents are created to define an action that we want to perform and launches the
appropriate activity from another application.
_startActivity(intent);_
* * *
- Inflate Exception
- OutOfResourceException
- BadSurfaceTypeException
- BadTokenException
* * *
* * *
AVD Stand for **Android Virtual Device** (emulator), The Android SDK includes a
mobile device emulator – a virtual mobile device that runs on your computer.
**36\. Differentiate between LinearLayout, RelativeLayout, AbsoluteLayout.**
* * *
**AbsoluteLayout** needs the exact positions of the x and y coordinates of the view
to position it. Though this is deprecated now.
* * *
* * *
**39\. What type of listener is used to get the ratings from the RatingBar Widgets?
**
* * *
* * *
**41\. How will you record a phone call in Android? or How to handle on Audio
Stream for a call in Android?**
* * *
* * *
Intents are used to display notification messages on android enable devices. These
notifications may be alert messages or any other notifications. The best part is
that Android users can also respond to these intents whenever required.
**43\. As an Android developer, how will you enumerate the steps necessary to
created bounded services through AIDL?**
* * *
**44\. How will you differentiate nine-patch image from regular bitmap image?**
* * *
Nine-patch image works on nine parameters when resizing an image that includes four
corners, 4 edges, and one axis. At the same time, Regular bitmap images work on the
overall background image.
* * *
* * *
Press and Hold the icon or widget. The phone will vibrate and on the bottom of the
phone you will see anoption to remove. While still holding the icon or widget drag
it to the remove button. Once remove turns red drop the item and it is gone.
* * *
* * *
- Perform all you long running network or database operation in separate thread
- If you have too much of background tasks, then take it off the UI thread. You may
use IntentService
- Server not responding for longer period can be guilt for ANR. To avoid always
define HTTP time out for your all your webs service calls.
- Be watchful of infinite loops during your complex calculations
* * *
**SQLite Databases** – Store structured data in a private database. You can define
many number of tables and can store data like other RDBMS.
* * *
The FrameLayout is the most basic of the Android layouts. FrameLayouts are built to
hold one view. As with all things related to development, there is no hard rule
that FrameLayouts can’t be used to hold multiple views.
**51\. What is needed to make a multiple choice list with a custom view for each
row?**
* * *
Multiple choice list can be viewed by making the CheckBox android:id value be
“@android:id /text1″. That is the ID used by Android for the CheckedTextView in
simple\_list\_item\_multiple\_choice.
* * *
It is a resizable bitmap resource that can be used for backgrounds or other images
on the device. The NinePatch class permits drawing a bitmap in nine sections. The
four corners are unscaled; the four edges are scaled in one axis, and the middle is
scaled in both axes.
* * *
User interface is what the user will see and interact with to perform some
operations. Android comes with many friendly UI elements and layouts which helps to
build interactive applications.
* * *
Event is a user interacting with the help of a Touchscreen. The Android framework
maintains an Event Queue in which the events are arranged as they occur. The events
are removed in First-In-First-Out (FIFO) basis.
* * *
* * *
With emulator, it becomes easy for the developers to play around, edit and create
the interface easily. Thus, it acts more like a mobile phone. With emulator it
becomes easy to write and even perform the test codes and debug. It is the safest
place that can be used for testing the codes
* * *
* * *
* * *
A Fragment can also exist without its own UI as an invisible worker for the
Activity.
A Fragment is closely tied to the Activity it is in. When the Activity is paused,
so are all fragments in it; When the Activity is destroyed, so are all fragments in
it.
The ViewHolder design pattern can be used to increase the speed at which a ListView
renders data.
The pattern avoids the repeated lookup of view resources. The number of times which
the findViewById() method is invoked is drastically reduced, existing views do not
have to be garbage collected and new views do not have to be inflated. The view
references for every row are stored in a simple object for later reuse.
* * *
**62\. What are typical subdirectories that the “res” directory does contain?**
* * *
* * *
Because every component needs to indicate which intents they can respond to, intent
filters are used to filter out intents that these components are willing to
receive. One or more intent filters are possible, depending on the services and
activities that is going to make use of it.
* * *
* * *
**66\. What is the proper way of setting up an Android-powered device for app
development?**
* * *
**67\. How do you find any view element into your program?**
* * *
Findviewbyid: Finds a view that was identified by the id attribute from the XML
processed inActivity.OnCreate(Bundle).
**Syntax**
* * *
For autoincrement, you have to declare a column of the table to be INTEGER PRIMARY
KEY, then whenever you insert a NULL into that column of the table, the NULL is
automatically converted into an integer which is one greater than the largest value
of that column over all other rows in the table, or 1 if the table is empty.
**69\. What are the basic tools used to develop an android app?**
* * *
- JDK
- Eclipse+ADT plugin
- SDK Tools
* * *
In sleep mode, CPU is slept and doesn’t accept any commands from android device
except Radio interface layer and alarm.
* * *
* * *
* * *
* * *
The foreground activity, being the most important among the other states, is only
killed or terminated as a last resort, especially if it is already consuming too
much memory. When a memory paging state has been reach by a foreground activity,
then it is killed so that the user interface can retain its responsiveness to the
user.
* * *
**76\. How do you remove icons and widgets from the main screen of the Android
device?**
* * *
To remove an icon or shortcut, press and hold that icon. You then drag it downwards
to the lower part of the screen where a remove button appears.
* * *
A project under Android development, upon compilation, becomes an .apk file. This
apk file format is actually made up of the AndroidManifest.xml file, application
code, resource files, and other related files.
* * *
**79\. Do all mobile phones support the latest Android operating system?**
* * *
Some Android-powered phone allows you to upgrade to the higher Android operating
system version. However, not all upgrades would allow you to get the latest
version. It depends largely on the capability and specs of the phone, whether it
can support the newer features available under the latest Android version.
* * *
Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other
wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot,
you can use your laptop to connect to the Internet using that access point.
**81\. How can two Android applications share same Linux user ID and share same VM?
**
* * *
The applications must sign with the same certificate in order to share same Linux
user ID and share same VM.
**82\. Can you deploy executable JARs on Android? Which packaging is supported by
Android?**
* * *
No, Android platform does not support JAR deployments. Applications are packed into
Android Package (.apk) using Android Asset Packaging Tool (AAPT) and then deployed
onto Android platform. Google provides Android Development Tools for Eclipse that
can be used to generate Android Package.
* * *
Both will result in deleting all the rows in the table .TRUNCATE call cannot be
rolled back as it is a DDL command and all memory space for that table is released
back to the server. TRUNCATE is much faster.Whereas DELETE call is an DML command
and can be rolled back.
* * *
A table may have more than one combination of columns that could uniquely identify
the rows in a table; each combination is a candidate key.
* * *
Android uses URI strings both for requesting data (e.g., a list of contacts) and
for requesting actions (e.g., opening a Web page in a browser). Both are valid URI
strings, but have different values. All requests for data must start with the
string “content://”. Action strings are valid URIs that can be handled
appropriately by applications on the device; for example, a URI starting with
“http://” will be handled by the browser.
* * *
**87\. What is SQLite? How does it differ from client-server database management
systems?**
* * *
* * *
– The Nine-patch in the image name refers to the way the image can be resized: 4
corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one
that can be scaled into both axes.
– A Nine-patch image allows resizing that can be used as background or other image
size requirements for the target device.
* * *
– The compatibility is defined in terms of android compatible devices that run any
application. This application is written by third party developers using the
Android platform that comes in the form of SDK and NDK.
– There are many filters that are used to separate devices that are there to
participate in the compatibility mode for the Android applications. The devices
that are compatible require the android to approve it for their trademark. The
devices that are not passes the compatibility are just given in the Android source
code and can use the android trademark.
– The compatibility is a way through which the user can participate in the Android
application platform. The source code is free to use and it can be used by anyone.
* * *
The process is automated. The Compatibility Test Suite generates a report that can
be provided to Google to verify compatibility. Eventually we intend to provide
self-service tools to upload these reports to a public database.
* * *
When you call registerReceiver( ) for that action — even with a null
BroadcastReceiver — you get the Intent that was last broadcast for that action.
Hence, you can use this to find the state of the battery without necessarily
registering for all future state changes in the battery.
* * *
The Google translator translates the data of one language into another language by
using XMPP to transmit data. You can type the message in English and select the
language which is understood by the citizens of the country in order to reach the
message to the citizens.
* * *
* * *
* * *
The APK file is compressed AndroidManifest.xml file with extension .apk, Which have
application code (.dex files), resource files, and other files which is compressed
into single .apk file.
* * *
The customer will be benefited from wide range of mobile applications to choose,
since the monopoly of wireless carriers like Orange and AT&T will be broken by
Google Android.
Features like weather details, live RSS feeds, opening screen, icon on the opening
screen can be customized innovative products like the location -aware services,
location of a nearby convenience store etc., are some of the additive facilities in
Android.
* * *
* * *
Generics are a facility of generic programming that were added to the Java
programming language in 2004 within the official version J2SE 5.0. They were
designed to extend Java’s type system to allow “a type or method to operate on
objects of various types while providing compile-time type safety.”
* * *
The Android SDK and Virtual Device Manager Used to create and mange Android Virtual
Device (AVD) and SDK packages.
**Dalvik Debug Monitoring Service** (DDMS) use the DDMS perspective to monitor and
control the dalvik virtual machines on which your debugging your application.
**Android Debug Bridge** (ADB) A client- server application that provides a link to
a running emulator.It lets you copy files, Install complied application
packges(.apk) and run shall commands.