Android App Development Basics | Install Android Studio | Activities and Layouts

Key Concept

  1. Activities
    We use Activity to define what the App does. Like when we click on a button what needs to happen can be defined using an Activity. It’s a class written in Kotlin.
  2. Layouts
    To define how a screen in your App will look like we use an XML file. A screen can have various elements like images, text etc.

We use Layouts to define the UI and Activities to define the behaviour. Similar to what we do with websites – HTML, CSS and Javascript.

Like if you need to add a button then we use Layout to specify its position on screen and Activity to add functionality.

We bundle all these files together and that’s what an App is.

What happens when you start an App ?

Sequence of events when you start an Android App

  1. When you start an Android App the main activity is called.
  2. This tells Android to use a particular Layout.
  3. The layout is displayed on the device.
  4. The user interacts with the layout.
  5. The activity responds to these interactions, and updates the display.

Why Kotlin ?
It’s preferred because of additional features and it’s concise nature.

Why Android Studio ?
It includes a set of code editors, UI tools and templates, which are all designed to make development easier and faster.
It also comes with Android SDK which is needed to develop Apps. It includes Android source code and also a compiler to compile the code you write to Android format.

Getting Started

Install Android Studio from https://developer.android.com/studio

Build the App – follow the video

  1. Create a new project
  2. Select a project template – Choose the Empty Activity option.
  3. Configure the project – Specify the app name, package name and save location. Be careful with the version you select. We will discuss more on this in future blog, but you need to consider which versions of Android you want the app to be compatible with. If you specify that the app is only compatible with the very latest version of the SDK, you might find that it can’t be run on many devices.

That is it, your first app is ready. Congratulations !!

Leave a Comment

Your email address will not be published. Required fields are marked *