1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Android MapView Tutorial


Last Updated:

  1. garethcwilliams

    garethcwilliams New Member This Topic's Starter

    Joined:
    Jan 17, 2010
    Messages:
    1
    Likes Received:
    0
    Hey Everybody,

    I'm been trying to get to grips with Android and have been writing some simple apps and working through the tutorials.

    I'm having trouble with the MapView tutorial, lets start with the code which is:

    package​
    com.splashapps.maps;

    import​
    com.google.android.maps.*;

    import​
    android.os.*;

    public​
    class MapTest extends MapActivity {

    @Override

    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.
    main);
    }

    @Override

    protected boolean isRouteDisplayed() {
    return false;
    }

    }

    The manifest is:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.splashapps.maps"
    android:versionCode="1"
    android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name="MapTest"
    android:icon="@drawable/icon"
    android:launchMode="standard"
    android:screenOrientation="unspecified">
    <intent-filter>
    <action android:name="android.intent.action.MAIN"></action>
    <category android:name="android.intent.category.LAUNCHER"></category>
    </intent-filter>
    </activity>
    <uses-library android:name="com.google.android.maps"/>
    </application>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-sdk android:minSdkVersion="3" />​
    </manifest>

    The layout is:

    <?​
    xml version="1.0" encoding="utf-8"?>

    <​
    RelativeLayout android:id="@+id/RelativeLayout01"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    xmlns:android="http://schemas.android.com/apk/res/android">

    <​
    com.google.android.maps.MapView

    android:id="@+id/mapview"
    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:clickable="true"

    android:apiKey="0ujyc9Tw2cYvyPECIKTQIK0pwuL-UPa_sh4BpIw"/>

    </RelativeLayout>

    Now, the problem i get is the app crashes on startup, the KVM is complaining about not being able to resolve the superclass. The following is the logcat:

    W/dalvikvm( 947): Class resolved by unexpected DEX: Lcom/splashapps/maps/MapTes
    t;(0x43736190):0x192028 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/
    android/maps/MapActivity;(0x43736190):0x188088
    W/dalvikvm( 947): Unable to resolve superclass of Lcom/splashapps/maps/MapTest;
    (34)
    W/dalvikvm( 947): Link of class 'Lcom/splashapps/maps/MapTest;' failed


    as you can see, for some reason, its putting a capital 'L' in from of the name of the class, so can't find it. I'm sure this is something stupid I've done in setting up the class paths but can figure it out. Its driving me nuts....spent the last 3 hours trying to fix it :mad:

    If anyone could help me out in solving the problem, that would literally be amazing......

    Thanks in advance
     

    Advertisement
  2. parakayjay

    parakayjay Member

    Joined:
    Feb 10, 2010
    Messages:
    16
    Likes Received:
    0
    Hi,

    Did you ever get any answers with regards to the google maps problem in this thread?

    I'm having the same issue.

    Thanks,

    Jay
     

Share This Page

Loading...