Lets see what a Context is… Context : Current State of the application. Context : Handle of the application. Context : Provides access to the resources, preferences, accessing database etc. Activity inherits from the Context. Context is the most important part of the Android application and its everywhere. If you wrongly use Context, it can lead to memory… Read More »
The Canvas can be used to draw graphics in android. It provides methods to draw oval, rectangle, picture, text, line etc. The Paint class is used with canvas to draw objects. It holds the information of color and style. In this example, we will draw some 2D Shapes. We will create class that extends View and use Canvas… Read More »
This demo will show how to 1. Create and add a new Notification, 2. How many notifications are active in the current Application? 3. Delegate method for Notification Deletion. For Adding a Notification we can use the following snippet. For reading the number of currently Active notifications we can use To know when a Notification is deleted. ActiveNotificationActivity.java… Read More »
Hello all previously I have shown how to list all contacts in your phone and in another post I showed how to programatically create a contact in android. In today’s tutorial I will show you how to delete a contact in android programatically. This simple code does that.
Hello everyone… I have shown in my previous tutorials on how to create notification in android and cancel it. This is the post showing this . Now today I am going to show how to send data when you click on the notification message. Here I am creating two activities. One the main activity that creates the notification… Read More »
Here is a simple example to show two listviews horizintally in android. here is the java code that sets up the list. Here is the main.xml file. Here is the layout for each row in the list . Here is the complete source code for this example.
Hello all……….. Android has been absoultely wonderful for customizing widgets. I have shown a lot of example to customize ListViews, spinners etc. Today I will show you how to customize gridviews. Using this method you can actually place anything inside a gridview even a webview also. So here we start. We customize a gridview by creating an adapter… Read More »
Hello…. In today’s tutorial I will show you how to style your text in ANDROID. This is a simple example to show how styling is done using XML in android. This will also show you how to get a string from the resources in java code. First create a new project and name it “StyleTextDemo” and copy this… Read More »
Actually these are done using services in ANDROID. These are called BroadcastReceivers.Your class has to extend the BroadcastReceiver class to get these broadcast events. But note that these services need to have an interface. So you will not see any UI on the device. But don’t think your application is not running or not installed. Look at the… Read More »
What is context menu? Where it is used? How it is used? I will cover all these questions… Context Menu A context menu is conceptually similar to the menu displayed when the user performs a “right-click” on a PC. You should use a context menu to provide the user access to actions that pertain to a specific item… Read More »
The following example shows how to draw a rectangle using the Paint Class in ANDROID. Just copy and paste the following code to your file and you are done.
This code will set your ringtone for ANDROID. To set a ringtone you have to add it to the database. otherwise it will not be set also gives no error also. Insert it into the database