Pages

Showing posts with label 16. Show all posts
Showing posts with label 16. Show all posts

Friday, May 13, 2016

Simple ListView Android Developer Tutorial Part 16

From exploring the various concepts related to fundamentals and to locations and maps, I would like to look at a few UI elements.


One of the simple views is a List View. In this post, I will explore a very simple list view using all the defaults provided by Android SDK and introduce you to a customized list view in the next blog article.

A List View, by name means being able to display a list of items in an order one below the other. For creating such a view, the first thing we have to do is extend the ‘ListActivity’ (android.app.ListActivity) instead of the normal Activity class.

So, here is how the class declaration should look:

public class MyListView extends ListActivity {
The ListActivity class provides a way of binding a source of data (an array or a cursor) to a ListView object through a ListAdapter.

In android, we all know that views are defined declaratively in XML files. It is the same here too. So, if we were to create our own custom ListView, we would have a declaration of this type:

<ListView android_id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000fff"
android:layout_weight="2"
android:drawSelectorOnTop="false">
</ListView>

However, if no ListView is declared, the ListActivity picks up a default ListView which fills the screen. So, in our example we will not declare any list view.

There is one more thing we need to define and that is how each row in the list should show up. This again, there are some defaults available which have names such as simple_list_item_1, simple_list_item_2, and two_line_list_item. So, in our example, I do not declare the layout for the rows but I will be using one of the defaults provided. So, in effect, I have not declared any layout – I am using the default screen layout and row layout.

Now, that we have the layouts out of our way, what else do we need for a List View. Of course, the list of data that needs to be displayed. Just to keep it simple, I will use an array of data for the same. So, here it is:

static final String[] PENS = new String[]{
"MONT Blanc",
"Gucci",
"Parker",
"Sailor",
"Porsche Design",
"Rotring",
"Sheaffer",
"Waterman"
};

Now, how do I bind this data to the default views described earlier? This is aided by a ListAdapter interface hosted by the ListActivity class that we have extended.

We need to use the setListAdapter(..) method of the ListActivity class to bid the two (data and view). Android provides many implementations of the ListAdapter. We will use the simple ArrayAdapter.

What does the ArrayAdapter expect?

It expects the context object, the row layout and the data in an array.

So here it is:

setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, PENS));
With this we are done in creating the ListView.

I have added a small piece of code to show we can handle events on selecting an item in the list, by overriding the protected method shown below:

protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Object o = this.getListAdapter().getItem(position);
String pen = o.toString();
Toast.makeText(this, "You have chosen the pen: " + " " + pen, Toast.LENGTH_LONG).show();
}

This toasts a message with the item selected.

The complete code is downloadable here.

Read More..

Monday, May 2, 2016

FOX News v1 0 16 Free

Introducing the first and only news application for Android from the #1 name in news, the FOX News Channel. With the FOX News Android App - receive FOX News Alerts, read headline news stories, stream the latest video clips, listen to FOX News Radio, and browse through photo galleries, all for FREE!

Whats New
- General bug fixes and improvements


Read Here: How to Install APK

Requirements: Android 1.6+
File Size: 2.39 MB
Download Link: Mediafire.com
Read More..

Thursday, April 28, 2016

:p>

tablayout,or,tabbed,view,android,developer,tutorial
Read More..

Thursday, April 21, 2016

The silent Age 2 0 16 Unlocked Mod Android Obb Download

The silent Age 2.0.16 Mod Apk Data Files Unlocked Download

The silent Age 2.0.16 Mod Apk Data Files Unlocked Download iAndroGames 

Note: Download All The Parts Provided and extract any of them, it will automatically extract all the parts. Install .apk File And place data folder in SDcard/Android/obb/ and Start playing.

DOWNLOAD LINKS

 

Download From PlayStore
Click Here For APK+Data Files Download
Read More..

Monday, March 28, 2016

Free Download Resident Evil 5 PC



resident evil 5 game 2009 (Biohazard 5)
resident evil 5 game is also known as Biohazard 5 in japan and released in 2009 both Microsoft windows and Playstation3 Xbox360. This is sixth installment by Capcom production and THQ both developer and publisher of resident evil 5 game for the PlayStation 3,Microsoft Windows and Xbox360.

Published & Developed: Capcom

Released: 2009
Platforms: PlayStation 3,Microsoft Windows and Xbox360
Genre: Survival horror
Mode: Single Player, Multiplayer
Media: Optical disc all , DVD-ROM

resident evil 5 game 2009 (Biohazard 5) Requirements:

• Windows XP / Windows Vista
• Pentium D / Core to Quad CPU
• GPU Nvidia 256 / ATI 512
• RAM 1 / 2 GB DDR2
• 5 to 6 GB Hard Disk Space needed
• PS2 Keyboard and Mouse

Resident Evil 5 Game
See The Trailer Bellow



Download Now 



Read More..

Saturday, February 13, 2016

Spirit Run Free Shopping No ADS Android Game Moded


salam blogger :)
Sudah larut malam, cepet bgt perasaan tadi sejam yang lalu baru aja bangun sekarang udh tidur lagi. -.-. oke deh langsung ke topik, Game ini bergenre running man. dmna ada character yg dikejar2 oleh monster dan ia belari. ah pokoknya seperti itulah haha. tp disini character nya bisa berubah jadi hewan. dan tiap char  beda perubahannya ada serigala sampai panda. oke deh langsung saja gan. cek itt :

Details Game: 
Name      : Spirit Run
Genre      : Runing man
Platform  : Android 
Requires  : Android 4.2  and up

Modification on Game: 
- Free Shopping
- No Ads

Review Modif:

Screenshoot:

Tutorial Instal : 
1. Download game. 
2. Pindahkan Game ke Androidmu.
3. Uniinstal Version originalnya, jika ada.
4. Instal MOD apk & Play
5. Enjoyyy 


|Download|
Spirit Run - Free Shopping & No ADS[Android Game : Moded]

|Download Original game|
On Playstore




#Salam Blogger
#Semoga bermanfaat :)
#Ask? comment :)
Read More..