Mobile Map API

MGMaps Lib SDK is professional toolkit to develop mobile mapping applications.
Platforms: iPhone, Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »

Uudised

Viimane: Thu, 29 Jul 2010 19:38:21
Teema: New maps SDK release 1.1.0
Veel uudiseid »

Nutiteq Twitteris

11 weeks 1 day ago Nutiteq is proud sponsor of StateOfTheMap 2010 #sotm10

Mgmaps SDK on Android

13 replies [Last post]
derickl
User offline. Last seen 14 weeks 1 day ago. Offline
Joined: 01/19/2009

Hi,
I'm just getting off developing some apps on J2ME and wanted to play with Android. Does the MGMAPS SDK port have the same classes/packages/functionality as that of J2ME?

Also, in the documentation of the SDK, i can only see very little relating to Android. Why is that?

Regards

The D Man!

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

The docs are just not updated yet, we added Android support quite recently. To get started, download latest library Android package and take a look to the sample application.

For Android we have MapView object, which is similar like you use with Google Maps, and you can use it in your screens similar way. You can even use same Android built-in zoom controls. However, specific map creation parameters and methods (overlays etc) are different; and are generally much more powerful. So porting real application from Google to OSM maps takes some effort. Depends really how complex is your on-map functionality.

Most of Nutiteq mobile mapping Java API is not platform-specific, so it is same as with J2ME and BlackBerry. Therefore the same JavaDocs apply, except methods which are dealing with platform communication: graphics is most important, you may need to deal also with file system. Some of these "platform connectors" seem to have no point to be ported, e.g. we do not plan to have Bluetooth serial GPS connection for Android. So linking to specific application environment needs some tricks, mainly to handle properly the graphics.

Right now, take a look to the Android sample app, hopefully soon also Developer Guide doc will be updated with Android chapter.

/JaakL

derickl
User offline. Last seen 14 weeks 1 day ago. Offline
Joined: 01/19/2009

Thanks. But the latest android package seems to be corrupt. I've downloaded it many times but the zip file has an error

The D Man!

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

Yes, there was some upload issue. Now it is fixed, just try to download again.

/JaakL

derickl
User offline. Last seen 14 weeks 1 day ago. Offline
Joined: 01/19/2009

Thanks Jaak,
The sample works on the emulator. But i get an error when i install it on my phone [Network error]. Is it a license issue? In Android, what corresponds to MidletName and VendorName...?

Thanks

The D Man!

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

Did you check the logs (via DDMS)? License error should give license error, and not networking error.

With Android you cannot certainly refer to Midlet what you do not have, but MapComponent (and BasicMapComponent) has constructor without Midlet, and you define appname and vendor as String there. Just like it is done in the sample code. Use the same values there and in license registration form.

/JaakL

davemaster
User offline. Last seen 24 weeks 1 day ago. Offline
Joined: 02/18/2010

Greetings,

If i want to use the navteq maptp in setmap i need the maptp key.

Someone knows a try or test key? otherwise, the way to obtain one which works?

Best regards

David Elias Flores Escalante
Design Manager
TeleTracking SAC

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

I suggest to contact NAVTEQ sales, currently we cannot share evaluation key for you.

/JaakL

ISDA
User offline. Last seen 24 weeks 17 hours ago. Offline
Joined: 02/11/2010

Please, I've used this libs in an ANDROID TATOO mobil. Most of the time it goes ok but sometimes, during launching the app or dragging the map fast it show the 'Force to Close' dialog. Even, when I click this 'Force to Close' button the screen stay black until I click Pause Button.
It seems like wen you close the app, some process never die. This process sometime affect the end of the current app or the next time we init the app.
I am using the code you provide in pdf.

What sort of listener from the API could I use for capture errors and avoid this? . Even I am using your code in onDestroy for kill process.

Exist any other stronger code for force to release memory?

We are considering purchase the product but we want to be sure we cann control this kind of strange effect.

Thanks in advance

ISDA

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

First of all, we need to now specific error message from the log. If you connect phone to PC with USB debugger, then you should get it using DDMS Logcat.

With some devices we have got error java.lang.OutOfMemoryError: bitmap size exceeds VM budget , with quite similar situation: if you close app, and then start it in short time, then it gives "Force Close" message. If you wait 3-4 seconds before starting app again, then there is no issue. With newer devices (e.g. Nexus One with 2.1 OS) it cannot be replicated, so it seems to be kind of memory management bug in Android. Technical point is that Dalvik has specific memory segment for Bitmaps, and this Bitmap memory is not managed by normal garbage collector; it is also not even cleaned up immediately when Activity is closed. So normal memory management does not help there, we have already added cleanup code during shutdown to solve the issue. Nutiteq maps library likes to create quite many bitmap objects, especially for animations during zooming/panning. This approach works fine in all other platforms, but in these Android devices we have not yet definite solution. Good news is that the latest devices does not seem to have the issue.

However, there could be also other, different reasons for your message. Android uses "Force Close" for any kind of issues. So your error message is needed to troubleshoot it more.

/JaakL

ISDA
User offline. Last seen 24 weeks 17 hours ago. Offline
Joined: 02/11/2010

I will run the risk of being a bit annoying .... :( sorry.

Today I am looking for something about ANDROID around the Web and this article comes to me.

http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html

could help for bitmap size exceeds VM budget ?

ISDA
User offline. Last seen 24 weeks 17 hours ago. Offline
Joined: 02/11/2010

First of all thanks for your help and I encourage you to continue with this great and difficult job

As I said this happend once a while.

The mesagges from LogCat is just the one you said.
(java.lang.OutOfMemoryError: bitmap size exceeds VM budget) and Android launch it just when it's loading the bitmaps.
Prior to that error, LogCat launch this error: (262144-Byte external allocation too large for this process. VM won't let us allocate 262144 bytes)
But just prior to the lines of error in red color LogCat show a orange message saying:
(thread exiting with uncaught exception)
Because of this message I doubt if I missed a kind of listener in your libs that could catch that exception.

One more question about this: when I am using jared maps, do you recommend me implement MemoryCache, cache in files on SDCARD and set networkCahe operations?

I doubt if this funcionalities become worse for the Android's problem with memory.

Thanks in advance for your valuable help.

jaak
User offline. Last seen 15 hours 32 min ago. Offline
Joined: 06/19/2008

This bitmap VM size issue is not related to caching. You can always use MemoryCache (tiles in RAM, no persistence), and usually it makes sense also to use FileSystem cache for persistent caching.

Note that some map providers have restrictions for client-side persistent caching, some do not allow it at all.

/JaakL

ISDA
User offline. Last seen 24 weeks 17 hours ago. Offline
Joined: 02/11/2010

Thanks for your help. I`ll use MemoryCache then.

To tell you the true I noticed a lot of aplications based on other Libs about GIS and Tile Mapping for Android (not only nutiteq) , exit unexpectedly. So I must agreed with you (the problem could be Android OS)

In some cases Android Show the Force to Close Alert but with some applications it doesn't.

Some aplications just only turn black the screen and then close itself without error alerts.

Cheers