Beginner’s Guide To Android App Development

Garima Pandey
Software Incubator
Published in
10 min readFeb 13, 2021

“The difference between a successful person and others is not a lack of strength, not a lack of knowledge, but rather a lack of will.”

Do you want to build an app to be available to millions of users worldwide? Do you like developing on open platforms? If you answered yes to either of these questions, but don’t know how and where to start you’re at the right place. Keep reading, and this walkthrough will guide you through the basics of Android development and help you build a strong foundation in the same.

Maybe you create the next “hit app” that changes the way we work or interact with each other. Maybe you’ll develop a tool that you can use yourself to improve your workflow. Or perhaps you’ll just gain a new skill that lands you a great job!

What is Android?

Android is an open-source and Linux-based Operating System for mobile devices such as smartphones and tablet computers. Android being based on the Linux kernel, means that the basic operating structure is portable, multi-user, and able to handle complex multitasking.

Android offers a unified approach to application development for mobile devices which means developers need only to develop for Android, and their applications should be able to run on different devices powered by Android. The term “Android app development” as it relates to job opportunities covers a pretty fluid and extensive area of expertise and great career options right now! Fun projects, a wider pool of customers, greater innovative potential, ease of installation, compatibility with more devices, ease to learn, freelancing, and tons of job prospects are just some of the reasons developers are starting their journeys into the exciting world of the Android operating system.

Learning Android skills will open doors and make you a desirable developer across the board.

Pre-Requisites

Before you start with your app development journey, you must have the basics of Java or Kotlin all brushed up. You don’t need to be a walking encyclopedia of either of the two languages, just the basic understanding of OOPs and some other fundamental concepts will be enough for a beginner to start. The next skill up your way is XML, a markup language commonly used in Android development to declare a layout for the user interface (UI), dimensions, and strings. Now arises the big question: Java or Kotlin?

Both languages are officially supported by Google and Android Studio, but they have some distinct differences.

Java

Java has been supported by Google the longest and is what developers have been using to craft Android apps for years. Java is also one of the most popular programming languages in the world, which makes it a great choice for those who want to begin a career in development.

Kotlin

Kotlin on the other hand has become Google’s official choice for Android development. Kotlin is also significantly easier to get to grips with if you’re a complete beginner. Known for being much more concise and expressive, Kotlin helps alleviate some of Java’s drawbacks. For these reasons, Kotlin has become the language of choice for Android developers.

Kotlin is preferred over Java because the ease of learning and adoption is great. Kotlin also removes the boilerplate code, greatly eliminates possible errors such as the infamous Null Pointer Exception. Furthermore, most top apps have already ported to Kotlin. Also, once you become a whiz in any one of the languages with respect to android app development, switching to the other won’t be much of a daunting task.

Android Development tools

Alright, so now you have the basic programming skills up your sleeves, next you need to tackle some basic android development tools such as :

  • Android Studio IDE
  • Android SDK
  • Gradle build system
  • ADB(Android Debug Bridge)

Android Studio IDE

Android Studio is Android’s official IDE for native Android app development. Based on Intellij IDEA, Android Studio provides the fastest possible turnaround on your coding and running workflow. Android Studio provides an intelligent code editor, flexible build system, real-time profilers, debugging and testing tools, and emulators all within an easy-to-use drag-and-drop interface. It is free to download and is supported not only by Google but also by a large and actively engaged community of Android developers.

Android SDK

The Android SDK is the official development kit for Android app development. It is composed of modular packages that can be separately downloaded from the Android SDK Manager, including SDK tool, Google API, Android support, Android Debug Bridge (ADB), and more. You should always keep your Build Tools component updated by downloading the latest version using the Android SDK Manager.

Gradle build system

Google endorsed Gradle as a build system for Android apps. Based on Apache Maven and Apache Ant, Gradle is one of the most popular development tools for creating large-scale applications involving Java and Kotlin. Developers like using Gradle in conjunction with Android Studio because it’s very easy to add external libraries using a single line of code. With Gradle, you can deliver much faster builds.

ADB(Android Debug Bridge)

Android Studio includes the Android Debug Bridge, which is a command-line tool or “bridge” of communication between Android devices and other computers that can be used during development and the overall debugging process. By connecting an Android device to the development PC and entering a series of terminal commands, a developer is able to make modifications as needed to both devices.

Know the project structure of an Android App

If you strip an android app down to its core, you will find that it comprises a bunch of folders. They are as follows:

  1. Manifests Folder
  2. Java Folder
  3. res (Resources) Folder
  • Drawable Folder
  • Layout Folder
  • Mipmap Folder
  • Values Folder

4. Gradle Scripts

1. Manifests Folder

Manifests folder contains AndroidManifest.xml for your creating the android application. This file contains information about your application such as android version, metadata, states package for Kotlin file, and other application components.

2. Java folder

Java folder contains all the java and Kotlin source code (.java and .kt) files that you create during the app development, including other Test files.

3. Resource (res) folder

The resource folder is the most important folder because it contains all the non-code sources like images, XML layouts, UI strings for your android application.

res/drawable folder - It contains the different types of images used for the development of the application.

res/layout folder - The layout folder contains all XML layout files which are used to define the user interface of your application.

res/mipmap folder - This folder contains launcher.xml files to define icons that are used to show on the home screen.

res/values folder - Values folder contains a number of XML files like strings, colors, and style definitions.

4. Gradle Scripts folder

It contains number of files which are used to define a build configuration which can be applied to all modules in your application. In build.gradle (Project level) there are buildscripts and in build.gradle (Module level) plugins and implementations are used to build configurations that can be applied to all your application modules.

Introduction to UI

The user interface (UI) for an Android app is built as a hierarchy of layouts and widgets. The layouts are View Group objects, containers that hold other Views (or other View Groups) and control how their child views are positioned on the screen. Widgets are View objects, interactive UI components such as buttons and text boxes.

Illustration of how ViewGroup objects form branches in the layout and contain View objects.

The basic layouts used from the start are Relative and Linear for most purposes and rarely Frame Layout at the starting of Android Development. Now there are many layouts that came into existence but one that gained the most attention is Constraint Layout for aligning views and removing nested hierarchies. The second important layout is the Motion layout which gained popularity recently for its ease of handling animations. You can check out this awesome Udacity course for starting with User Interface - Android Basics: User Interface.

Explore more about layouts here.

Application Components

Once you are done with the UI, you need to handle it and that’s where Java and Kotlin enter the game. Kotlin(or Java) classes called Activities and Fragments hold the container layouts and display them to the users with clicks management, showing and hiding loaders as required, etc. Alongside these, there are other essential building blocks of an android application namely Services, Broadcast Receivers, Content Providers, etc.

Activity

An activity represents a single, focused screen that the user interacts with. Every activity contains a layout, which has a user interface to interact with the user. As every activity contains a layout associated with it, so it can be said that the activity class is the gateway, through which a user can interact programmatically with UI. An Android app may contain one or more activities, meaning one or more screens.

Fragment

A fragment represents a reusable portion of your app's UI. A fragment defines and manages its own layout, has its own lifecycle, and can handle its own input events. Fragments cannot live on their own-they must be hosted by activity or another fragment.

An activity has a lifecycle with callback methods where you can declare how your activity behaves i.e, the Activity class provides a number of callbacks that allow the activity to know that a state has changed: that the system is creating, stopping, or resuming an activity, or destroying the process in which the activity resides.

Activity Lifecycle

You can explore more about the activity lifecycle here.

Services

A service is a component that runs in the background to perform long-running operations. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity.

Broadcast Receivers

Broadcast Receivers simply respond to broadcast messages from other applications or from the system. For example, applications can also initiate broadcasts to let other applications know that some data has been downloaded to the device and is available for them to use, so this is the broadcast receiver who will intercept this communication and will initiate appropriate action.

Content Providers

A content provider component supplies data from one application to others on request. Such requests are handled by the methods of the ContentResolver class. The data may be stored in the file system, the database, or somewhere else entirely.

Once you get the hang of these basics, you can move ahead with some intermediate concepts like networking, threading, storage, etc.

Networking

The Android platform provides several Http clients thereby allowing connecting to the network, monitoring the network connection (including connection changes), and giving users control over an app’s network usage. It also describes how to parse and consume XML data. Android supports many libraries like Volley, Retrofit, etc. making networking a cakewalk. Go ahead and connect to the Internet! For more on networking, refer this course. Android Basics: Networking

Threading

When an application is launched, Android creates a thread of execution for that application called the main thread or UI thread. The main thread is nothing but a handler thread. Any block of code that needs to be run is pushed into a work queue and then serviced by the main thread. As the main thread does so much work, it’s better to offer longer works to other threads so as not to disturb the UI thread from its rendering duties. They’re executed synchronously, which means the UI will remain completely unresponsive until the task gets completed. To avoid this situation, they’re usually executed in separate threads, which avoids blocking the UI while the tasks are being performed. This means they’re executed asynchronously from the UI. Android provides many ways of creating and managing threads like Async Task, Handler thread, Thread Pool Executor, Intent Service, and many more. Use these services and get some work off of the main thread.

Storage

Android provides several options for you to save persistent application data such as Shared Preferences, Disk Storage, Databases, Network Connection etc. The option you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires. For more on Data Storage, refer the following course. Android Basics: Data Storage

Resources from Google and Android

“Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.”

The learning journey, however, doesn’t stop here. Once you are well acquainted with these fundamentals, you can continue with advanced concepts if you wish to go deeper down the rabbit-hole. If you’re still there, an awesome Android Development roadmap video awaits you! Android Development Roadmap video.

Head’s up! In no time you will be building apps that will make your resume stand out!

--

--