In this post, we will learn about Broadcast receivers, an essential building block of Android system with a simple example.
What is Broadcast Receivers?
Broadcast Receivers is an Android implementation of system-wide publish/subscribe mechanism.
The receiver is simply a dormant code that gets activated once an event it is subscribed to happens.
The system itself broadcasts events all the time. For example, when an SMS arrives, or call comes in, or battery runs low, or system gets booted, all those events are broadcasted and any number of receivers could be triggered by them.
I sensed from the comments and mails.that developers are facing problem in importing existing Android project to Eclipse I decided to write a separate post on it which just discuss about how to import android project in eclipse.
I have also discussed the trouble shooting procedures to be followed when you face issues in importing Android project.
Step 1: Choose and download the project from here
Welcome back readers!! Before I start with the post, would like to say thanks for your constant feedback and appreciations which I am getting in mails.
In this post, we are going to develop a simple application which reads out the text you typed. Sounds nice??. Follow the post to create one for you. 🙂
Android SDK provides built-in package called ‘android.speech.tts’ to handle text to speech capabilities. It synthesizes speech from text for immediate playback or to create a sound file.
Let us start with the application development:
In this post, we will discuss about how to create a custom toast message in Android application. We usually see toast as a simple text message which pops up on the screen.
But we can create custom toast with images and more style attributes like padding, gravity, etc.You can create custom toast message shown below at the end of the post:
In this post, we will be discussing how to use seek bar in Android application. Before we start with the development, we will learn seekbar and its usage:
What is Seekbar?
A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys.
Usage: Seekbar can be used to adjust media player volume, set brightness of the screen, seek a playing music etc.
What are we going to develop?
We will develop a simple application to demonstrate how it is used to set Media player, Ringer, Alarm and Notification volume for your device.
In this post, we will be discussing about how to handle screen orientation changes in Android application. Users will often switch to landscape orientation for comfort or more horizontal screen space, but we must make sure that controls are accessible to User even if screen orientation is changed and also should feel comfortable to work on it.
We will take “Button listener” example(Button Listener – Make the cat start Meowing) to demonstrate how the controls change its position, size etc when the screen orientation is changed and also how to organize the controls when the orientation is changed to landscape layout.
Portrait and landscape view of “Button listener” application (Before adding landscape layout):
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:
- Declare UI elements in XML
- Create UI elements at runtime using Java.
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).