0

This is my code. I tried this code but i have errors at MapActivity, MapView and other locations. while I writing this code when i put the cursor over there it doesn't show importing options... I don't know why. Any one try with this code the methods are not importing here..check it out plz

package com.bened;

import android.os.Bundle;

public class mapExactDemoActivity extends MapActivity {
    /** Called when the activity is first created. */
    MapView mv;
    double lat=17.441966,lon=78.445127;
    GeoPoint gp;
    MapController mc;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mv=(MapView)findViewById(R.id.map);
        gp=new GeoPoint((int)(lat*1000000),(int)(lon*1000000));
        mc=mv.getController();
        mc.setCenter(gp);
        mc.setZoom(20);
        mv.setBuiltInZoomControls(true);

    }

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }
}

Layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <com.google.android.maps.MapView
    android:id="@+id/map"  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"
    android:apiKey="00S4pru3FgTKZjOlX2agvv2TBWx5p3sVbOvgiAw" 
    android:clickable="true"
    />
</LinearLayout>

3.LogCat error details

11-23 12:02:03.946: D/PackageParser(68): Scanning package: /data/app/vmdl-1317076106.tmp
11-23 12:02:04.084: D/PackageManager(68): Scanning package com.bened
11-23 12:02:04.084: E/PackageManager(68): Package com.bened requires unavailable shared library com.google.android.maps; failing!
11-23 12:02:04.084: W/PackageManager(68): Package couldn't be installed in /data/app/com.bened-1.apk
11-23 12:02:04.234: D/dalvikvm(68): GC_EXPLICIT freed 580K, 49% free 4250K/8263K, external 4768K/5461K, paused 138ms
11-23 12:02:04.374: D/AndroidRuntime(360): Shutting down VM
11-23 12:02:04.384: D/dalvikvm(360): GC_CONCURRENT freed 213K, 71% free 302K/1024K, external 0K/0K, paused 2ms+1ms
11-23 12:02:04.394: D/dalvikvm(360): Debugger has detached; object registry had 1 entries
11-23 12:02:04.414: I/AndroidRuntime(360): NOTE: attach of thread 'Binder Thread #3' failed
11-23 12:02:33.943: D/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
11-23 12:07:33.973: D/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
11-23 12:07:52.414: D/AndroidRuntime(376): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
11-23 12:07:52.414: D/AndroidRuntime(376): CheckJNI is ON
11-23 12:07:53.496: D/AndroidRuntime(376): Calling main entry com.android.commands.pm.Pm
11-23 12:07:53.764: D/dalvikvm(236): GC_EXPLICIT freed 10K, 54% free 2546K/5511K, external 1625K/2137K, paused 88ms
11-23 12:07:53.787: W/ActivityManager(68): No content provider found for: 
11-23 12:07:53.814: W/ActivityManager(68): No content provider found for: 
11-23 12:07:53.864: D/PackageParser(68): Scanning package: /data/app/vmdl-257441530.tmp
11-23 12:07:54.024: D/PackageManager(68): Scanning package com.bened
11-23 12:07:54.024: E/PackageManager(68): Package com.bened requires unavailable shared library com.google.android.maps; failing!
11-23 12:07:54.024: W/PackageManager(68): Package couldn't be installed in /data/app/com.bened-1.apk
11-23 12:07:54.184: D/dalvikvm(68): GC_EXPLICIT freed 250K, 49% free 4229K/8263K, external 3511K/4385K, paused 138ms
11-23 12:07:54.296: D/AndroidRuntime(376): Shutting down VM
11-23 12:07:54.325: I/AndroidRuntime(376): NOTE: attach of thread 'Binder Thread #3' failed
11-23 12:07:54.334: D/dalvikvm(376): GC_CONCURRENT freed 213K, 71% free 302K/1024K, external 0K/0K, paused 2ms+4ms
11-23 12:07:54.334: D/jdwp(376): Got wake-up signal, bailing out of select
11-23 12:07:54.334: D/dalvikvm(376): Debugger has detached; object registry had 1 entries
Crishnan Kandada
  • 651
  • 2
  • 9
  • 24
  • 1
    Please edit your question and insert the error(exception?) you are getting. This will help other users understand your problem. – oers Nov 22 '11 at 09:09
  • 1
    I tried to fix your question by correcting grammar, but I can't figure out what you mean by "If I put cursor there it doesn't shop importing options". Could you rephrase that? – Tim Büthe Nov 22 '11 at 09:12
  • make sure your key is valid. you can get key by this way :: http://stackoverflow.com/questions/6925659/keytool-alias-does-not-exist/6925802#6925802 – Nikunj Patel Nov 22 '11 at 09:15
  • yaa.......i changed my quarry n posted my logcat details..here – Crishnan Kandada Nov 23 '11 at 07:01

2 Answers2

0

it doesn't shop importing options

If this is a weird way of saying "does not fix your imports"

Simply do this to organize your imports : Ctrl + Shift + O

If this does not work, setup your project properly

Reno
  • 33,594
  • 11
  • 89
  • 102
0

Please check that you have used Google API(Google Inc.) Sdk imulator of 2.2 or any upgraded version.

Sachita
  • 42
  • 2