[Java for Android App Development] ahmadssb:
there is no L on package name ...

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapdemo"
android:versionCode="2"
android:versionName="2.1.0">
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>
<!-- Copied from Google Maps Library/AndroidManifest.xml. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<!-- End of copy. -->
<application
android:icon="@drawable/ic_launcher"
android:label="@string/demo_title"
android:hardwareAccelerated="true">
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".BasicMapActivity"
android:label="@string/basic_map"/>
<activity
android:name=".CameraDemoActivity"
android:label="@string/camera_demo"/>
<activity
android:name=".CircleDemoActivity"
android:label="@string/circle_demo"/>
<activity
android:name=".EventsDemoActivity"
android:label="@string/events_demo"/>
<activity
android:name=".GroundOverlayDemoActivity"
android:label="@string/groundoverlay_demo"/>
<activity
android:name=".LayersDemoActivity"
android:label="@string/layers_demo"/>
<activity
android:name=".LocationSourceDemoActivity"
android:label="@string/locationsource_demo"/>
<activity
android:name=".MarkerDemoActivity"
android:label="@string/marker_demo"/>
<activity
android:name=".OptionsDemoActivity"
android:label="@string/options_demo"/>
<activity
android:name=".PolygonDemoActivity"
android:label="@string/polygon_demo"/>
<activity
android:name=".PolylineDemoActivity"
android:label="@string/polyline_demo"/>
<activity
android:name=".ProgrammaticDemoActivity"
android:label="@string/programmatic_demo"/>
<activity
android:name=".TileOverlayDemoActivity"
android:label="@string/tile_overlay_demo"/>
<activity
android:name=".UiSettingsDemoActivity"
android:label="@string/uisettings_demo"/>
<activity
android:name=".RawMapViewDemoActivity"
android:label="@string/raw_mapview_demo"/>
<activity
android:name=".RetainMapActivity"
android:label="@string/retain_map"/>
<activity
android:name=".MultiMapDemoActivity"
android:label="@string/multi_map_demo"/>
</application>
</manifest>

MainActivity.java

/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.example.mapdemo;

import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;

import com.example.mapdemo.view.FeatureView;

/**
* The main activity of the API library demo gallery.
* <p>
* The main layout lists the demonstrated features, with buttons to launch them.
*/
public final class MainActivity extends ListActivity {

/**
* A simple POJO that holds the details about the demo that are used by the List Adapter.
*/
private static class DemoDetails {
/**
* The resource id of the title of the demo.
*/
private final int titleId;

/**
* The resources id of the description of the demo.
*/
private final int descriptionId;

/**
* The demo activity's class.
*/
private final Class<? extends FragmentActivity> activityClass;

public DemoDetails(
int titleId, int descriptionId, Class<? extends FragmentActivity> activityClass) {
super();
this.titleId = titleId;
this.descriptionId = descriptionId;
this.activityClass = activityClass;
}
}

/**
* A custom array adapter that shows a {@link FeatureView} containing details about the demo.
*/
private static class CustomArrayAdapter extends ArrayAdapter<DemoDetails> {

/**
* [MENTION=955119]param[/MENTION] demos An array containing the details of the demos to be displayed.
*/
public CustomArrayAdapter(Context context, DemoDetails[] demos) {
super(context, R.layout.feature, R.id.title, demos);
}

[MENTION=439709]override[/MENTION]
public View getView(int position, View convertView, ViewGroup parent) {
FeatureView featureView;
if (convertView instanceof FeatureView) {
featureView = (FeatureView) convertView;
} else {
featureView = new FeatureView(getContext());
}

DemoDetails demo = getItem(position);

featureView.setTitleId(demo.titleId);
featureView.setDescriptionId(demo.descriptionId);

return featureView;
}
}

private static final DemoDetails[] demos = {new DemoDetails(
R.string.basic_map, R.string.basic_description, BasicMapActivity.class),
new DemoDetails(R.string.camera_demo, R.string.camera_description,
CameraDemoActivity.class),
new DemoDetails(R.string.events_demo, R.string.events_description,
EventsDemoActivity.class),
new DemoDetails(R.string.layers_demo, R.string.layers_description,
LayersDemoActivity.class),
new DemoDetails(
R.string.locationsource_demo, R.string.locationsource_description,
LocationSourceDemoActivity.class),
new DemoDetails(R.string.uisettings_demo, R.string.uisettings_description,
UiSettingsDemoActivity.class),
new DemoDetails(R.string.groundoverlay_demo, R.string.groundoverlay_description,
GroundOverlayDemoActivity.class),
new DemoDetails(R.string.marker_demo, R.string.marker_description,
MarkerDemoActivity.class),
new DemoDetails(R.string.polygon_demo, R.string.polygon_description,
PolygonDemoActivity.class),
new DemoDetails(R.string.polyline_demo, R.string.polyline_description,
PolylineDemoActivity.class),
new DemoDetails(R.string.circle_demo, R.string.circle_description,
CircleDemoActivity.class),
new DemoDetails(R.string.tile_overlay_demo, R.string.tile_overlay_description,
TileOverlayDemoActivity.class),
new DemoDetails(R.string.options_demo, R.string.options_description,
OptionsDemoActivity.class),
new DemoDetails(R.string.multi_map_demo, R.string.multi_map_description,
MultiMapDemoActivity.class),
new DemoDetails(R.string.retain_map, R.string.retain_map_description,
RetainMapActivity.class),
new DemoDetails(R.string.raw_mapview_demo, R.string.raw_mapview_description,
RawMapViewDemoActivity.class),
new DemoDetails(R.string.programmatic_demo, R.string.programmatic_description,
ProgrammaticDemoActivity.class)};

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

ListAdapter adapter = new CustomArrayAdapter(this, demos);

setListAdapter(adapter);
}

[MENTION=439709]override[/MENTION]
protected void onListItemClick(ListView l, View v, int position, long id) {
DemoDetails demo = (DemoDetails) getListAdapter().getItem(position);
startActivity(new Intent(this, demo.activityClass));
}
}