DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Limits of the Android Geocoder

Limits of the Android Geocoder

Fabrizio Giudici user avatar by
Fabrizio Giudici
·
May. 03, 10 · Interview
Like (0)
Save
Tweet
Share
15.41K Views

Join the DZone community and get the full member experience.

Join For Free

blueBill Mobile, for which a brand new site has just been created, provides some important location-oriented feaures, as it records the coordinates of bird observations. While, after all, the coordinates are the single important location datum, as they can be resolved later with some postprocessing, blueBill Mobile makes it possible to share your observations in real time: in this case, making available the name of the place where you saw the bird might be valuable, because not everybody in your recipient list has got a GPS-capable phone (... yet?).

Android provides a Geocoder in the standard APIs which is pretty simple to use, as this code excerpt demonstrates:

import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import it.tidalwave.geo.Coordinate;

Context context = ... ;
Coordinate coordinate = ... ;
Geocoder geocoder = new Geocoder(context);
List<Address> addresses = geocoder.getFromLocation(coordinate.getLatitude(), coordinate.getLongitude(), 100);

Unfortunately, tests on the field proved it to be almost useless, at least in my typical scenarios. The problem is that it seems that a single geocoder service is available (and of course it is the one provided by Google by means of its web services) and the following problems arise:

  1. I've repeated this a number of times in the past years: the "always connected" thing is a myth. Italy's mobile network coverage is excellent and just an epsilon below the 100%. Still, in the countryside, or in a dense wood, it's easy to find places where the radio signal is so weak that the connection doesn't work or takes a very long time to transfer data. Usually it's a matter of moving around to pick a better signal, but this is not the thing you want to do while observing birds. Thus, I need to have a geocoder capable to resolve at least a subset of common locations without requiring a network connection.

  2. The quality of data provided by the Google geocoder in my country is very variable. Sometimes it's able to pick even the name of the nearest, small fraction of houses around; other times it just resorts to returning "Province of XYZ", which is too vague. Being able to aggregate multiple results from different geocoders (e.g. GeoNames, or Yahoo!) might resolve the issue or at least improve things here.

  3. I've realized that for my purposes I also need to rely on user-provided location names. For a birder, the indication "Observatory #5 in the FooBar Wildlife Sanctuary" might be extremely useful, but I don't think it's even possible to have the Google geocoder capable to resolve it (while it would be possible, for instance, with GeoNames that accepts user-contributed data). Another case for multiple geocoding services, one of which should be local. Indeed, I'm a bit surprised that Android doesn't provide a service to register custom locations in the preferences, as it is possible e.g. to have a database of contacts.

In other words, the Location APIs in Android are too closed and Google-centric. I'll have to import the code used in forceTen, which implements pluggabe GeoCoders and already has got a GeoNames provider. Fortunately, the fact I'm able to run at least a subset of the NetBeans Lookup API on Android should make the task not too hard to achieve.

First Screencast of blueBill Mobile

I'm able to provide a first decent screencast of blueBill Mobile, even though I've still to learn and improve the way screencasts of Android applications can be made:

Android (robot)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Comparing Map.of() and New HashMap() in Java
  • Benefits and Challenges of Multi-Cloud Integration
  • Integrating AWS Secrets Manager With Spring Boot
  • Kubernetes-Native Development With Quarkus and Eclipse JKube

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: