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..
In this post, we are going to develop a simple email application where you can send email.
What it is gonna do?
You have to enter the email ID, subject, message and hit send, on hitting send button you will be prompted with list of email clients installed in your mobile to choose. Choose email client,say GMail, information you typed in our application will be taken to GMail application. Now all you have to do is hit ‘Send’ in GMail application. 🙂
Let us begin with the development..
This post is all about how to use camera activity in your Android application. Let me give a quick glance of what we are going to develop today. We will have one image view and two buttons (one for taking picture and other for setting wallpaper) in our application. When you click Take photo button, will take you to default camera present in your device and capture the image. You can set the clicked image as your wallpaper just by clicking Set as Wallpaper button. Does it sound interesting?.. I hope YES.. 🙂
We had a quick glance on “What an android activity is?” in our previous post, here we are going to discuss about Life cycle involved in an android activity.
Activity in the system is managed as an activity stack. When a new activity is started, it is placed on the top of the stack and becomes the running activity — the previous activity always remains below it in the stack, and will not come to the foreground again until the new activity exits. It might be little bit confusing, let me explain it with an example:
Assume you open Facebook app in your android mobile, you are looking through the shares/posts posted by your friends and you are coming across one interesting web link posted by your friend. You click on the link to view what is there inside, it takes you to web browser and open up the website.
In this post, we are going to discuss about ‘Activity’, for newbies the term ‘Activity’ might be looking like a jargon. Let us discuss it with a very simple example.
What is an Activity?
Activity is a Java code that supports a screen or UI. In other words, building block of the user interface is the activity.
Activity class is a pre-defined class in Android and every application which has UI must inherit it to create window.
Let us create a simple application which displays current time when you just tap the window. We will dissect the code to understand how the activity works.