Android Basics – A closer look at the Relative Layout

In this Article you will Learn about the Relative Layout.

In the last post you saw how Android provides us with three Layout options – Relative, Linear and Grid.

Relative Layout will help you to position the UI components relative to the Parent or other UI elements.

In the following Video you will learn how to use this Layout.

Source Code : https://github.com/ankur-srivastava/HelloAndroid/blob/master/app/src/main/res/layout/content_main.xml

Android Basics – Learn about Relative, Linear and Grid Layouts

In this Post you will learn the basics of using Layouts. Layouts enable you to position the UI elements on the App Screens.

You can refer to the image and the video to understand the concept better.

You can use three types of Layouts

Relative Layout

Use this Layout to position the UI elements relative to each other.

Continue reading “Android Basics – Learn about Relative, Linear and Grid Layouts”

Android Basics – What is the Activity Lifecycle

Android Activity follows a Lifecycle from its time of creation till it gets destroyed. In this Article you will Learn about the Lifecycle.

As you can see in the attached diagram an Activity starts when its Launched. That’s the time its Constructor is run and object is created.

This is followed by the onCreate method which is responsible for Screen setup.

Continue reading “Android Basics – What is the Activity Lifecycle”

Android Basics – Using Handler and Runnable to Schedule Code

You will Learn about

  • Handler
  • post method
  • postDelayed method
  • Main Thread

Android runs every App in a separate Process for Security and Scalability.

So when you Run your App Android starts a Thread for the same.

A New Thread

Now if you want to run code which needs to run in the background then its recommended to use a separate thread for doing that.

This will not only improve user experience but also prevent delays and crashes.

Continue reading “Android Basics – Using Handler and Runnable to Schedule Code”

Android Studio 2 – Code change deployment in Real time, a Revamped Emulator and More

Android Studio 2 has introduced some great improvements. As an Android Developer you will appreciate the improvements introduced.

Some WOW Features

Instant Run

With this feature your code changes will be deployed in Real Time. A Full Build might not be required.

Improved Emulator

Running the new Emulator is faster than using the real device. Wow !!

The Emulator has a tool box now to enable features like screen rotation, screenshots and more. It uses SMP Support.

GPU Profiler

Now on IntelliJ 15

Offers improved Stability and lot of improvements.

The Studio also improves the build and deploy cycle process.

The Beta is now available for download.

Android Basics – Run your App on your Android Phone

Time to run your App on the Mobile Device. I have provided the Steps, Screenshots and a Video to help you with this.

You can refer to the Images and the Video to get your App up and running on your Mobile Phone.

Android Basics – Call an Activity in another App using Implicit Intent

It is possible to call an Activity in another App from your App by using an Implicit Intent.

In the last Article you saw how to use an Explicit intent to call an Activity in
the same App.

A Scenario can be if you want to send a Text Message when the user clicks on a Button in your App.

To achieve this you need to know a few basic concepts:

1. Action

In an Explicit Intent you need to specify the Action – like Email, Message, Call – basically what kind of Intents you want to use.

Continue reading “Android Basics – Call an Activity in another App using Implicit Intent”