Android App Development

Android is an open source operating system developed by Google, for mobile devices such as mobile phones, smartwatches, automobile cars and televisions. Android is based on Linux kernel, and provides APIs for software development, mainly in Java — and other languages, such as C++, Kotlin etc. Android operating system comprises of a lot of software APIs, that utilize the Linux kernel and mobile hardware heavily to provide best features and services to the customers/end users of the device. The popularity of the Android device is due to the fact that they ship high-feature, productive, rich and low-cost mobile software, which is not as much bloated as legacy operating systems for mobile devices used to be.

There are several components of Android system, that are highly in-demand from an app developer's point of view. As we go deeper, I will walk you through all of those components and teach you how to utilize them in your own applications, but for now let me give you a very quick overview of what Android system comes with and what you should know before getting your hands dirty with Android development.

Android Philosophy

Google has published the Android source as an open source project, not just due to the legal requirements (as in the Linux license, or something), but due to the fact that they wanted to be open and welcoming all community-led contributions to jump right in and be a part of the Android ecosystem. Primary operating system updates, and features are developed by Google and then they are uploaded on the open source repository for AOSP.

Android although was featured on Google mobile devices, such as Nexus, but mainly Android operating system is adapted by other OEM and mobile manufacturers, such as Samsung, HTC, LG, and so on. This makes Android a vast ecosystem of different flavors, in that it supports a different design philosophy in every device because each vendor will have their own UX guidelines for devices, each running the same Android applications and featuring a different set of UX and UI. Since Android is a major mobile operating system, that utilizes Linux kernel, Google has been working out and pushing updates to Linux kernel too, (giving back to the community, right!?) and this also gives Google a chance to support their own ideology and design philosophy for mobiles and operating systems.

Now that, we know how Google has granted permissions to users to develop their own flavors, we do know that Google is the default search engine when Android operating system launches. Google is installed, Google Mail, and other Google products come shipped with the operating system. Provided the high amount of mobile apps in Play Store, it is a wrong move to not-install the Play Store, even if the vendors have control over providing a set of apps and removing a set of apps.

Android believes in having a good interface, for the users, low-power consumption, better performance and good responsive designs for the applications. Android has the Material Design, as the core design philosophy for the applications, which believes in high visuals that guide the users as they interact with the applications. There are several sensors (as we will discuss down in the Android Hardware) in the Android devices, that provide high visuals to the users as they interact.

Having released Android Oreo (Android version 8.0), Google has again left Apple behind in most of the cases, yes, I did see Apple's product launch event for iPhone X... Period.

Android Design

At a very low-level, Android is a Linux distro for mobile devices. It features the same set of services and features that any other Linux derived desktop distro has to offer. However, since Android is a mobile platform, there are certain conditions that need to be met in order to support high productivity on a mobile device. Certain limitations include but are not limited to,

  1. Screen size
  2. Battery power
  3. Hardware features and sensors
  4. Software apps

And much more, in that the user must have the control over his device, while providing him with the services that his device has to offer.

Android stacks up the Linux kernel with some high-efficient and reusable modules written in C language, which provide the Android API for the developers to write their own versions of software applications in Java programming language. We will take a look at these in the programming sessions. But, the stack that builds up the Android system is written in C, and provides a modular approach at the framework itself. Android follows the same practices and concerns as daemons in Linux and provides services and broadcasts (see the Android Software Development below), this enables Android framework to be highly event-driven and reactive platform for high-end software apps.

Finally, since the framework is written heavily in C language, Google knew what they were doing but were unsure of what other developers might come up with, thus they create a virtual machine that takes care of memory and other tasks that an app might request. Dalvik is the virtual machine, dalvik is the executor of the Java code that is written by the programmer, the benefit of this design was to support,

  1. High-level features and abstraction from low-level API
  2. Memory management for programmers
  3. Abstraction from hardware — virtualization is basically used for abstract from hardware
  4. One framework to target; dalvik.

This way, the Android design supports both of the worlds, the programmers and the end users. Android APIs can be easily elevated by the programmers and end users can be ensured of the fact that their machines won't be hogged with too heavy complex tasks, because Android doesn't let bad practices go out in the production.

Android Development

Android is an open source project, and highly community-oriented project, in the sense that Google allows everyone to use the source code and build their own flavors on top of it. This requires the Android platform to be built as an API set, enabling every possible action in the framework to be controlled, while still having enough control on the framework that the user can control which operations can be performed by which application.

Android features a Java API endpoint, for almost every service or feature that Android platform has to offer, or the native hardware has to offer to the developer. This makes Android platform easy to use, because almost every component has been provided out to the developer as a Java class. A service object, a broadcast receiver and rest of the similar handlers are developed to allow the developers to write good software apps for Android platform.

But, there is a lock on top of each service, the lock of permissions. Android requires each app to request permissions from the user before accessing the resources. This enables the users to grant some permissions or to revoke them. Starting with Android 6.0 there are tools for the users to revoke a permissions after he has granted that permission, which means that only a subset of the services that a user enjoys can be provided and others, which he does not want or like have to shut down — user is the boss.

Android is an innovative platform, in the sense that community creates so many good services and features on top of Android, think of the Google VR, which is powered by Android platform and has been available in the market for a while. There are several other innovative services that come every day, and help users make the most of their devices!

Android Hardware

There is no such thing as Android Hardware (unless, there is one, of course 😄), this the concept of the usage and provision of mobile device hardware by Android platform. Android platform openly has the packages that allow developers to program against a specific hardware feature. Think of the following hardware features,

  1. Bluetooth
  2. Camera
  3. Gyroscope/Accelerometer etc.
  4. Biometric scanners
  5. Connectivity with devices

Android provides a high-level component that allows developers to program the devices to make the most out of the hardware available on the device.

For instance, think of a Camera application that provides your favorite filters, the software developer only has to tackle the problem of writing the software, Android platform itself on behalf of developer properly manages the communication with camera hardware and to capture the image. Same is the case with Bluetooth, Fingerprint scanners or rest.

Android Software

Android Software is a set of libraries and services written in C language, that stack over the Linux kernel. These services range all the way from native memory management, to hardware control, to communication software, to graphical rendering programs. Everything is written and is available inside the Android, which a programmer can utilize and make use of while programming.

Android software also takes care of security services, such as accounts management, native database management, network handling and exception handling to ensure that a device is properly running.

Android Software Development

Android software development, or app development is the process of writing software applications for Android operating system. In this website, this is a subcategory of the major category, 1Mobile Application Development, and overall it is the most widely used form of mobile development, you can have a good user base on a single Android platform, but your user base is incomplete if you are not targeting Android platform. Android can be programmed in, Java, C++, Go, and other languages and frameworks such as Xamarin (with C#) and Hybrid web apps with HTML, CSS and JavaScript.

Google officially supports Android programming with Java, C++ and Kotlin (Go language, officially, let me know of the link and I will add it here). Other third-party vendors (remember how I said Google supports community?) include the support of Xamarin to program Android applications in C# programming language, and then there are other vendors such as Apache Cordova guys, who support to program Android applications in HTML, CSS and JavaScript (these languages are covered in the Web Application Development category), and they all boil to only a few things, such as performance, feature support and so.

The tools that you can use to program Android applications are available, in all shapes and sizes — and prices too! You can download the tools and install them, the Android SDK is available free of cost and the tools such as Android virtual devices (also known as Android emulators) so that you can also run and test your applications before moving them into the production and public versions. Android applications heavily depend on the Activity objects, and the background Resource and Service controllers, you can always expand the reach of your applications to other components and services, but a typical application only majorly works with these elements.

Once you have developed the applications, you can upload them to the Play Store Developer Console where Google will then publish them to the markets, and your users can download and install them on their own devices. This is a very loooooong process, and I will try to break it down in the chapters down the street as we go deeper into Android programming.

Android Marketplace — a.k.a Google Play Store

For any Android software developer, it is needed that he first get an account as an Android Developer. You do so, by visiting the official Android Developer website and continuing with the purchase there. When I purchase the account, it had cost me around $25 and it may/may not be the same when you will sign up for an account. Thus it is always better to consult the documentations, instead of looking for a price here.

Nonetheless, once you have the account for Android Marketplace, or the Google Play Store Developer Console, you can continue to upload and publish your applications to the world and earn money from them. Developer Console lets you,

  1. Publish your applications to the world
  2. Track the usage and behavior of your applications as your users interact with them
  3. Publish and sell in-app purchases or subscriptions
  4. Get error reporting from your applications
  5. Create reports for your user base, such as geographical, demographical and other characteristics
  6. Grant permissions to certain groups of users to test your applications live, with their accounts

There is much more, that the Developer Console can offer you, and you can get more resources for building useful applications and monetizing the applications once you start your account there.

SUA

Setting up Android Studio

Android Studio is the official IDE supported by Google for Android development.