Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location Api

 
Anil Kukreti
Greenhorn
Posts: 11
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends I am new to J2me programs development.
I 've written a program to access the location coordinates of a cell phone. Whenever i am running it on emulator, it's running fine but as soon as i am checking it on Nokia N82 it is raising "Location Exception". The code is as
public FindLocation(LocationMidlet locationMidlet){
this.locationMidlet = locationMidlet;
cr.setHorizontalAccuracy(500);
cr.setVerticalAccuracy(500);
try{
lp = LocationProvider.getInstance(null);
l = lp.getLocation(10);
}catch(LocationException e){
this.locationMidlet.list.append("Location Exception",null);
}
}catch(Exception e){
this.locationMidlet.list.append(""+e,null);
}

if(c!=null){
this.locationMidlet.list.append(" "+c.getLatitude(),null);
}
}
thanks
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would probably help if you printed the message text for the exception.
 
Austin Lee
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try use the sdk of Nokia.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic