Android Intent example

Have you ever thought how you are navigated from one screen to another in Android application? Here is the answer. Intent – a jargon in Android is doing all the work at background. Go through the post, you will learn how to navigate from one screen to another.

What is Intent?

  • Intents are system messages, running around the inside of the device, notifying applications of various events, from hardware state changes (e.g.,an SD card was inserted), to incoming data (e.g., an SMS message arrived),to application events (e.g., your activity was launched from the device’s main menu).
Read More

Android notifications example

What is android notifications?

Definition from Android developers site:

A status notification adds an icon to the system’s status bar (with an optional ticker-text message) and a notification message in the notifications window. When the user selects the notification, Android fires an Intent that is defined by the Notification(usually to launch an Activity). You can also configure the notification to alert the user with a sound, a vibration, and flashing lights on the device.

What are we going to develop?

The application which we are going to develop will have two buttons – one to trigger notification and other to clear the triggered notification.

Read More

Android RelativeLayout example

What is Android layout?

Layout denotes the architecture of the application, where and how the controls should be organized in the UI.It defines the layout structure and holds all the elements that appear to the user.

Android allows us to create layouts for the applications using simple XML file and those layouts must be placed in /res/layout folder.

We can declare the layout in two ways and here we will discuss first way of doing it:

  1. Declare UI elements in XML
  2. Create UI elements at runtime using Java.
Read More

Android LinearLayout example

What is Android layout?

Layout denotes the architecture of the application, where and how the controls should be organized in the UI.It defines the layout structure and holds all the elements that appear to the user.

Android allows us to create layouts for the applications using simple XML file and those layouts must be placed in /res/layout folder.

We can declare the layout in two ways and here we will discuss first way of doing it:

  1. Declare UI elements in XML
  2. Create UI elements at runtime using Java.
Read More

How to turn on/off only camera flashlight – simple torch example

In this post, we are gonna develop a simple torch application which uses android device’s flashlight. Application will have only one button at the center of the layout which is used to turn on/off the camera flashlight.

When you press ‘Torch-ON’ button, our program calls system packages to turn on flashlight and the button text is changed to ‘Torch-OFF’ . Similarly when button is pressed again, it calls system packages again to turn off flashlight and changes the button text to ‘Torch-ON’.

Let us begin..

Read More
Page 20 of 22« First...10...1819202122

Pin It on Pinterest