Android Mobile Mobile Testing

Android Anatomy | Software Testing is an Art!

Android Structure Layers:


1. Purposes
Alarm / Browser / Calculator / Calendar / Digital camera / Clock / Contacts / E-mail / Residence / Media Participant / Photograph Album / SMS / MMS / Voice Dial
The native purposes provided with the actual Android implementation + the third get together purposes.

2. Android Framework
It supplies loads of courses and interfaces for android software improvement.

  • Exercise Supervisor – Controls all points of the appliance lifecycle and activity stack.
  • Content material Providers – Permits purposes to publish and share knowledge with different purposes.
  • Useful resource Supervisor – Supplies access to non-code embedded assets akin to strings, shade settings and consumer interface layouts.
  • Notifications Manager – Permits purposes to show alerts and notifications to the consumer.
  • View System – An extensible set of views used to create software consumer interfaces.
  • Package deal Manager – The system by which purposes are able to find out information about other purposes at present put in on the gadget.
  • Telephony Supervisor – Offers info to the appliance concerning the telephony providers obtainable on the system reminiscent of standing and subscriber info.
  • Location Supervisor – Supplies entry to the situation providers permitting an software to receive updates about location modifications.
  • Window Supervisor – Is chargeable for managing the z-ordered listing of windows, which home windows are visible, and the way they’re laid out on display. Amongst different issues, it mechanically performs window transitions and animations when opening or closing an app or rotating the display.

three. Native Libraries

  • libc – C runtime library;
  • SQLite is answerable for database;
  • SSL is answerable for Web security;
  • Surface Manager is answerable for composing home windows on the display;
  • OpenGL/ES is chargeable for 2D/3D drawing;
  • WebKit is answerable for browser help;
  • FreeType – is answerable for font help;
  • Media Framework – is liable for enjoying and recording audio and video formats.

four. Android Runtime
Core Libraries (Java) / ART / Dalvik VM
Until version 5.0, Android used Dalvik as a process digital machine. Android 4.4 launched Android Runtime (ART) as a new runtime setting, nevertheless it  was an experimental function and not enabled by default. It turned the one runtime choice within the next main version of Android, 5.zero
Dalvik makes use of Simply-In-time (JIT) compilation technique to interpret the bytecode. JIT interprets the bytecode into machine language at it’s runtime (on the time when the apps are executed).
ART is written in C/C++  and uses Forward-Of-Time (AOT) compilation to interpret bytecode. AOT compiles the code into machine language when the app is installed itself, means no compilation is finished on the time of execution of app.

Advantages of ART:

  • The apps launch velocity is very fast as a result of nothing is compiled at execution.
  • Boot velocity is quicker as a result of nothing is execued from dalvik partition as in case of odexed ROM in dalvik
  • Increases battery backup by decreasing CPU work on account of absence of compilation work on apps execution.

Disadvantages of ART:

  • It takes 10-20% more room upon installation than dalvik.
  • Some apps are incompatible in ART.

5. HAL (Hardware Abstraction Layer)
Audio / Bluetooth / Digital camera / DRM / Exterior Storage / Graphics / Input / Media / Sensors / TV
Solely binary code is required.

6. Linux Kernel
Audio Drivers / Binder (IPC) Drivers / Bluetooth Driver / Digital camera Driver / Display Driver / Keypad Driver / Power Management / Shared Reminiscence Driver / USB Driver / WiFi Driver
It is the guts of android architecture, that is liable for gadget drivers, power management, memory administration, gadget administration and useful resource access.

Android File System

There are mainly 6 (plus /sdcard) partitions in Android units. There is perhaps another partitions obtainable, it differs from Model to Mannequin. However 7 partitions could be present in any Android units.

Android Partitions

1. /boot
The boot partition. It consists of the android kernel and the ramdisk. The gadget won’t boot without this partition.
Wiping this partition from recovery ought to solely be executed if absolutely required and once carried out, the gadget must NOT be rebooted before putting in a new one, which could be carried out by installing a ROM that includes a /boot partition.

2. /system
This partition accommodates all the Android OS, aside from the kernel and the ramdisk.
It consists of the Android GUI and all the system purposes that come pre-installed on the gadget.
Wiping this partition will take away Android from the system without rendering it unbootable, and consumer still be capable of put the system into restoration or bootloader mode to put in a brand new ROM.

three. /restoration
This partition is designed for backup. It can be thought-about as an various boot partition, that lets the system boot into a recovery console for performing advanced recovery and maintenance operations on it.

four. /knowledge
This partition incorporates the consumer’s knowledge like contacts, sms, settings and all android purposes installed. If the consumer performs manufacturing unit reset on system, this partition might be worn out.

5. /cache
On this partition Android shops ceaselessly accessed knowledge and app elements.
Wiping the cache doesn’t impact personal knowledge but merely removes the prevailing knowledge there, which will get routinely rebuilt as consumer continues using the gadget.

6. /misc
This partition accommodates miscellaneous system settings in form of on/off switches. These settings might embrace CID (Service or Area ID), USB configuration and certain hardware settings and so forth. This is an essential partition and if it is corrupt or lacking, a number of of the system’s options won’t perform normally.

7. /sdcard
This is not a partition on the interior memory of the system however fairly the SD card. This is a space for storing for media, documents, ROMs and so forth.
On units with both an inner and an exterior SD card the /sdcard partition all the time used referes to the interior SD card.
Wiping it is perfectly protected. Although a number of user-installed apps save their knowledge and settings on the SD card and wiping this partition will make consumer lose all that knowledge.

The Elementary Elements of Android:

1. Exercise
An activity is a category that represents a single display. It is like a Frame in AWT.

2. View
A view is the UI factor akin to button, label, textual content subject and so on. Something that you simply see is a view.

3. Intent
Intent is used to invoke elements. It is mainly used to:

  • Start the service
  • Launch an exercise
  • Display an internet web page
  • Display an inventory of contacts
  • Broadcast a message
  • Dial a telephone call and so on.

4. Service
Background process that may run for a very long time. There are two varieties of providers:

  • native service  is accessed from inside the software
  • distant service is accessed remotely from other purposes operating on the identical gadget.

5. Content Provider
Used to share knowledge between the purposes.

6. Fragment
Like elements of exercise. An exercise can display one or more fragments on the display at the similar time.

7. AndroidManifest.xml
Accommodates informations about actions, content providers, permissions and so forth. It is like the online.xml file in Java EE.

8. Android Virtual System (AVD)
Used to test the android app with out the need for cellular or tablet and so forth. It may be created in several configurations to emulate several types of actual units.

Watchdog

A Watchdog timer is an electronic timer that is used to detect and recuperate from pc malfunctions.
It is a useful gizmo in serving to a system recuperate from transient failures.
A Watchdog timer is used to trigger a system reset or different corrective actions, if the primary program is unresponsive or hung.

Kicking the canine – The method of restarting the watchdog timer’s counter.

Watchdog is configured with a bark and a chew time.
If the watchdog is not “pet” at regular intervals, the system is assumed to have turn into non responsive and must be reset. A warning in the type of a bark timeout results in a bark interrupt and a kernel panic. If the watchdog timer is nonetheless not reset, a chew timeout occurs, which is an interrupt in the safe mode, which results in a reset of the SOC by way of the secure watchdog. The driving force wants the petting time, and the bark timeout to be programmed into the watchdog, as well as the bark and chew irqs.

  • Watchdog BITES – The process of expiry of a watch dog timer, which happens when the watch dog timer is not feed/restarted before the trip period. Watchdog lets the consumer know that one thing is fallacious.
  • Watchdog BARKS – When the watchdog timer expires, it sends a sign to the micro controller or the PMU to restart the gadget as per design. A essential points occurred, which (sometimes) ends with the system being reset.