Hello,
I've got a problem with tutorial code.
import com.nutiteq.utils.LogForm fails, since there is non LogForm class in such location.
Any suggestions?
thanks
giacomo
Ok, thanks!
I'm having some problem also with mapItem.showDefaultControlsOnScreen(boolean), i can not find it in mapItem methods.
Also, I can not see any pointer in the device emulator.
I don't know if it is related, but I get the following exception:
java.lang.NullPointerException
at com.nutiteq.BasicMapComponent.e(+20)
at com.nutiteq.BasicMapComponent.resize(+28)
at com.nutiteq.MapItem.paint(+35)
at javax.microedition.lcdui.CustomItem.callPaint(CustomItem.java:1311)
at javax.microedition.lcdui.Form.paintItem(Form.java:2060)
at javax.microedition.lcdui.Form.callPaint(Form.java:1998)
at javax.microedition.lcdui.Display.repaint(+82)
at javax.microedition.lcdui.Display.registerNewCurrent(+235)
at javax.microedition.lcdui.Display.access$700(+6)
at javax.microedition.lcdui.Display$DisplayAccessor.foregroundNotify(+46)
at javax.microedition.lcdui.Display$DisplayManagerImpl.notifyWantsForeground(Display.java:3032)
at javax.microedition.lcdui.Display$DisplayManagerImpl.access$100(Display.java:2455)
at javax.microedition.lcdui.Display.setCurrent(+70)
at hello.MiniHello.startApp(MiniHello.java:71)
at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:375)
at com.sun.midp.main.Main.runLocalClass(Main.java:477)
at com.sun.midp.main.Main.main(+80)
Map works correctly, with pan and zoom, gps navigation and place icon (but no label). But still no pointer, no place selction and message and no kml visualization...
use proxy connection
wtk 2.5.2->edit->preferences->network configurations->and give ur proxy there it will work on the emulator
and one more cause might be there i.e.
setCurrent()method should be after StartMapping() method .try this u wont get exception.
mapItem.startMapping();
Display.getDisplay(this).setCurrent(mMainForm);
but i dont know how to do to work on the device can u tell me if u know
Right, the tutorial is a bit out of date. Show zoom controls for pointer-powered (touch) device, or central cursor for non-pointer:
if (hasPointerEvents()) {
map.showDefaultOnScreenZoomControls();
} else {
map.showDefaultCursor();
With KML check if the given URL ends with ? or & like it should. You can see from the network monitor what requests are exactly done, and this gives good hints.
This exception could come if call to some map functions is done before call of startMapping(). I'd need to see the code to comment this more.
I'm using exactly the tutorial code (maybe this exception is launched during the data connection request... )
I0m sorry, but i can not find neither "showDefaultOnScreenZoomControls" nor "showDefaultCursor" in MapItem class!
Only showZoomLevelIndicator(boolean)...
This exception can be actually safely ignored. It happens during asking networking permissions, graphics is not yet available, but library tries to draw it.
Ok, I supposed so.
What about the other problem, i.e. I can not find neither "showDefaultOnScreenZoomControls" nor "showDefaultCursor" in MapItem class!
Only showZoomLevelIndicator(boolean)...
Right, correct code would be:
if (hasPointerEvents()) {
map.setOnScreenZoomControls(new OnScreenZoomControls(Utils.createImage(OnScreenZoomControls.DEFAULT_ZOOM_IMAGE)));
} else {
map.setCursor(new DefaultCursor(0xFFFF0000));
}
hi ,i got exactly same doubt .
java.lang.NullPointerException
at com.nutiteq.BasicMapComponent.l(+22)
at com.nutiteq.BasicMapComponent.resize(+28)
at com.nutiteq.MapItem.paint(+35)
at javax.microedition.lcdui.CustomItem.callPaint(+51)
at javax.microedition.lcdui.Form.paintItem(+192)
at javax.microedition.lcdui.Form.callPaint(+123)
at javax.microedition.lcdui.Display.repaint(+82)
at javax.microedition.lcdui.Display.registerNewCurrent(+235)
at javax.microedition.lcdui.Display.access$700(+6)
at javax.microedition.lcdui.Display$DisplayAccessor.foregroundNotify(+46)
at javax.microedition.lcdui.Display$DisplayManagerImpl.notifyWantsForeground(+152)
at javax.microedition.lcdui.Display$DisplayManagerImpl.access$100(+6)
at javax.microedition.lcdui.Display.setCurrent(+70)
at com.tutorial.HelloMap.startApp(+68)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
iam not understanding how to avoid these errors can u anyone tell me briefly pls
tx
This exception should not come with latest version (1.0.0) anymore. If it does, please let me know. Anyway, it can be just ignored.
hi .i solved my pbm .but i got another pbm i.e.
hello map application was executed in the emulator ,but when i was tried in the mobile, maps were not displaying and even error also not coming.
i has given MGMaps api key ,but with any key also it is working in the emulator .
so to exeute my application tell me the solution .
and finally i was changed the co ordinates of the place then maps r not displaying in the emulator .
for all these tell me the solution .
If you run application in emulator then server does not check license data. If the issue is there, you should see red text with license error message.
I would need to your code to help with it, and also what is your device.
k .but that is not giving any error (red mark)
in the map place nothing was displayed.text has displayed.
N73 my device
and my code is
package com.tutorial;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import com.nutiteq.MapItem;
import com.nutiteq.maps.*;
import com.nutiteq.components.WgsPoint;
import com.nutiteq.controls.ControlKeys;
public class HelloMap extends MIDlet implements CommandListener
{
private Form mMainForm;
private MapItem mapItem;
public HelloMap()
{
mapItem = new MapItem("Map", "tutorial", this, 300, 150, new WgsPoint(24.764580, 59.437420), 12);
mMainForm = new Form("Hello map");
}
public void startApp()
{
mMainForm.append(new StringItem(null, "Hello, map!\n"));
mMainForm.append(mapItem);
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
Display.getDisplay(this).setCurrent(mMainForm); mapItem.startMapping();
}
public void pauseApp()
{}
public void destroyApp(boolean unconditional)
{}
public void commandAction(Command c, Displayable s)
{
notifyDestroyed();
}
}
in the tutorial (apikey) place i has given my generated api key (trial version).
i have executed this application susccesfully with emulator .but with device maps r not displayin.give me the solution
It looks like your phone cannot get HTTP connection. It could be missing configuration in phone, or some operator limitation. Do you have other j2me on-line applications running fine in the same phone?
and tell me the procedure how to get licenced data
jaak, would it be possible have a demo licence.. if yes, is it manditory to have a server ourself.. Can the licence allow direct request from mobile to your server.
I understand gmaps, does not allow direct access but supports indirect.
Regards,
Nagendra
Without own server we have following buit-in supported options:
a) for free, but without any service guarantee: use openstreetmap.org tiles. This is the default map source for the library.
b) with service guarantee (SLA): use CloudMade map server. These are for free, and supposedly also remain free but advertisements could be added someday. Data is the same as with Openstreetmap.
c) with SLA and with yearly fee: Navteq MapTP.
d) I know that Microsoft has made agreement with some mobile service providers and allow to use their tiles. You should contact them directly.
http://www.nutiteq.com/content/maps page has samples of these sources, and also some others. We have contacts with all map providers there and could help you with these.
Also other 3rd party map services can be added. Depending on their API it may require some small development in Lib SDK, but usually this is not needed.
hello , i have downloaded the new .jar map lib 0.10 , and i am having this exception when i run the HelloMap : java.lang.NoClassDefFoundError: com/nutiteq/MapItem
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Scheduler.schedule(+52)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
, i tried many things but it don't work though .
Help is appreciated .
In Eclipse you have to make sure that library .jar file is included also in the final package. It looks like it is not, and at least with Eclipse by default it is not.
In Eclipse: Right-click on project > Build Path > Configure Build path > Order and Export tab > select "maps-lib_xx.jar" choise > OK.
With other IDEs maybe something similar is needed.
hello again, sorry but i did that , and i still have the same problem besides when i create a package after doing that , i get an "error occurred during the build " problem and i am unable to create the package .
Sometimes Eclipse projects just get broken. It maybe helps if you create new J2ME project, add library to it, and your classes.
This package (directory) is in the samples/com/nutiteq in the library zip file.
/JaakL