loading *.map file to android device

636 views
Skip to first unread message

Olga Efremova

unread,
Feb 24, 2012, 7:15:23 AM2/24/12
to mapsforge-dev
Hi!
I have the local part of OSM, file kaluga3.map. The task is to load
local osm file to android device(ARCHOS 43)
Part of code is:
MapView mapView = new MapView(this);
mapView.setClickable(true);
mapView.setBuiltInZoomControls(true);
mapView.setMapFile("/sdcard/kaluga3.map");
setContentView(mapView);

In eclipse I use the android emulator. I put kaluga3.map file to
sdcard emulator and my program is working and seeing kaluga3.map file.
But in real android device(ARCHOS 43) program does not see kaluga3.map
file. I put this file to the sdcard in device, but my application does
not see the map. Can you help me, how to load *.map file to real
android device?
Maybe I have made a mistake with path ("/sdcard/kaluga3.map").
Thank you very much.

Karsten Groll

unread,
Feb 24, 2012, 8:44:39 AM2/24/12
to mapsfo...@googlegroups.com
Hello,

it seems like your device uses different file paths. Try to use a
generic approach like this:

mapView.setMapFile(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/kaluga3.map");

Regards,

Karsten

2012/2/24 Olga Efremova <o_efr...@mail.ru>:

Ольга Ефремова

unread,
Feb 27, 2012, 4:29:50 AM2/27/12
to mapsfo...@googlegroups.com
Hi!
Thank you very much for answer. I've checked the path, like you write. My program give me path /mnt/storage/kaluga3.map.
But I do not understand how to put my file kaluga3.map to this place. Because when I connect android device to the computer, I do not see directory /mnt/storage. I see sdcard directory and several android directories, but there is not /mnt/storage. Can you help me, how to put kaluga3.map file to the /mnt/storage directory. Maybe is it necessary to use the settings from android device? Help me, please!
Thank you.

24 февраля 2012, 17:44 от Karsten Groll <karste...@googlemail.com>:


> Hello,
>
> it seems like your device uses different file paths. Try to use a
> generic approach like this:
>
> mapView.setMapFile(Environment.getExternalStorageDirectory().getAbsolutePath()
> + "/kaluga3.map");
>
> Regards,
>
> Karsten
>
> 2012/2/24 Olga Efremova <o_efr...@mail.ru>:

С уважением
Ефремова Ольга
"Российские космические системы"
o_efr...@mail.ru

Karsten Groll

unread,
Feb 27, 2012, 5:02:47 AM2/27/12
to mapsfo...@googlegroups.com
I assume you use ADB to push files to your device. If there is just a
sdcard directory, try to push your file to that directory. The problem
might be that your device has internal and external memory available.

To find out the correct directory, you can write a small application
that creates a file in your desired directory:

File f = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
+ "/test.txt");
f.createNewFile();

Run this application and check where the file has been created.

Regards,

Karsten

2012/2/27 Ольга Ефремова <o_efr...@mail.ru>:

Ольга Ефремова

unread,
Feb 27, 2012, 5:12:33 AM2/27/12
to mapsfo...@googlegroups.com
Thank you very much!
Now it works! Device has internal and external memory. I've put *.map file to sdcard and write code:

mapView.setMapFile(Environment.getExternalStorageDirectory().getAbsolutePath() + "/sdcard/kaluga3.map");

Thank you!

27 февраля 2012, 14:02 от Karsten Groll <karste...@googlemail.com>:


> I assume you use ADB to push files to your device. If there is just a
> sdcard directory, try to push your file to that directory. The problem
> might be that your device has internal and external memory available.
>
> To find out the correct directory, you can write a small application
> that creates a file in your desired directory:
>
> File f = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
> + "/test.txt");
> f.createNewFile();
>
> Run this application and check where the file has been created.
>
> Regards,
>
> Karsten
>
> 2012/2/27 Ольга Ефремова <o_efr...@mail.ru>:

> > Hi!
> > Thank you very much for answer. I've checked the path, like you write. My program give me path /mnt/storage/kaluga3.map.
> > But I do not understand how to put my file kaluga3.map to this place. Because when I connect android device to the computer, I do not see directory /mnt/storage. I see sdcard directory and several android directories, but there is not /mnt/storage. Can you help me, how to put kaluga3.map file to the  /mnt/storage directory. Maybe is it necessary to use the  settings from android device? Help me, please!
> > Thank you.
> >
> >
> >
> > 24 февраля 2012, 17:44 от Karsten Groll <karste...@googlemail.com>:
> >> Hello,
> >>
> >> it seems like your device uses different file paths. Try to use a
> >> generic approach like this:
> >>
> >> mapView.setMapFile(Environment.getExternalStorageDirectory().getAbsolutePath()
> >> + "/kaluga3.map");
> >>
> >> Regards,
> >>
> >> Karsten
> >>
> >> 2012/2/24 Olga Efremova <o_efr...@mail.ru>:

Reply all
Reply to author
Forward
0 new messages