Almost all Android apps uses ListView – showing list of records, settings, songs, articles, and many other types of data a certain app can handle. An Android ListView is simply a vertically scrollable list of items.This tutorial will show you how to create a customized row in your ListView (with image and text). This is probably the simplest android ListView tutorial on the internet. Haha!
I remember using a ListView when I have to list records of location with its thumbnail, location name and date the data were taken.

Upper part of our ListView

Anyway, we are going to have Folders as our items on the list. Our code will have the following capability:

Include custom folder icon, folder name and description for each list item.

Show a toast when a user clicks on an item on the list (means we’re going to have an onClickListener)

Code Download

You can download the code here: (If you’re not familiar with Google Drive, you have to click on File > Download to download the code)Download Code

Files Needed

We are going to need only 2 JAVA files, 2 XML files and 3 custom icons.

MainActivity.java – We have two classes in this file, first is the MainActivity where we set each of our list item data and second is the small Folder class that will take care of our list item data such as the folderIcon, folderName and folderDescription.

XML parsing could be one of the most basic requirement on your Android application. In today’s tutorial, we are going to read XML files using three input sources. There can be three sources of your XML:

1. XML from device SD Card. Your dynamic XML file could be downloaded first for offline use.
2. XML from a URL. You could be parsing data from your online database or RSS feed. Works if device is online only.
3. XML from your app’s assets folder. Your XML file is not dynamic so it is better to put it in the asset’s folder where it cannot be change.

By the way, we’ll be using SAX parser here. I think that for mobile apps, SAX parser is better to use than DOM parser.

DOM parser consumes more memory because it loads the whole XML data to the device memory while SAX parser does an event driven approach. SAX parser processes each line of the XML without loading it to the device memory first.

ParsedDataSet.java – You can use your own object class if the XML you’re parsing is for a more specific data object. For example, you are parsing only for “Owners” and NOT “Owners & Dogs” like what we have.

Today we’re going to create a splash screen for your Android app. A splash screen is usually an image or a view that appears to the user while the app is loading, it is also a way to make your brand or logo easier to be recognize by the user. Some android apps that uses splash screens include Facebook, Pocket and of course, the game apps. I’m going to show you two ways to create android splash screens.

Example logo to be seen in our splash screen.

Splash Screen With Two Activities

The first way I’m gonna teach you is using two activities, the first activity will be our splash screen and the second activity will be our app’s main screen. The splash screen activity will be shown for four seconds and then it will show the next activity. Download the code here:

codeofaninja350pxwidth.png – An example image used in the splash screen. This is included in the code download.

Splash Screen with One Activity

The second way to create a splash screen is using just one activity – your MainActivity. It should be covered with an ImageView first and then after few seconds, it will disappear with a simple fade-out animation to make it look smooth. Download code this code:

Today I’m going to give you an android share intent example that you can use to enable your app to share contents such as URL or text and Image to other apps installed in your Android device like Facebook, Twitter, Messaging, Instagram, Evernote, etc.. Example uses of this code include:

Please note that when you use the setType() method, you are enabling Android to filter what apps can share your content. For example, you are sharing a text or URL, the appropriate apps to be shown can be Facebook, Messaging or Email. If you are sharing an image, proper apps can be Instagram, Snapseed or Picasa.

Today’s code output screenshots

Main screen.

Share Text or URL button was touched. Take note of the apps on the list.

User chose to share to Facebook

“Share Image” button was touched. Apps was different on the list.

User chose to share with Gmail. Our image was attached.

User chose to share to Snapseed.

If you have any suggestions to improve this post, please drop it in the comments section below! I’ll be glad to update this post for further improvement. Thanks for reading our Android Share Intent Example!