Skip to main content

Posts

Showing posts from April, 2016

ListView - Android Tutorial

In this tutorial i will be demonstrating how to build simple android ListView . This article is about creating listview and launching new activity on selecting single list item. Now follow the coding 1. Create the project 2. Extend your MainActivity class from ListActivity 3.  Now we need a string resources file to store all list item labels. So create an XML file under values folder     and name it as list_data.xml  and paste the following code.    ( Right Click on  res/values ⇒ New ⇒ Android XML File ) list_data.xml <? xml version= "1.0" encoding= "utf-8" ?> <resources>      <string-array name= "android_versions">          <item> Cupcake </item>          <item> Donut </item>          <item> Eclair </item>         <item> Froyo </item>   ...

How to Import file from external storage - Android Tutorial

In this example, we can see how to import the file in external location . Fetching the data from that file and show it in Log-cat as well as in List-view.   This simple example, contains one button (Click to import from SD card) to access the file data from an external location. Now follow the coding to develop this simple application     Create a New Project 1. activity_main.xml <RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"      android:layout_height="match_parent"     android:paddingBottom="@dimen/activity_vertical_margin"     android:paddingLeft="@dimen/activity_horizontal_margin"     android:paddingRight="@dimen/activity_horizontal_margin"     android:paddingTop="@dimen/activity_vertical_margin"     tools:context="com.example.r...