What is Android?
Android is free and open source operating system that is mainly used on mobile devices like tablets and Smartphones. 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.
What is Android Architecture?
Android Architecture consists of 5 main elements
- Applications
- Application Framework
- Android runtime
- Libraries
- Linux Kernel
What is API Level?
API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.
The Android platform provides a framework API that applications can use to interact with the underlying Android system. The framework API consists of:
- A set of Intents
- A core set of packages and classes
- A set of XML elements and attributes for declaring a manifest file
- A set of XML elements and attributes for declaring and accessing resources
- A set of permissions that applications can request, as well as permission enforcements included in the system
What is NDK?
The NDK (Native Development Kit) provides all the tools (compilers, libraries, and header files) to build apps that access the device natively. Native code (in C/C++) is necessary for high performance to overcome the limitations in Java’s memory management and performance.
Android apps are typically written in Java, with its elegant object-oriented design. However, at times, you need to overcome the limitations of Java, such as memory management and performance, by programming directly into Android native interface. Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java.
Explain Android application Architecture?
Android application architecture has the following components. They are as follows
Services: It will perform background functionalities
Intent: It will perform the inter connection between activities and the data passing mechanism
Resource Externalization: strings and graphics
Notification: light, sound, icon, notification, dialog box, and toast
Content Providers: It will share the data between applications
What are the advantages of android?
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, Wi-Fi, speech, EDGE etc. technologies.
Highly optimized Virtual Machine: Android uses highly optimized virtual machine for mobile devices, called DVM (Dalvik Virtual Machine).
What are the Uses of API Level in Android?
The API Level identifier serves a key role in ensuring the best possible experience for users and application developers:
- It lets the Android platform describe the maximum framework API revision that it supports.
- It lets applications describe the framework API revision that they require.
What is an APK File?
Just like Windows (PC) systems use an .exe file for installing software, Android does the same. An APK file is the file format used for installing software on the Android operating system.
What is the JobScheduler API?
JobScheduler is an abstract class that allows developers to create jobs that execute in the background when certain conditions are met. Typical conditions are:
- device is plugged into a power source
- device is connected to Wi-Fi
Why would I want to install an APK File?
APK files of new Android builds are often leaked ahead of time, giving you early access to all the exciting new features that otherwise wouldn’t be available to you. Also, some apps are restricted to regions and outside of yours.
APK files also allow you to bypass carriers to get the latest Google updates, which can take a a frustrating amount of time to arrive via an over-the-air update from your network. And if your Android device lacks access to the Google Play Store, APK files may be your only option for installing apps on your device.
What do you understand by having an emulator in Android environment?
An emulator allows you to play around the interface and it feels like you are working on actual mobile devices only. With the help of an emulator, you can write codes or debug codes securely especially during initial design phases.
What is an Android Manifest file?
Applications declare their components in a manifest file that’s bundled into the Android package, the .apk file that also holds the application’s code, files, and resources. The manifest is a structured XML file and is always named AndroidManifest.xml for all applications. It is also used for naming any libraries the application needs to be linked against (besides the default Android library) and identifying any permission the application expects to be granted.
How does the AOSP relate to the Android Compatibility Program?
Android Open-source project (AOSP) that maintains Android software and keep track of the new versions. It can be used for any purpose including the devices that are not compatible with other devices. It is related to the Android Compatibility Program as it defines the implementation of Android that is compatible with the third-party apps.
Why cannot you run standard Java bytecode on Android?
Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode. First of all, we have 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.
How to create a new Android project within android IDE?
You have to use an “activity Creator” to start a new android project within android IDE. An “activity Creator” is made up of the shell script that will help you in creating fresh file structure to write codes.
What is the Google Android SDK?
Google Android SDK is a set of tools required by developers to enable them write apps on Android enabled devices. It has a graphical interface which imitates an Android handheld environment, enabling them in testing and debugging their codes.
What are the seven lifecycle methods of Android activity?
The seven lifecycle methods of Android activity are onCreate(), onStart(), onRestart(), onResume(), onPause(), onStop(), and onDestroy(). Their purpose is to help structure your code around how you want an activity to perform throughout its lifecycle on the device.
What are intents?
Intents display messages of notification from within the Android enabled device to the user. Intents are used to notify the user when a particular state occurs, and users have the opportunity to respond to the notification.
What dialog boxes are supported in android?
There are 4 dialog boxes which have been supported by Android. These are as follows
AlertDialog: An alert dialog box supports 0 to 3 buttons and a list of Selectable elements, including check boxes and radio buttons. Among the other dialog boxes, the most suggested
dialog box is the alert dialog box.
ProgressDialog: This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
DatePickerDialog: This dialog box is used for selecting a date by the user.
TimePickerDialog: This dialog box is used for selecting time by the user.
What are typical subdirectories that the “res” directory does contain?
The “res” folder contains various resource files:
- res/drawable/* -> images and nine-patch files.
- res/layout/ -> XML-based UI layout files.
- res/values/ -> strings, colors, dimensions.
- res/menu/ -> menu specification files
- res/raw/ -> raw files like a CSV file, movie clip or audio clip (mp3)
- res/xml/ -> general XML files
What is an Adapter in android?
The Adapter is used to create child views to represent the parent view items.
What is ANR?
ANR is the acronym for Application Not Responding. When an application is unresponsive for a long time, the dialogue shows up to let the user know about the situation.
What is DDMS and what can it do?
DDMS is short for Dalvik Debug Monitor Server. It ships natively with Android and contains a number of useful debugging features including: location data spoofing, port-forwarding, network traffic tracking, incoming call/SMS spoofing, thread and heap information, screen capture, and the ability to simulate network state, speed, and latency.
What is AIDL?
AIDL is the abbreviation for Android Interface Definition Language. It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication. The process involves breaking down objects into primitives that are Android understandable.
What is GSON?
GSON is a Java Library that can convert Java Objects into JSON Objects.
What is ADB?
ADB simply stands for Android Debug Bridge. It presents developers with the power to perform shell commands that are remote. Its major work is to permit and direct communication towards and from the emulator port.
What’s the difference between a Frame Layout and a Table Layout?
A Frame Layout stacks up child views above each other with the last view added on the top. Though we can control the position of the children inside the Frame Layout using the layout gravity attribute.
When the width and height of the Frame Layout are set to wrap content, the size of the Frame Layout equals the size of the largest child (plus padding).
A Table Layout consists of Table Rows. The children are arranged in the form of rows and column
What is the difference between DP, SP and PX?
DP (Density-independent Pixel): abstract unit that is based on the physical density of the screen. One DP is one pixel on a 160-dpi screen (the unit is relative to a 160 dpi screen), but one DP equals two hardware pixels on a 320 dpi screen
SP (Scale-independent Pixel): same as DP but it is also scaled by the user’s font size preference. This unit is used to specify font sizes.
PX (Pixel): corresponds to actual pixels on the screen
What are the methods to avoid memory leaks in Android?
Android applications are well bundled with the memory but they have a drawback of running lots of application that keeps in the memory to make the processing faster. The more application in the memory, the faster will be the switch between the applications. The memory leaks can be avoided by changing the context. The context is used for many operations but it is used to access the resources on android. The widgets have a context parameter in their constructors.
There are mainly two types of context: either activity or application. The program is as follows:
@Override
Protected void onCreate(Bundle state)
{
super.onCreate(state);
TextView label = new TextView(this);
label.setText(“Test memory leak”);
setContentView(label);
}
If the context is having leaks in it then the activity then there is a possibility of the leaks of memory. The leaking of the entire activity can be checked. The system will automatically create and destroy one of the activities by default. Android will reload the application by using the rotation policy. And it will keep the entire static field maintained.
How can we use escape characters as attributes?
Escape characters usually have backlashes before them. For instance, one can create a newline character with the use of ‘\\n’.
What is the importance of settings permissions in app development?
Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.
What is a ContentProvider?
A Content Provider is part of an Android application that manages access to a repository of data.
What is the role of compatibility that is used in Android?
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.
What are “launch modes”?
A launch mode defines how a new instance or the existing instance of an activity is associated with the current task.
The launch mode of an Activity supports four different modes:
Standard (default): Multiple instances of the activity class can be instantiated and multiple instances can be added to the same task or different tasks. This is the common mode for most of the activities.
singleTop: The difference from “standard” is, if an instance of the Activity already exists at the top of the current task and the system routes the intent to this Activity, no new instance will be created because it will fire off an onNewIntent() method instead of creating a new Activity instance.
SingleTask: A new task will always be created and a new Activity instance will be pushed to the task as the root one. However, if any activity instance exists in any tasks, the system routes the intent to that activity instance through the onNewIntent() method call. In this mode, activity instances can be pushed to the same task. Result: A certain Activity cannot exist in multiple tasks at the same time.
SingleInstance: Same as singleTask, except that the no activities instance can be pushed into the same task of the single Instance’s.
What are the different types of services?
Services are largely divided into two categories: Bound Services and Unbound/Started Services
Bound Services: An Android component may bind itself to a Service using bindservice (). A bound service would run as long as the other application components are bound to it. As soon as the components call unbindService (), the service destroys itself.
Unbound Services: A service is started when a component (like activity) calls startService () method and it runs in the background indefinitely even if the original component is destroyed.
What is the difference between AsyncTask and Thread class?
A Thread is generally used for long tasks to be run in background. We need a Handler class to use a Thread.
An AsyncTask is an intelligent Thread subclass. It’s recommended to use AsyncTask when the caller class is the UI Thread as there is no need to manipulate the handlers. AsyncTask are generally used for small tasks that can communicate back with the main UI thread using the two methods onPreExecute () and onPostExecute () it has.
What is the difference between Serializable and Parcelable?
Serializable is a Java marker interface. A class that implements this interface allows the serialization of an object from this type in certain situations.
Parcelable is an Android specific interface where you have to implement the serialization by yourself. The parcelable process is much faster than Serializable (= no need for reflection). Parcelable is always the default choice in Android.
What is a Hybrid mobile App?
Hybrid applications are web applications in native browsers. They are developed using HTML, CSS and JavaScript and then wrapped in native application.
What is Firebase?
Firebase is a mobile platform by Google to help developers develop a high-quality app and grow their base. It offers Crash reports, analytics, real-time communication and AdMob support.
What are the new features in Android 9(pie)?
- Adaptive brightness
- Added colour design
- Better Battery life
- New updated volume designs
- Easy Apps actions
- Easy way messaging App
- New Auto rotate button
- New Wind down option
- Easy Screenshot edit option
- Increased Security
- Text selection Magnification
- New Navigation System
- New Android Dashboard
- No microphone spying
- New slices
- New Emojis(157)
- App Timer
- Lockdown Mode
- Default HTTPs for Apps
- Pair up to 5 Bluetooth devices
- Smarter Notification channel
- Autofill in different browsers
- Support for HEIF image and HDR VP9 video format.
- Wi-Fi RTT
- Supports IEEE802.11mc WI-Fi protocol
- Notch support
Present Avaialble devices(2018) :
- Nokia 7Plus
- OnePlus6
- OppoR15pro
- SonyXperia XZ2
- ViVOX21UD
- Pixel
- PixelXL
- Pixel2
- Pixel 2XL
- Essential Phone
- VivoX21
- XioamiMiMix2S