0

Google지도에서 작업하고 Fragment not Fragmentactivity를 사용했지만 작동하지 않습니다. 내 코드는 아래에 주어진다.안드로이드에서지도를 표시하는 방법?

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.tech.Conference" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="11" 
     android:targetSdkVersion="17" /> 

    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true" /> 

    <permission 
     android:name="com.example.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature" /> 

    <uses-permission android:name="com.example.permission.MAPS_RECEIVE" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > 
     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 

     <activity 
      android:name="com.tech.Conference.SplashScreen" 
      android:label="@string/app_name" 
      android:screenOrientation="portrait" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name="com.technostacks.Conference.MainActivity" 
      android:logo="@drawable/menu_icon" 
      android:screenOrientation="portrait" 
      android:theme="@style/AppTheme" > 
     </activity> 
    </application> 

</manifest> 

이 코드가 아니라 성공

public class Maps extends Fragment { 

    MapView m; 

    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, 
      Bundle savedInstanceState) { 
     // inflat and return the layout 
     View v = inflater.inflate(R.layout.maps, container, false); 
     m = (MapView) v.findViewById(R.id.mapview); 
     m.onCreate(savedInstanceState); 

     return v; 
    } 

    @Override 
    public void onResume() { 
     super.onResume(); 
     m.onResume(); 
    } 

    @Override 
    public void onPause() { 
     super.onPause(); 
     m.onPause(); 
    } 

    @Override 
    public void onDestroy() { 
     super.onDestroy(); 
     m.onDestroy(); 
    } 

    @Override 
    public void onLowMemory() { 
     super.onLowMemory(); 
     m.onLowMemory(); 
    } 
} 

매니페스트

map.xml

**<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    > 
<com.google.android.gms.maps.MapView 
      android:id="@+id/mapview" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" /> 
    </LinearLayout>** 

Map.java. 이 같은 뻥 오류 .. 당신은 당신은되지 않습니다 mapv1을 사용했다

 meta-data 
     android:name="com.google.android.maps.v2.API_KEY" 
     android:value="your key" 
+0

시작을 사용하여 https://developers.google.com/maps/documentation/android/start – MilapTank

+0

android : name = "com.google.android.gms.version"android : name = "com.google.android.maps.v2. API_KEY "는 (는) 모두 매니페스트 작성을위한 필수 사항입니까? – ckpatel

+0

예 필수 사항입니다. – MilapTank

답변

0

는에서 mapv2

+0

감사합니다.하지만이 정보를 추가하면 ckpatel

+0

google-play-services에 대한 확인이 올바른지 여부를 확인하십시오. 경우 안드로이드에서 당신지고 오류 : 값 = "@ 당신의 구글 플레이-Services_lib 참조가 확인이 링크를 작동하지 않는 정수/GOOGLE_PLAY_SERVICES_VERSION 의미 http://stackoverflow.com/questions/19879844/adding-google-play -services-version-to-your-apps-manifest –

0

당신의 Manifest.xml에 또 하나의 메타 데이터를 추가 할 필요가

java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml 
+0

네,하지만 조각 클래스에서 mapv2를 사용하는 방법은 무엇입니까? – ckpatel

+0

지도의 조각 조각 안에 사용했습니다 ... – Richa

+0

지도에 대해 도움을 줄 수 있습니까? 코드를 보내 주시겠습니까? 감사합니다 – ckpatel

관련 문제