Google Translator is a great translator tool which has a very simple AJAX API that can be easily used from mobile apps. Compared to other translator tools it has one feature which other services don’t have, the auto detection of language.
The API is really easy to use. All you need to do is to pass three parameters to the API call:
Translated text, q=Hei maailma!
Language pair (if source is empty then language is automatically identified), langpair=|en
This made it pretty easy to integrate the API call to Twim. So now in Twim 1.6 you can select a tweet from status list and select “Translate to English” from status menu and Twim will display the translation to you in seconds. Pretty handy if you are following people from other countries in Twitter. Go ahead and download the latest Twim to your mobile phone from here.
…and by the way, new feature also has the “paging” feature for home screen and search results as a bonus! Happy Twittering!
Just finished testing the latest version of Twim, v1.15. Now you can also send your photos to new TwitrPix service.
I also added few options that you can configure via settings view. You can set Twim to automatically load the home screen tweets when application is started and you can also turn on the auto-refresh option that will automatically load new tweets in every 5 minutes. If new tweets are found then phone vibrates and plays a small beep sound. With this feature you won’t miss a single tweet again :)
Here’s the trick how you can add touchscreen scrolling to your J2ME applications. The key to touchscreen support is the Canvas class and its’ methods pointerPressed, pointerDragged and pointerReleased. These events are called when user puts finger on the screen (pressed) and drags the finger (dragged) and finally when removes the finger (released). Each method has the x and y coordinates for the pointer action.
The scrolling is implemented with the pointerDragged event. We store the current location of the canvas to variables verticalLoc and horizontalLoc. When finger (pointer) is dragged then location is changed according to the dragged amount. Variables are used on paint method to draw the area so that it is scrolled that correctly. You can also see from the sample code how you can draw background with repeatable pattern image.
I’m learning to use the git, distributed version control system. It seems to be much faster then Subversion that I have used with my Google Code projects. I just created a repository on GitHub for Mobidentica project. Source code is available under the Apache License 2.0. If you like to clone the repository, use this:
I’ll have to see if I’ll start using git with those projects that are on Google Code as it seems to be possible too: Benjamin Lynn from Google Developer Programs wrote a blog post on how to use git on Google Code projects.
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.