Bonjour,
je suis novice en programmation Android.
Cela fait deux jours que j'essaie d'afficher une Map sur une tablette "Galaxy Note 10.1"
Pour les intégrations d’éclipse, j'ai suivit le tutoriel suivant :
http://twigstechtips.blogspot.fr/2013/06/android-adding-google-maps-api-v2-to.html
Lors de l’exécution la Map ne s'affiche pas.
Voici mes codes sources :
activity main.java
Pour le l'activity.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 package com.example.localisation; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import android.os.Bundle; import android.app.Activity; import android.app.Dialog; import android.view.Menu; import android.support.v4.app.FragmentActivity; public class MainActivity extends FragmentActivity { private GoogleMap gm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext()); if (status == ConnectionResult.SUCCESS) { SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); gm = supportMapFragment.getMap(); } else { int requestCode = 10; Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode); dialog.show(); } } }
Pour le manifest.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="wrap_content" android:layout_height="match_parent" />
Le logcat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.localisation" android:versionCode="1" android:versionName="1.0" > <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <permission android:name="com.example.localisation.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="com.example.localisation.permission.MAPS_RECEIVE"/> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="18" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <uses-library android:required="true" android:name="com.google.android.maps" /> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDnB1cUFKlryvIEY_1fdTUXzWeRuxpSEk4"/> <!-- AIzaSyCmUzGbsoDaR0TpCGYAcmJh4KA_cYE7l_Y du browser--> <!-- AIzaSyDnB1cUFKlryvIEY_1fdTUXzWeRuxpSEk4 dandroid --> <activity android:name="com.example.localisation.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
Avez vous une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 10-05 13:39:15.820: D/dalvikvm(11138): GC_CONCURRENT freed 529K, 14% free 7887K/9095K, paused 18ms+5ms, total 72ms 10-05 13:40:07.985: W/SurfaceView(11138): CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false 10-05 13:40:15.935: D/dalvikvm(22778): GC_CONCURRENT freed 214K, 11% free 7304K/8135K, paused 12ms+1ms, total 29ms 10-05 13:40:15.935: D/dalvikvm(22778): WAIT_FOR_CONCURRENT_GC blocked 5ms 10-05 13:40:16.035: D/dalvikvm(22778): GC_CONCURRENT freed 313K, 12% free 7516K/8455K, paused 2ms+11ms, total 26ms 10-05 13:40:16.095: D/AbsListView(22778): Get MotionRecognitionManager 10-05 13:40:16.100: D/dalvikvm(22778): GC_CONCURRENT freed 254K, 11% free 7707K/8583K, paused 13ms+2ms, total 30ms 10-05 13:40:16.160: D/libEGL(22778): loaded /system/lib/egl/libEGL_mali.so 10-05 13:40:16.165: D/libEGL(22778): loaded /system/lib/egl/libGLESv1_CM_mali.so 10-05 13:40:16.165: D/libEGL(22778): loaded /system/lib/egl/libGLESv2_mali.so 10-05 13:40:16.170: D/(22778): Device driver API match 10-05 13:40:16.170: D/(22778): Device driver API version: 10 10-05 13:40:16.170: D/(22778): User space API version: 10 10-05 13:40:16.170: D/(22778): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 10-05 13:40:16.200: D/OpenGLRenderer(22778): Enabling debug mode 0 10-05 13:40:16.310: D/dalvikvm(22778): GC_CONCURRENT freed 152K, 10% free 8000K/8839K, paused 12ms+21ms, total 52ms 10-05 13:40:16.310: D/dalvikvm(22778): WAIT_FOR_CONCURRENT_GC blocked 34ms 10-05 13:40:16.340: D/dalvikvm(22778): GC_FOR_ALLOC freed 433K, 13% free 7872K/9031K, paused 22ms, total 25ms 10-05 13:40:16.365: D/dalvikvm(22778): GC_FOR_ALLOC freed 325K, 13% free 7873K/9031K, paused 14ms, total 14ms 10-05 13:40:16.395: D/dalvikvm(22778): GC_CONCURRENT freed 304K, 12% free 8002K/9031K, paused 4ms+2ms, total 21ms 10-05 13:40:16.395: D/dalvikvm(22778): WAIT_FOR_CONCURRENT_GC blocked 17ms
Merci pour votre aide.
Partager