Nokia 5230 Express Music - GPS Navigation

Published at May 25, 2010 | Tagged with: , , , , ,

The Myths about Integrated and  Assisted GPS

A week ago I bought Nokia 5230 from M-tel mainly because of the integrated GPS. This is my first meet with this kind of device and after some GPS "problems" I`m ready share my experience(At the end of this post there is explanation how to turn on/off different types of positioning methods).

Using Assisted + Integrated GPS the positioning is completed for a few seconds(outdoors) but(I noticed that later) this results in small GPRS traffic(mainly for the "cold start") which costs some money so I tried to avoid it and turned "Assisted GPS" off.

Later when I try it with "Integrated GPS" only it was unable to connect to satellite, so I started reading forums and post what is going on. In this discussion I learned about the TTFF(Time To First Fix) and after reading that this fix can take an hour I went mad. Fortunately the real tests give better result.

In my case the positioning takes few minutes(less than 5) when I was standing still, on a clear place and holding phone in a way that my hand doesn`t cover the GPS antenna. After this time no other issues and connection loss. For a trip that contains of about 10 minutes in a bus, 10 walking(the phone was in my pocket), 15 indoors(in a shop) and 10 more walking it didn`t loose satellite connection. So don`t worry that you`ll have to a pay a lot of money for GRPS traffic, bluetooth GPS device or else. Just hold you position for a few minutes and wait the phone to connect, after this the device will be working absolutely fine. Have in mind that seeing satellites in the "Satellite status" doesn`t mean that your position is already calculated. Wait until you see the green bars on the bottom of the map(instead of the yellow one). The satelite status can be check in Menu->Location -> GPS data ->Position -> Options -> Satellite Status

How to turn on/off different types of positioning methods: My phone originally had older version of Ovi Maps(maybe 2.x) and I updated it with the latest one(3.03). After installing it I noticed the "Location" application in Menu->Applications(I`m not absolutely sure whether it was there before the update). If you open it you will seen 3 choices "Landmarks", "GPS Data" and "Positioning". From "Positioning" choose "Positioning method" and you will see 4 options - "Asissted GPS", "Integrated GPS", "Bluetooth GPS" and "Network based".

Have a nice navigation and feel free to ask if you have any questions.

GAE, Timezones and weekdays...

Published at May 23, 2010 | Tagged with: , , , ,

... or how to find the date of week in specified timezone, no matter where your server is.

The problem: I maintain a site targeting user in single country(single timezone) and I have to create administration based on a day of week(show this on Monday, that on Tuesday etc.). The site is based on Google App Engine Platform.

The simplest and most obvious solutions is to take the current time and add/substract the difference between server timezone and your target timezone. Unfortunately this is not going to work in our case.

Speciality: As you may know google have multiple data centers all over the world.


(more info at
royal.pingdom.com.)

So you can not be sure which server is currently responsible for your app. Also you have a DST(daylight saving time) that also must be included in calculation. Fortunately you can use UTC time and
PyTZ for GAE.

Solution:


from datetime import datetime, timedelta
from pytz import timezone
import pytz
bg_zone = timezone('Europe/Sofia')
bg_zone_time = bg_zone.localize(datetime.utcnow())
day_of_week = bg_zone_time.strftime("%w")

Explanation:
#5) create timezone object corresponding to your timezone(in my case this is Europe/Sofia)
#6) get the correct time for the specified timezone calling localize method of the timezone object with current UTC time as parameter
#7) using time formatting to get the day of week. There is simple catch here, at first I try it with weekday() method and get incorrect results. It looks like the method ignores the timezone/DST correction, so you have to use strftime().

Final words: I didn`t test all methods so I couldn`t say which one ignores the timezone and which not, but I hope this article will be helpful for someone facing this or similar problem. Any correction and code improvements will be appreciated.

Lets start!

Published at May 19, 2010 | Tagged with:

Hi, and welcome to my blog. I`m Ilian Iliev, software engineer(with heat engineering background) and passionate web developer. Here I`ll post articles about programing(python, django, google app engine etc.) as well as my adventures in real world - music, travel, chess and many others. Hope that you will find the useful and interesting, feel free to comment them and contact me.  Also English is not my native language so you`re welcome to correct me if I mess it up.

I`m glad you`re here but now go and check my newest posts.