NewsFlow, Google Reader client for Nokia N8 and N900

I’ve been really impressed with the latest Qt SDK 1.1 Technical Preview release since now I tend to launch Qt Creator instead of TextMate when editing QML files. Only bugs that I’ve found are the problems with the remote compiler so I still need Windows machine to compile apps to Symbian^3 platform.

With Qt SDK 1.1 I’ve been working on the next version of TwimGo but now I needed some break from that and got an inspiration for news reader from Nokia Reader which is a new RSS reader from Nokia Beta Labs.

I tend to use Google Reader heavily to read my feeds and didn’t like the idea of subscribing to feeds on another application. So this made me create a simple Google Reader client with Qt Quick, QML.

Application uses pure QML and JavaScript to access Google Reader API and displaying items. No custom C++ was written for the app. Application runs nicely on my Nokia N8 and N900. See how it runs on N8:

I’ll try to release this app soon if you’d like to try it out.

Optimizing Trail Recording

I coded a prototype how we could record fewer GPS positions in Mobile Trail Explorer and therefore save some memory but still have the same level of detail of the trail. Video might explain it best. Unoptimized recording is on the left and optimized trail is on the right.

The algorithm simply checks if the current direction have changed since last recorded position. If direction isn’t changed over the tolerance value then we can replace the last position with current position. Otherwise we only append the new position to the trail.

  1. public boolean canRemovePreviousPosition(
  2.         Vector<GpsPosition> positions,
  3.         GpsPosition pos1) {
  4.  
  5.     if(positions.size()<2) {
  6.         return false;
  7.     }
  8.  
  9.     GpsPosition pos2 = positions.elementAt(
  10.             positions.size()-2 );
  11.     GpsPosition pos3 = positions.elementAt(
  12.             positions.size()-1 );
  13.  
  14.     // Calculate last angle of trail
  15.     double latDelta = pos2.lat – pos3.lat;
  16.     double lonDelta = pos2.lon – pos3.lon;
  17.     double lastAngle = Math.atan(latDelta/lonDelta);
  18.  
  19.     // Calculate current angle
  20.     double latDelta2 = pos3.lat – pos1.lat;
  21.     double lonDelta2 = pos3.lon – pos1.lon;
  22.     double currentAngle =
  23.             Math.atan(latDelta2/lonDelta2);
  24.  
  25.     // Get absolute value of direction change
  26.     double angleDelta =
  27.             Math.abs(lastAngle – currentAngle);
  28.  
  29.     // Check the tolerance (0.105 radians = 6 degrees)
  30.     if(angleDelta>0.105) {
  31.         return false;
  32.     } else {
  33.         return true;
  34.     }
  35. }