Category Archives: ANDROID

How to create a Slide from Left animation while deleting a row from a ListView in Android?

By | September 13, 2012

Hello all…… I have written a lost of posts on Listviews. You can see that by just searching Listviews in my site. Today I will show you how to create a slide out animation while we delete a row from a ListView. So this is the xml that contains the ListView. Let it be in… Read More »

How to read and write files to SDCARD and application SandBox in Android – A complete example?

By | February 14, 2016

Here is a complete example of How to read and write files to SDCARD and application SandBox in Android. First create a new project and inside the mainActivity paste this code. Now create another class named MyFile.java and copy this code into it. Now the layout for the xml file. Note you should give this… Read More »

How to show two different DatepickerDialogs on same activity with only one listener function in android?

By | September 5, 2012

In android for each time picker Dialog we can associate with a dialog. So with this dialog and a global variable we can have any number of Dialog listeners. Here is the sample java code. This is the layout file – main.xml MyAndroidAppActivity .java Please leave your valuable comments on this post.

Android – JellyBean Features

By | August 31, 2012

Some new features introduced in Jelly bean are listed below: Offline voice typing: In contrast with the conventional SIRI assistant, voice dictations in Jelly bean can be done in flight mode or without an internet connection. All the phrasing and voice processing is performed locally, i.e. by the phone processor itself. No server interaction is… Read More »

Which you think is the best – Android or iPhone?

By | August 25, 2012

This is a question that has been here since 2007. We know there are many advantages for Android phones and Apple’s iPhone. So what you think, which one is the best. I will say my personal opinion. And I think Android is the best. What is your opinion? Are you an iPhone or ANDROID User?… Read More »

How to start with ActionBar in Android?

By | May 2, 2013

With Android 3.0 Google eliminated the need of hardware menu button which is replaced by Action Bars. Here is a quick example on how to use ActionBars. First create a new project and name it ActionBarExample. Now create a folder named “menu” in res folder and create a new XML file inside it named “action_bar_menu.xml”.… Read More »

Uploading and Downloading of files – Popular and Useful posts from CoderzHeaven

By | August 31, 2012

Here are the links of my most popular posts on downloading and uploading of files to and from your android device. 1. How to download a file from a remote site in android? – Another simple example – Method -3 2. How to download a file to your android device from a remote server with… Read More »

How to set different layouts for Portrait and Landscape in Android?

By | May 2, 2013

This simple example shows how to set different layouts for portrait and Landscape in Android. If you need a detailed explanation please check this url http://developer.android.com/guide/practices/screens_support.html Android Supports these different categories of screens. 1. xlarge screens are at least 960dp x 720dp 2. large screens are at least 640dp x 480dp 3. normal screens are… Read More »

How to stream an audio in Android?

By | August 16, 2012

This is a simple example to how to stream an audio in android. Here is the java code for that. This is the xml that contains the button. When you run this program you will see a button and on clicking on that button you will see a dialog with message “Buffering…..”. Once the buffering… Read More »

How to load an image from the assets folder in android?

By | August 16, 2012

Here is a simple example showing how to load an image stores in assets folder in android? Done.

How to read a serialized object from a file in the raw folder in android?

By | May 12, 2013

In my previous post I showed how to serialize an object and save it in sdcard in a file and retrieve it. Pull out the file from the sdcard and then create a folder named “raw” inside the “res” folder and copy it. This example shows how to retreive it when it is in the… Read More »

Serialization in Android – A Simple example.

By | July 19, 2012

Serializing a class file provides a fast and efficeint way to store information produced by your application! What is serialization? Serialization is essentually taking a screenshot of a class file and its contents. For example, lets say you have the following class: Now we will save this data to a file in the SDCARD. Make… Read More »

How to remove title from AlertDialog in android?

By | August 23, 2012

Hello all.. Today I will show you two simple ways to remove title in an android alertdialog. Actually you can do this in two methods. Method 1 That takes a custom layot file, inflates it, gives it some basic text and icon, then creates it. Method 2 But it doesn’t work when creating an AlertDialog… Read More »

A Simple FlashLight Application.

By | July 21, 2012

Here is a simple Application on how to use flashlight in android. Now the layout file main.xml. AndroiManifest.xml file contents. Make sure to add the permissions. Download the android java source code from here. please leave your valuable comments on this post.

How to make a http call repeatedly from a service in android?

By | July 20, 2012

We may have applications in which we may have to make repeated calls to a webservice. At that time services may be useful. This is such an example in which we will be creating a Service in android to create a repeated call to a webservice in a time delay of some seconds or milliseconds.… Read More »

Creating a custom Sliding GalleryView with Paging in android

By | June 17, 2012

This is a simple example showing A sliding Gallery in android. This example shows a sliding gallery with a paging Control and a changing page text which also indicate the page change. Create a new project named “SlidingGallery” and copy this code into “SlidingGalleryDemo.java“. My Activity name is “SlidingGalleryDemo.java” here. Now create a new class… Read More »

How to delete a contact in android?

By | June 30, 2012

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.

How to add a new contact programmatically in android?

By | February 16, 2016

We all know how to add a new contact to our android devices without programming right. OK that’s a normal man’s use. But what from a programmer’s view. This is the sample java code that helps you to add contact programatically. After running this programs please switch to contacts application on your device to see… Read More »

Placing Controls in a Widget in Android and Listening to the events from them.

By | June 10, 2012

Hello everyone.. I have already shown how to create a simple widget and add it to the home screen in my previous posts. If you have missed these posts please check it here. How to create a widget in android? In the next post I showed you how to listen to a widget delete action… Read More »

iOS 6 Has Been Jailbroken

By | June 14, 2012

That didn’t take very long. Just three days after being announced, iOS 6 has been, as the cool kids say, pwned by the Dev-Team with Redsn0W 0.9.13dev1. As hinted earlier this week the jailbreak doesn’t work with the iPhone 4S, but only the iPhone 4, iPod touch 4G, and the iPhone 3GS. There are some… Read More »

Android hits 900k activations per day

By | June 11, 2012

The Google Android Army is coming again… Google’s Android platform sees 900,000 activations a day, according to a tweet from Android head Andy Rubin. The statistic, of course, doesn’t distinguish between smartphones and tablets, so it’s hard to get a clear picture of the Android ecosystem. See more about this new from here. http://www.washingtonpost.com/business/technology/android-hits-900k-activations-per-day/2012/06/11/gJQA1tlfUV_story.html

How to get Notified when a widget is deleted?

By | June 8, 2012

I have already covered a tutorial on how to start with widgets and how to create a simple widget here.. http://www.coderzheaven.com/2012/06/07/create-widget-android/ Today I will show you how to get notified when a widget is deleted. if you have already gone through my previous post, then there is only a small change in the “MyWidget.java” file.… Read More »