J2ME Spb Transport

Crimson after the recent articles I decided to realize his dream, to do the same for the conventional phone.

Download here
Throw link to GitHub with the project description and features, and some details under the cut


In fact, all the details described on the page at the link above. So I'll share what is not listed there. This article does not describe the process step-by-step application creation, rather just notes.
First of all a big thank you to abrowser passerby, kwikpik, shuler for very important information in the comments to article

Briefly once again describe the essence of:

    the requested static image from Google maps

    the requested picture from the website of public transport the

  1. perfect match
  2. the
  3. ???
  4. the
  5. PROFIT!!!


What problems had arisen:

the biggest problem is the definition of the BBOX.

First of all, you need to get the coordinates of the visible rectangle. The exact calculation method, I honestly was too lazy to look, so I went in the forehead and brought the factor of "degrees of latitude/longitude 100 pixels".
The next hiccup was the transformation of coordinates from WGS84 Datum in Spherical Mercator EPSG:900913.
The correct code has been found SDAs. But etim comrades thank you for the wonderful implementation of Math in j2me.

Geocoding

To enter coordinates manually awful, need Google's geocoder.
To tame it, it took me
URLEncoder here
and JSON parser here
Next, turn to geocoder (matching the region of St. Petersburg) and enjoy life.

What problems not yet solved

the
    the
  • Partial support of the Russian language. Namely, in the results of Google may appear kryakozyabry, for the same reason the menu is in English. I know that the problem is solved, but for some reason I too lazy to deal with it.
  • the
  • it would be nice to support phones with GPS. Had this not worked, the appropriate device at hand is not present, so only if it can ever be...
  • the
  • Also I would like to add a list of arriving to the next stop routes, but then I was faced with the same problems as the authors of similar applications
  • the
  • there is No adequate error handling and in precisely there are still a bunch of bugs


Happy to share project code, let it be all happiness. Especially today, such a Sunny weather :)

UPD: user story

After writing the article made a test battle. After a walk with his beloved looked at the situation on the map, and saw nothing favorable, he went to the house on foot. The updated map, I noticed a bus (riding on the other side, but to the house), quickened my pace and successfully saved myself 10 minutes.
And in the bus once again wanted to check, saw the bus and decided to transfer and put denyuzhku on the phone, not the nearest stall on the way, and in the center of the cellular communications without a fee. So still saved more and 10 rubles.
Observations:
the delay is surprising, offhand, the difference was 10-20 seconds
update everything must be done at a fixed button "5" and not on any — the screen goes blank and when yanking the joystick to activate the backlight is unwelcome update.

p.s. How I love java for the fact that such a thing can be done in less than a day.

UPD:

Google+ page with the current development status and updates
Article based on information from habrahabr.ru

Comments

Popular posts from this blog

Powershell and Cyrillic in the console (updated)

Active/Passive PostgreSQL Cluster, using Pacemaker, Corosync

Automatic deployment ElasticBeanstalk using Bitbucket Pipelines