While both iOS and Android skills are in high demand, employers are hiring Android developers much faster and more often than any other professionals in mobile tech. The number of smartphone users is expected to grow around 2.5 billion in 2019 according to Statista.com. The same report states that Android, with 80 percent of all smartphones sales, leads the global smartphone market. With these numbers only expected to rise in the coming years, Android App Development Certification has emerged as one of the hottest skills in the market today!
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.
The Application class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created.
The latest version is Android 9.0- Android Pie released in August, 2018. Android is a mobile operating system developed by Google. It is based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Every other Android version has been named after either sweet or desserts. The following table represents the Android name, version and the year of release.
Android Name | Version | Year of Release |
Android 1.5 | Android Cupcake | 2009 |
1.6 | Donut | 2009 |
2.0-2.1 | Eclair | 2009 |
2.2 – 2.2.3 | Froyo | 2010 |
2.3 – 2.3.7 | Gingerbread | 2010 |
3.0 – 3.2.6 | Honeycomb | 2011 |
4.0 – 4.0.4 | Ice Cream Sandwich | 2011 |
4.1 – 4.3.1 | Jelly Bean | 2012 |
4.4 – 4.4.4 | KitKat | 2013 |
5.0 – 5.1.1 | Lollipop | 2014 |
6.0 – 6.0.1 | Marshmallow | 2015 |
7.0 – 7.1.2 | Nougat | 2016 |
8.0 – 8.1 | Oreo | 2017 |
9.0 | Pie | 2018 |
A Context is a handle to the system; it provides services like resolving resources, obtaining access to databases and preferences, and so on. An Android app has activities. Context is like a handle to the environment your application is currently running in.
Application Context: This context is tied to the lifecycle of an application. The application context can be used where you need a context whose lifecycle is separate from the current context or when you are passing a context beyond the scope of an activity.
Activity Context: This context is available in an activity. This context is tied to the lifecycle of an activity. The activity context should be used when you are passing the context in the scope of an activity or you need the context whose lifecycle is attached to the current context.
There are 3 CPU architectures in Android. ARMv7 is the most common as it is optimised for battery consumption. ARM64 is an evolved version of that that supports 64-bit processing for more powerful computing. ARMx86, is the least used for these three, since it is not battery friendly. It is more powerful than the other two.
Android uses DVM (Dalvik Virtual Machine ) rather using JVM(Java Virtual Machine).
Android application architecture has the following components:
-The onCreate() method is called once during the Activity lifecycle, either when the application starts, or when the Activity has been destroyed and then recreated, for example during a configuration change.
-The onStart() method is called whenever the Activity becomes visible to the user, typically after onCreate() or onRestart().
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.
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 emulator lets developers "play" around an interface that acts as if it were an actual mobile device. They can write and test codes, and even debug. Emulators are a safe place for testing codes especially if it is in the early design phase.
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.
Activities are what you refer to as the window to a user interface. Just as you create windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.
Intents displays notification messages to the user from within the Android enabled device. It can be used to alert the user of a particular state that occurred. Users can be made to respond to intents.
These are the essential items that are present each time an Android project is created:
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.
A Sticky Intent is a broadcast from sendStickyBroadcast() method such that the intent floats around even after the broadcast, allowing others to collect data from it.
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.
In Android development, an action is what the intent sender wants to do or expected to get as a response. Most application functionality is based on the intended action.
In general, a Nine-patch image allows resizing that can be used as background or other image size requirements 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.
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.
A Service is an application component that can perform long-running operations in the background, and it doesn't provide a user interface. It can run in the background, even when the user is not interacting with your application. These are the three different types of services:
bindService()
. A bound service offers a client-server interface that allows components to interact with the service, send requests, receive results. A bound service runs only as long as another application component is bound to it.-Service is the base class for Android services that can be extended to create any service. A class that directly extends Service runs on the main thread so it will block the UI (if there is one) and should therefore either be used only for short tasks or should make use of other threads for longer tasks.
-IntentService is a subclass of Service that handles asynchronous requests (expressed as “Intents”) on demand. Clients send requests through startService(Intent) calls. The service is started as needed, handles each Intent in turn using a worker thread, and stops itself when it runs out of work.
Handlers are objects for managing threads. It receives messages and writes code on how to handle the message. They run outside of the activity’s lifecycle, so they need to be cleaned up properly or else you will have thread leaks.
Job Scheduling api, as the name suggests, allows to schedule jobs while letting the system optimize based on memory, power, and connectivity conditions. The JobScheduler supports batch scheduling of jobs. The Android system can combine jobs so that battery consumption is reduced. JobManager makes handling uploads easier as it handles automatically the unreliability of the network. It also survives application restarts. Some scenarios:
The difference between them are as follows:
Service | Thread |
Service is like an Activity but has no interface. | A Thread is a concurrent unit of execution. |
A Service is not a separate process. It works in background until the service or someone else explicitly stop it. | By default, all components of the same application run in the same process and thread (called the “main” thread). |
Service is not killed when an application is killed. | Thread is killed when an Application is killed. |
It expose some of its functionality to other applications by calling Context.bindService(). | GOOGLE has brought in Handlers and loopers into android threads. |
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:
1
2
|
Intent i = new Intent(ACTION_VIEW,Uri.parse( "<a
href="http://www.edureka.co">http://www.edureka.co</a>" )); startActivity(i); |
The icon for an activity is defined in the manifest file.
<activity android:icon="@drawable/app_icon" android:name=".MyTestActivity"></activity>
This means that we have to open AndroidManifest.xml. Right under the root ‘manifest’ node of the XML, we can see the ‘application’ node. We have added this attribute to ‘application’. (The ‘icon’ in ‘@drawable/icon’ refers to the file name of the icon.)
android:icon="@drawable/icon"
We can use bundles to pass data to sub-activities. There are HashMaps that take trivial data types. These bundles transport information from one activity to another.
Bundle b=new Bundle(); b.putString(“Email”, “abc@xyz.com”); i.putExtras(b); //where I is intent
APK stands for Android Package Kit (also Android Application Package) and is the file format that Android uses to distribute and install apps. It contains all the elements that an app needs to install correctly on your device.
Just like EXE files on Windows, you can place an APK file on your Android device to install an app. Manually installing apps using APKs is called sideloading.
Normally when you visit Google Play to download an app, it automatically downloads and installs the APK for you. While you can extract APKs from the Play Store, they’re also available to download from alternative app stores.
Android apps are developed using Android Studio, the official IDE for Android software developers. It is available for Windows, Mac, and Linux, and it allows users to develop apps and prepare them for upload to a distribution service, such as Google Play. When apps are ready, developers can build them into APK files and sign them for release.