• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Geocoder: Service not available

 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a small android app involving location based Android .

I am using Geocoder class to get the address details to be shown.

I ended up with Geocoder
IOException service not available.
when invoking getLastKnownLocation() method of GeoCoder class.

Could you just give hints to fix the issue?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this on a real phone? Does the phone have a GPS? Is the GPS turned on?

One other point to look at is that you should be building your application against one of the Google API levels (this is done somewhere in the Project Properties in Eclipse). And when you are running an emulator make sure the AVD has the Google API, not just Android (you usually have the option to do Android API level 17 or Google API 17 for example. Make sure you use the Google one).
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve for the reply...

Yes I am testing on real phone with GPS turned on...

Even when running on real phone, should i have to use Google API 17?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, make sure your compile target uses Google API (of whatever is the appropriate API level for your app). The Geocoder uses some Google APIs in its implementation, so if you don't build against them they aren't available when running the app.
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve..

will try that...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic