Simple MAP display problem

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

Simple MAP display problem

Postby jp_ksj » Tue Dec 29, 2009 11:27 am

[font=Verdana]

while displaying map, Its showing just empty screen

1. i did API key generation
2. Permission setings
3. In emulator i can browse any websites.
4. I cheked proxy settings also.

I mentioned my source java & manifest file for ypur reference. Please let me know whts error in this.

[/font]
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. package com.map;
  3.  
  4.  
  5.  
  6. import com.google.android.maps.GeoPoint;
  7.  
  8. import com.google.android.maps.MapActivity;
  9.  
  10. import com.google.android.maps.MapController;
  11.  
  12. import com.google.android.maps.MapView;
  13.  
  14. import android.os.Bundle;
  15.  
  16.  
  17.  
  18. public class MapActivityTest extends MapActivity {
  19.  
  20.  
  21.  
  22.         MapView mMapView = null;
  23.  
  24.         String map="0XkIwFzl60lRKmTtusEps0KMq1LIZ6DJiwC03QQ";
  25.  
  26.  
  27.  
  28.         public void onCreate(Bundle savedInstanceState) {
  29.  
  30.                 super.onCreate(savedInstanceState);
  31.  
  32.                 setContentView(R.layout.main);
  33.  
  34.                
  35.  
  36.                 mMapView = new MapView(this, map);
  37.  
  38.                 GeoPoint p = new GeoPoint((int) (13.02 * 1000000),      (int) (77.57 * 1000000));
  39.  
  40.                 MapController mc = mMapView.getController();
  41.  
  42.                 mc.animateTo(p);
  43.  
  44.                 mc.setZoom(10);
  45.  
  46.                 setContentView(mMapView);
  47.  
  48.                 mMapView.isSatellite();
  49.  
  50.         }
  51.  
  52.  
  53.  
  54.         protected boolean isRouteDisplayed() {
  55.  
  56.                 return false;
  57.  
  58.         }
  59.  
  60. }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.         package="com.map" android:versionCode="1" android:versionName="1.0">
  7.  
  8.  
  9.  
  10.         <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  11.  
  12.         <uses-permission android:name="android.permission.INTERNET" />
  13.  
  14.         <uses-permission android:name="android.permission.ACCESS_GPS" />
  15.  
  16.         <uses-permission android:name="android.permission.ACCESS_LOCATION" />
  17.  
  18.         <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
  19.  
  20.         <uses-permission android:name="android.permission.ACCESS_CELL_ID" />
  21.  
  22.        
  23.  
  24.     <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
  25.  
  26.         <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  27.  
  28.  
  29.  
  30.  
  31.  
  32.         <application android:icon="@drawable/icon" android:label="@string/app_name">
  33.  
  34.                 <uses-library android:name="com.google.android.maps" />
  35.  
  36.                 <activity android:name=".MapActivityTest" android:label="@string/app_name">
  37.  
  38.                         <intent-filter>
  39.  
  40.                                 <action android:name="android.intent.action.MAIN" />
  41.  
  42.                                 <category android:name="android.intent.category.LAUNCHER" />
  43.  
  44.                         </intent-filter>
  45.  
  46.                 </activity>
  47.  
  48.  
  49.  
  50.         </application>
  51.  
  52.         <uses-sdk android:minSdkVersion="3" />
  53.  
  54.  
  55.  
  56.  
  57.  
  58. </manifest>
  59.  
  60.  
Parsed in 0.005 seconds, using GeSHi 1.0.8.4
Attachments
display screen1.GIF
(96.36 KiB) Downloaded 68 times
key generation1.GIF
(80.7 KiB) Downloaded 65 times
jp_ksj
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Dec 22, 2009 6:39 am

Top

Postby jp_ksj » Wed Dec 30, 2009 9:59 am

while running my project, i m getting this error in my console.

[2009-12-30 14:23:27 - ddms]ADB rejected shell command (ls -l /):

I think this is not problem. If i restart the emulator. Then whats up there. Thanks
jp_ksj
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Dec 22, 2009 6:39 am

Postby steven_d » Wed Jan 06, 2010 1:15 pm

hi,
if you search for Android Map Tutorial in google, you will get a lot of stuff.

One question:
Why dont you have your MapView declared in your main.xml file?

Like:

<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="YOUR KEY"/>

and in your java file you say:

MapView map = (MapView) findViewById(R.id.mapView)


Greets,
Stefan
steven_d
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jul 20, 2009 1:15 pm
Location: Germany

Postby jp_ksj » Thu Jan 07, 2010 5:03 am

[font=Verdana]

While i am running project, after 5min i am getting this message in my console.

[2009-12-30 14:23:27 - ddms]ADB rejected shell command (ls -l /):

for this i tried like adb kill-server & adb start-server. but still i didnt get any map view. and also while running my hello world application, i am getting following errors in my Log cat file. How can i avoid those errors?.


01-06 10:38:42.169: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
01-06 10:38:42.169: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory)
01-06 10:38:42.169: ERROR/vold(26): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
01-06 10:38:42.169: ERROR/vold(26): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory)
01-06 10:39:02.559: ERROR/BatteryService(61): usbOnlinePath not found
01-06 10:39:02.559: ERROR/BatteryService(61): batteryVoltagePath not found
01-06 10:39:02.559: ERROR/BatteryService(61): batteryTemperaturePath not found
01-06 10:39:02.648: ERROR/SurfaceFlinger(61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
01-06 10:39:09.700: ERROR/EventHub(61): could not get driver version for /dev/input/mouse0, Not a typewriter
01-06 10:39:09.719: ERROR/EventHub(61): could not get driver version for /dev/input/mice, Not a typewriter
01-06 10:39:10.079: ERROR/System(61): Failure starting core service
01-06 10:39:10.079: ERROR/System(61): java.lang.SecurityException
01-06 10:39:10.079: ERROR/System(61): at android.os.BinderProxy.transact(Native Method)
01-06 10:39:10.079: ERROR/System(61): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
01-06 10:39:10.079: ERROR/System(61): at android.os.ServiceManager.addService(ServiceManager.java:72)
01-06 10:39:10.079: ERROR/System(61): at com.android.server.ServerThread.run(SystemServer.java:176)

01-06 10:39:10.108: ERROR/AndroidRuntime(61): Crash logging skipped, no checkin service
01-06 10:39:25.554: ERROR/vold(26): Cannot start volume '/sdcard' (volume is not bound)
01-06 10:39:26.304: ERROR/MediaPlayerService(30): Couldn't open fd for content://settings/system/notification_sound
01-06 10:39:26.335: ERROR/MediaPlayer(61): Unable to to create media player
01-06 10:39:30.005: ERROR/ActivityThread(113): Failed to find provider info for android.server.checkin
01-06 10:39:32.875: ERROR/ActivityThread(113): Failed to find provider info for android.server.checkin
01-06 10:39:35.064: ERROR/AndroidRuntime(131): ERROR: thread attach failed
01-06 10:39:36.444: ERROR/ActivityThread(113): Failed to find provider info for android.server.checkin
01-06 10:39:48.215: ERROR/AndroidRuntime(188): ERROR: thread attach failed


Mainly those System, Android Runtime & Activity thread errors are should not come. But in my application only i am getting. What are those errors?. how can i solve that?. Thanks in advance.

[/font]
jp_ksj
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Dec 22, 2009 6:39 am

Postby jp_ksj » Thu Jan 07, 2010 12:50 pm

[font=Verdana]

Hi Friends now its working fine. I didn't do anything. Just i reinstalled my eclipse and updated android and google api's.

Thank you.

[/font]
jp_ksj
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Dec 22, 2009 6:39 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 6 guests