map view problem

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

map view problem

Postby zak » Tue Sep 23, 2008 2:22 pm

hi! i have a problem. i'm creating my first map-application. when i launch my android emulator, it shows the messagge: "the application MapAndroid(process android.map)has stopped unexpectedly. please try again"
i don't know where is the problem,maybe i have forgotten some code, anyone could hep me? please! thanks

my code is following:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class MapAndroid extends MapActivity {
  2.  
  3. @Override
  4. public void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(R.layout.main);
  7.  
  8. }
  9.  
  10. @Override
  11. protected boolean isRouteDisplayed() { return false; }
  12.  
  13.  
  14.  
  15. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4



Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2. android:orientation="vertical" android:layout_width="fill_parent"
  3. android:layout_height="fill_parent">
  4.  
  5. <view class="com.google.android.maps.MapView"
  6. android:layout_width="fill_parent"
  7. android:layout_height="fill_parent"
  8. android:layout_weight="1" />
  9.  
  10. <EditText android:layout_width="fill_parent"
  11. android:layout_height="wrap_content"
  12. android:text="enter address to search..."
  13. android:selectAllOnFocus="true"/>
  14. </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
zak
Freshman
Freshman
 
Posts: 8
Joined: Tue Sep 23, 2008 8:42 am

Top

Postby michels » Wed Sep 24, 2008 12:43 pm

Hey zak,

just some suggestions from an other android-beginner:

1.) Add
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.        
  2.  
  3. <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  4.  
  5. <uses-permission android:name="android.permission.INTERNET" />
  6.  
  7.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

over the <application> Tag in your AndroidManifest.xml

2.) Write
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <com.google.android.maps.MapView android:id="@+id/routeFrom_basic_map"
  3.  
  4. android:layout_width="fill_parent"
  5.  
  6. android:layout_height="200px"
  7.  
  8. android:apiKey="NotAvailable"
  9.  
  10. android:clickable="true" />
  11.  
  12.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


instead of:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <view class="com.google.android.maps.MapView"
  3.  
  4. android:layout_width="fill_parent"
  5.  
  6. android:layout_height="fill_parent"
  7.  
  8. android:layout_weight="1" />
  9.  
  10.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Hope that helps.

Greetings from Germany
michels
Junior Developer
Junior Developer
 
Posts: 17
Joined: Wed Sep 24, 2008 12:37 pm
Location: Germany

Postby zak » Wed Sep 24, 2008 1:01 pm

hi michels!!!

THANKS A LOT!!!!!
zak
Freshman
Freshman
 
Posts: 8
Joined: Tue Sep 23, 2008 8:42 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 7 guests