how to

How to handle screen orientation change issue in android?

Androidpeople.com Issue fix for handle screen orientation change and to avoid reloading activity when there is a change in orientation.

Android Sliding Drawer Tutorial

This is an simple example to use a Sliding drawer in application. The tutorial states the methods to change the handler button, animation style and specifying container height to the sliding drawer

Android how to create file in SD-Card-part 1.

Androidpeople.com-This tutorial discuss on Android methods to create a SD card in emulator, Creating a simple file in SD card and creating CSV file to generate report or Backup database.

Android URL shortener using tinyurl example

This snippet is example to generate tinyurl from original url.Uses tinyurl.com to generate url.Will be much useful in facebook and twitter android application.

Android how to send mail from code using email client

There is always a need of sending a mail from our application. In android the user will be able to invoke the mail client from code and send to desired mail id from.

For sending  the mail, the mobile or emulator’s mail client  should be pre-configured to a mail id.

Make sure you have enabled the pop3 setting in your email settings.

Android XML Parsing Tutorial - Using SAXParser

Android XML Parsing Tutorial - Using DOMParser
Here we are going to see about how to parse a XML using SAX Parser.
we are going to parse XML from net not from local file.
 
Files Used:-
XMLParsingExample.java ( Main Activity )
SitesList.java ( Getter & Setter Method )
MyXMLHandler.java ( XML Handling )
example.xml ( XML file from net )
 
The output will looks similar to
 

 

Android Custom Listview Tutorial- part 1

The simple android custom listview can assist only a single string, where its not possible to use them on all application. This leads to create custom list view example tutorial .
Step 1:
Add a normal listview in the main.xml layout and make sure u set the layout width as fill parent.
Main.xml

[sourcecode language="xml"]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView android:id="@+id/TextView01" android:layout_height="wrap_content" android:text="List of Country &amp; their denotation" android:textStyle="normal|bold" android:gravity="center_vertical|center_horizontal" android:layout_width="fill_parent"></TextView>
<ListView android:id="@+id/ListView01" android:layout_height="wrap_content"
android:layout_width="fill_parent">
</ListView>
</LinearLayout>

[/sourcecode]

Android How to check network status(Both Wifi and Mobile 3G)

There is always a need for a developer to check the network status of the network connected to the phone. Here are some example code to check the network status .

You need the following permission to get status

[sourcecode language="xml"]
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
[/sourcecode]

    

Android ListView with Searchbox Sort items

This article is next step of Listexample. Here we have a search box which sorts the list view as when the content matches the list items.

Why do we need this?

Imagine that if we have 2K to 3K items in the listview, It will not be possible to  scrolldown till 2000th item.In this case this will be handy to cut short items.

To start with we add a edittext box and Listview added to LinearLayout.

[sourcecode language="xml"]

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical">

<EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:hint="Search"></EditText><ListView android:id="@+id/ListView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" ></ListView>

</LinearLayout>

[/sourcecode]

Syndicate content