Spb Transport J2ME
Having caught fire after a recent article, I decided to realize my dream by doing the same for my most ordinary phone.

You can download it here. I
’ll immediately throw a link to GitHub with a description of the project and features , and some details are under the cut.
In fact, all the details are described on the page using the link above. So I will share what is not indicated there. The article does not describe the process of step-by-step creation of the application, rather just notes.
First of all, many thanks to passerby , kwikpik , shuler habrayuzers for very important information in the comments to the article
First of all, you need to get the coordinates of the visible rectangle. I honestly was too lazy to search for the exact calculation method, so I went head-on and deduced the coefficient “degrees of latitude / longitude per 100 pixels”.
The next hitch was the conversion of coordinates from WGS84 Datum to Spherical Mercator EPSG: 900913.
The desired code was found here . And thanks to these comrades for the wonderful implementation of Math in j2me.
Entering coordinates manually is terrible, you need a Google geocoder.
To tame it, I needed a
URLEncoder from here
and a JSON parser from here.
Next, we turn to the geocoder (specifying St. Petersburg as an area) and enjoy life.
I am happy to share the project, the code, may all be happy. Especially today such sunny weather :)
After writing the article, he arranged a battle check. After a walk with my beloved, I looked at the situation on the map, did not see anything in passing, I went on foot to the house. On the go I updated the map, noticed a bus (driving from the other side, but to the house), took a step and successfully saved myself 10 minutes.
And already on the bus I wanted to check again, I saw a trolley bus and decided to transfer and put denyuzhku on the phone not at the nearest stall along the way, but in the center of mobile communication without commission. So I also saved 10 rubles more.
Observations: the
delay is surprising - offhand the difference was 10-20 seconds, the
update must still be done using the fixed button "5", and not any - the screen goes blank and when you pull the joystick to activate the backlight, an unwanted update is made.
ps How love java for the fact that such a thing can be done in less than a day.
Google+ page with current development status and updates

You can download it here. I
’ll immediately throw a link to GitHub with a description of the project and features , and some details are under the cut.
In fact, all the details are described on the page using the link above. So I will share what is not indicated there. The article does not describe the process of step-by-step creation of the application, rather just notes.
First of all, many thanks to passerby , kwikpik , shuler habrayuzers for very important information in the comments to the article
Briefly tell you the essence again:
- request a static image from Google maps
- request a picture from the public transport site
- impose one on another
- ???
- PROFIT !!!
What problems arose:
The biggest problem is the definition of BBOX.
First of all, you need to get the coordinates of the visible rectangle. I honestly was too lazy to search for the exact calculation method, so I went head-on and deduced the coefficient “degrees of latitude / longitude per 100 pixels”.
The next hitch was the conversion of coordinates from WGS84 Datum to Spherical Mercator EPSG: 900913.
The desired code was found here . And thanks to these comrades for the wonderful implementation of Math in j2me.
Geocoding
Entering coordinates manually is terrible, you need a Google geocoder.
To tame it, I needed a
URLEncoder from here
and a JSON parser from here.
Next, we turn to the geocoder (specifying St. Petersburg as an area) and enjoy life.
What problems have not been resolved yet
- Incomplete support of the Russian language. Namely, in the issuance of Google, the crazies can appear, for the same reason, the menu in English. I know that the problem is being solved, but for some reason I am too lazy to do it.
- It would be nice to support phones with GPS. I have never worked with this, there is no corresponding device at hand, so only if it can ever be ...
- I would also like to add a list of routes arriving at the nearest bus stop, but here I encountered the same problems as the authors of similar applications
- There is no adequate error handling and generally there are still a bunch of bugs inside
I am happy to share the project, the code, may all be happy. Especially today such sunny weather :)
UPD: user story
After writing the article, he arranged a battle check. After a walk with my beloved, I looked at the situation on the map, did not see anything in passing, I went on foot to the house. On the go I updated the map, noticed a bus (driving from the other side, but to the house), took a step and successfully saved myself 10 minutes.
And already on the bus I wanted to check again, I saw a trolley bus and decided to transfer and put denyuzhku on the phone not at the nearest stall along the way, but in the center of mobile communication without commission. So I also saved 10 rubles more.
Observations: the
delay is surprising - offhand the difference was 10-20 seconds, the
update must still be done using the fixed button "5", and not any - the screen goes blank and when you pull the joystick to activate the backlight, an unwanted update is made.
ps How love java for the fact that such a thing can be done in less than a day.
UPD:
Google+ page with current development status and updates