hi everybody? the problem is on the title! I can't display my OsMap.map which I have put on the sdcard card on my emulator.
Can someone tells me what's the problem?
First are the steps that I've done:
My MainActivity.java:
package com.formation.macarte;
import java.io.File;
import java.io.IOException;
import org.mapsforge.android.maps.GeoPoint;
import org.mapsforge.android.maps.MapActivity;
import org.mapsforge.android.maps.MapController;
import org.mapsforge.android.maps.MapView;
import android.annotation.SuppressLint;
import android.os.Bundle;
//import android.view.Menu;
//import android.view.MenuItem;
import android.os.Environment;
public class MainActivity extends MapActivity {
MapController monController;
double longitude = 12.482883;
double latitude = 48.849076;
@SuppressLint("SdCardPath")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MapView mapView = new MapView(this);
mapView.setClickable(true);
mapView.setBuiltInZoomControls(true);
mapView.setMapFile(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/OsMap.map");
setContentView(mapView);
}
}
And in my androidManifest, I have this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.formation.macarte"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".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>
The file OsMap.map is already in mnt/sdcard like : and in Edit Android Virtual Device: I have made one configuration: On the SD Card section, I had put C:\Android\adt-bundle-windows-x86-20140702\sdcard\osm.iso
So I've created a osm.iso to contain all my sdcard files, I've seen that in one tuto. And when I push one file from the DDMS, I can verify this same file in this osm.iso. So I think that it's correct!
And when I run this application, I can only display the ZoomControler, without the map. And sometimes, it shows this next error:
10-12 13:21:27.105: E/Trace(1727): error opening trace file: No such file or directory (2)
10-12 13:21:27.995: D/dalvikvm(1727): GC_CONCURRENT freed 72K, 8% free 2770K/2992K, paused 25ms+6ms, total 106ms
10-12 13:21:27.995: D/dalvikvm(1727): WAIT_FOR_CONCURRENT_GC blocked 92ms
10-12 13:21:28.135: D/dalvikvm(1727): GC_CONCURRENT freed 13K, 7% free 3163K/3388K, paused 20ms+13ms, total 110ms
10-12 13:21:28.135: D/dalvikvm(1727): WAIT_FOR_CONCURRENT_GC blocked 29ms
10-12 13:21:28.215: D/osm(1727): main: invalid map start position latitude: 1718579815
10-12 13:21:28.515: I/Choreographer(1727): Skipped 38 frames! The application may be doing too much work on its main thread.
10-12 13:21:28.855: D/dalvikvm(1727): GC_CONCURRENT freed 86K, 7% free 3478K/3712K, paused 11ms+11ms, total 113ms
10-12 13:21:28.855: D/dalvikvm(1727): WAIT_FOR_CONCURRENT_GC blocked 93ms
10-12 13:21:29.045: I/Choreographer(1727): Skipped 172 frames! The application may be doing too much work on its main thread.
10-12 13:21:29.324: D/gralloc_goldfish(1727): Emulator without GPU emulation detected.
10-12 13:21:32.465: I/Choreographer(1727): Skipped 45 frames! The application may be doing too much work on its main thread.
10-12 13:21:32.535: I/Choreographer(1727): Skipped 39 frames! The application may be doing too much work on its main thread.
10-12 13:21:32.575: I/Choreographer(1727): Skipped 33 frames! The application may be doing too much work on its main thread.
10-12 13:21:32.645: I/Choreographer(1727): Skipped 31 frames! The application may be doing too much work on its main thread.
10-12 13:21:32.785: I/Choreographer(1727): Skipped 116 frames! The application may be doing too much work on its main thread.
10-12 13:21:32.925: I/Choreographer(1727): Skipped 32 frames! The application may be doing too much work on its main thread.
10-12 13:21:33.005: I/Choreographer(1727): Skipped 40 frames! The application may be doing too much work on its main thread.
10-12 13:21:33.085: I/Choreographer(1727): Skipped 33 frames! The application may be doing too much work on its main thread.
10-12 13:21:39.675: I/Choreographer(1727): Skipped 36 frames! The application may be doing too much work on its main thread.
Sorry for the language! How can I solve this problem! Thanks!
0 comments:
Post a Comment