APK stands for Android Packaging Kit. The Android packaging key is compressed with classes, UI’s, supportive assets and manifest. All these files are compressed to a single file which is called APK.
A nine-patch image, unlike bitmap, can be resized and used as background or other image sizes for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes. This is what differentiates a nine-patch image from a regular bitmap.
Yes, it is possible to do that, such as when you want to create a background behavior for a particular activity. You can do this by using add(Fragment,string) method to add a fragment from the activity.
In the sleep mode, the CPU is transitioned into a deactivated mode and does not accept any commands from the Android device. Only the Radio interface layer and alarm remains active in sleep mode.
The four essential states of activity are:
1. Active – if the activity is at the foreground
2. Paused – if the activity is at the background and still visible
3. Stopped – if the activity is not visible and therefore is hidden or obscured by another activity
4. Destroyed – when the activity process is killed or completed terminated
Android Runtime consists of Dalvik Virtual machine and Core Java libraries.
DVM is optimized for low processing power and low memory environments.
Unlike JVM, the Dalvik Virtual Machine doesn’t run .class files, instead it runs .dex files.
Android 2.2 “Froyo“ brought trace-based just-in-time (JIT) compilation into Dalvik, optimizing the execution of applications and dynamically compiling frequently executed short segments of their bytecode into native machine code.
Android being an open-source platform, and considering that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. An app that runs on one version of Android OS may or may not run on another version.
Another disadvantage is that it can be challenging for developers to create apps that can adjust correctly to the right screen size and other varying features and specs of various Android devices.
SQLite is the open-source relational database. The SQLite engine is serverless, transactional, and self-contained.
Instead of the typical client-server relationship of most database management systems, the SQLite engine is integrally linked with the application. The library can also be called dynamically and makes use of simple function calls that reduce latency in database access.
It is not recommended to change the application after its deployment. This may break some functionality.
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.
A fragment is a part or portion of an activity. It is modular in a sense that you can move around or combine with other fragments in a single activity. Fragments are also reusable.
The ANR dialog is displayed to the user based on two possible conditions. One is when there is no response to an input event within 5 seconds, and the other is when a broadcast receiver is not done executing within 10 seconds.
Assuming that all of these multiple resources are able to match the configuration of a device, the 'locale' qualifier almost always takes the highest precedence over the others.
ActivityCreator is a batch file and shell script which was used to create a new Android project. It is now replaced by the “Create New Project” in Android SDK.
ANR stands for Application Not Responding. It is a notification or pop-up displayed by the Android platform whenever the application is performing too many functions at a time and if it is suddenly not responding for a long time to the user action.
A Sticky Intent is a broadcast from sendStickyBroadcast() method which floats around even after the broadcast, allowing others to collect data from it.
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.
Dalvik serves as a virtual machine, and it is where every Android application runs. Through Dalvik, a device is able to execute multiple virtual machines efficiently through better memory management.
a) Alert dialog box
It can be used to interrupt and ask the user whether to continue or stop a process.
b) Progress dialog box
This is to inform the user of the progress of a particular task.
c) Date picker dialog box
The date picker is a widget that is used to help the user select a date.
d) Time picker dialog box
A Time picker is a widget that is used to help the user select the time.
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.
It is a default file format that is used by the Android Operating System. Application Package Kit (APK) is used for the installation of mobile apps. The .apk contains resource file, certificate, manifest file, and other code.
The keyword findViewById is used to identify view elements.
Application resource files are files that include static content that your code can use. This includes layout definitions, bitmaps, animation instructions, user interface strings, and more.
Android offers several options to see persistent application data. They are:
1. Shared Preferences – Store private primitive data in key-value pairs
2. Internal Storage – Store private data on the device memory
3. External Storage – Store public data on the shared external storage
4. SQLite Databases – Store structured data in a private database
The difference between them are as follows:
File is a block of arbitrary information or resources for storing information. It can be any file type.
Class is a compiled from of .Java file which Android uses to produce an executable apk.
Activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type but just a class that can be extended in Android to load UI elements on view.
ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application have been unresponsive for a long period of time.
Android has an Intent class when the user has to navigate from one activity to another. Intent displays notifications from the device to the user and then the user can respond to the notification if required.
Given below are the two types:
Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.
Implicit Intent is used whenever you are performing an action. For example, send email, SMS, dial number or you can use a Uri to specify the data type. For example:
Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.edureka.co"));
Explicit, on the other hand, helps you to switch from one activity to another activity(often known as the target activity). It is also used to pass data using putExtra method and retrieved by other activity by getIntent().getExtras() methods.
Intent i = new Intent(this, Activitytwo.class); #ActivityTwo is the target component
i.putExtra("Value1","This is ActivityTwo");
i.putExtra("Value2","This Value two for ActivityTwo");
Java is the official programming language for Android App development. It is also possible to develop in C/ c++ language using NDK (Android Native Development). However, the major parts of Android are written in Java programming language and the APIs are also designed primarily from Java.
Android Debug Bridge is a command-line tool used to allow and control communication with an emulator instance. It gives the power for developers to execute remote shell commands to run applications on an emulator.
Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.
The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.
These are the essential items that are present each time an Android project is created:
The core components of Android operating systems are:
4. Content Provider
Android framework is a set of API’s using which the Android developers write code for the mobile apps. It contains the methods and classes to write the programming code.
Android framework includes a different set of tools to create image pane, text field, buttons, etc. It also includes “Activities” with which the user interacts and “Services”, which are the programs that run in the background. It is a package of different components like Intents, Broadcast Receivers, Content Providers, etc.
It is open-source and platform-independent. It supports various technologies like Bluetooth, Wi-Fi, etc
Java is the widely used language for Android development. It also supports C/C++ and when used with Android SDK, it improves the performance speed too.
An activityCreator is the first step towards the creation of a new Android project. It is made up of a shell script that will be used to create new file system structure necessary for writing codes within the Android IDE.
Mobile app testing is the testing of applications on a device which mainly focuses on functions and features of the application.
And Mobile Testing is the testing of the actual mobile device and focuses on mobile features like Call, SMS, Contacts, Media Player, inbuilt browsers, etc.
An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter holds the data and sends the data to the adapter view, the view can take the data from the adapter view and shows the data on different views like a spinner, list view, grid view, etc
Bundles are used to pass the required data between various Android activities. These are like HashMap that can take trivial data types. Below code shows how to transfer a piece of data by using bundle:
Bundle b=new Bundle();
i.putExtras(b); // where i is intent
Service is an application component that facilitates an application to run in the background in order to perform long-running operations without user interaction. A service can run continuously in the background even if the application is closed or even after the user switches to another application.
Open-source: It means no license, distribution and development fee.
Platform-independent: It supports Windows, Mac, and Linux platforms.
Supports various technologies: It supports camera, Bluetooth, wifi, speech, EDGE etc. technologies.
Highly optimized Virtual Machine: Android uses a highly optimized virtual machine for mobile devices, called DVM (Dalvik Virtual Machine).
Activity in java is a single screen that represents GUI(Graphical User Interface) with which users can interact in order to do something like dial the phone, view email, etc.
For example, the Facebook start page where you enter your email/phone number and password to log in acts as an activity.
AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.
The Android Framework is an important aspect of the Android Architecture. Here you can find all the classes and methods that developers would need in order to write applications on the Android environment.
Android Architecture is made up of 4 key components:
1. Linux Kernel
3. Android Framework
4. Android Applications
The Google Android SDK is a toolset that developers need in order to write apps on Android enabled devices. It contains a graphical interface that emulates an Android driven handheld environment, allowing them to test and debug their codes.
Android is an open-sourced operating system that is used on mobile devices, such as mobiles and tablets. The Android application executes within its own process and its own instance of Dalvik Virtual Machine(DVM) or Android RunTime(ART).