Nearly everyone these days owns a smartphone. This wouldn’t be possible, however, without apps. The smartphone is just a gadget, it’s actually the apps that make it ‘smart’. Apps have become part and parcel of everyday life, with some people even making a living solely through them.

But what goes behind the scenes in making these apps? In this post we’re going to look at Android app development from a programming perspective.

The Programming Language

Android app development uses two main programming languages – Java and XML. Therefore it is absolutely necessary for you to have knowledge and experience in coding using these languages. In theory, you could learn Java as you learn Android development, but this isn’t the right way of doing things. In order to develop a high quality app, mastery over Java and XML is a prerequisite.

Some Java programming fundamentals include:

  • Objects and classes
  • Inheritance and interfaces
  • Packages
  • Collections
  • Concurrency

Simple knowledge of the above-mentioned items isn’t enough. You should be a master of these concepts to develop quality Android applications.

Development Tools

Familiarization with build automation tools and integrated development environment (IDE) is very important before you start developing your app. Selection of the IDE will come down to personal preference. For beginners, Android Studio and Eclipse are recommended as they help you learn basics and improve your code. You can also try Apache Maven, Ant and Gradle as they have powerful tools and features to help manage your builds.

If you’ve done programming projects before, you must be aware of source control tools and concepts. If you haven’t, learn git and create a git-source repository using BitBucket or GitHub.  

Android Application Components

Android apps are comprised of application components, you can call these the building blocks of apps. These components represent points of entry for the app by the system. Although each of these components is autonomous and plays a specific role, some of these might be dependent on each other.

Each app component has a distinct lifecycle which defines how it is created and destroyed during typical app usage. Let’s look into these components in a little more detail:

Activities

An activity of an Android app represents a single screen coupled with its user interface. For example, a note-taking app may have one activity showing a list of all notes, another activity for editing a note, and another for viewing a note.

If you open up an Android app right now, each screen of the user interface you see will be an activity. One activity can pass data to another, and together these activities form the combined user experience.

Intents

An Android app comprises of multiple activities, which have to invoke each other for user navigation. Intents are what are known as activating components, and are used to activate other components such as activities, services and broadcast receivers.

Broadcast Receivers

A broadcast receiver responds to system-wide broadcast announcements and results in something being done, broadly speaking. For example, when the user receives a text message, a broadcast receiver will generate a notification pop-up in the interface.

It should be understood that broadcast receivers themselves are not a part of the user interface. They work minimally in the background and are triggered by system-wide broadcasts.  

Services

Services run in the background to perform work for a variety of processes or long-running operations. Services do not have a user interface, rather they just carry out background tasks. For example, a music app might keep playing music through the use of a background service when you exit it .

Content Providers

Content providers are responsible for managing an app’s data. Through content providers, you can query or modify app data that is stored either in the file system, the web, or an SQLite database. Content providers can also be used for read/write operations on data that is private to your app.

Android Fragmentation

Back in the day, fragmentation used to be a huge hurdle for Android developers. Android devices such as smartphones and tablets are manufactured by a variety of companies. These devices are made of varying components and not all of them have the latest version of Android installed.

For example, in October 2018 Android 7.0 Nougat was the most popular version of the OS across the world followed by Android 6.0 Marshmallow, even though Android 8.0 Oreo had been out for nearly a year. Device manufacturers are slow to update older devices to newer Android versions, so you need to design apps that cater to all the popular versions of the OS.

Bear in mind however that the more versions your app caters to, the more maintenance and testing that needs to be carried out for a stable user experience. Even modern devices that all come with the latest version of Android, come with differing screen sizes and aspect ratios. As such, you need to choose the appropriate fonts, assets and layouts to ensure the best possible user experience.

Making the Right Choices for User Experience

At the core of any successful Android app is an excellent user experience. Apps should be developed to simplify and not create problems. Here are a few parameters to keep in mind when developing an Android app:

Minimal Lag

Make sure to code your app in such a way that the UI thread is never blocked. Input lag of just 100ms is noticeable for users, so you have to make sure the UI is super responsive and can tackle any non-routine issues caused by the app.

Performance

If you code an app that is not efficient about resource usage, it’s immediately going to be noticed by the user and the operating system. If a user input goes without a response for 5 seconds from your app, the Android OS will give the user an option to force close the app. This is of course very detrimental to the user experience, and could lead to bad reviews.

Phones have Limited Resources

Always remember that you’re creating an app for a handheld device, not a PC that is plugged in all the time. Make sure to code it as efficiently as possible, so it uses the least amount of computing resources as possible. Even though flagship mobile processors of today are quite powerful, many users have older or low end smartphones.

Wakelocks, mechanisms that prevent a device from going to sleep, should be used sparingly. If your app uses the smartphone’s onboard sensors, do not poll them unnecessarily as that can lead to a sharp decrease in battery life for the phone. And if a user feels your app is a battery hog, you can bet they’re going to look for alternatives.

Conclusion

We can safely say that nearly everyone owns a smartphone these days. In fact, 77% of Americans do, and apps are where they spend the majority of their time. Hundreds of billions of apps are downloaded each year, so demand for Android app development is sure to grow even more.

Developing an Android app is an exciting experience, as it’s as much about coding as it is about user experience. Developing a high quality Android app takes a lot of skills and learning, but it can be done if you’re up for the challenge.