Sending files to mobile phone using Bluetooth and OBEX

June 20th, 2008

My previous posting “Using Bluetooth stack in desktop application” was quite a success if measured by the number of comments. It seems that there aren’t many tutorials or articles about the Desktop usage of Bluetooth.

Here is a next chapter in the same category: using Bluetooth to send files from a computer to a mobile phone.

Bluetooth file sender application

Read on if you are interested…

Read the rest of this entry »

Mobile Trail Explorer v1.10

May 6th, 2008

Lots of coding have been done for the next version of Mobile Trail Explorer. I’m happy to announce the release of version 1.10. This release contains many fixes such as loading/saving of trails. Previous version wasn’t necessarily able to load saved trails because of corrupted data.

Mobile Trail Explorer v1.10

Another nice feature is the ability to import both trails and waypoints from KML files so now you can create trail in Google Earth and import it to Mobile Trail Explorer where you can display it as a ghost trail that you can follow.

There is also a new feature for allowing you to post your location to web and create a web service that records your trails. User guide contains a bit more information about this. Location can be posted in the specified URL with query parameters like this:

…/record.php?lon=@LON@&lat=@LAT@&alt=@ALT@

It is very recommended to uninstall the previous version and it’s data before installing this release.

Here are release notes for the v1.10:

  • Support varying screen sizes like rotating screen on N95
  • Improved startup time
  • Support for uploading position to web server
  • Scrolling (up/down) on the information screen
  • Fixed the saving/loading of trails using RMS
  • Import trails from KML files
  • Import waypoints from KML files
  • Fixed waypoint editing when handling quickly added or imported waypoints
  • ??????

Lots of great feature ideas have been shared in the Google Group discussions so join the conversations if you have some feature needs in your mind.

You can download the binaries (JAR and JAD) from Mobile Trail Explorer page???????? and source code can be downloaded from Google Code project page.

Go ahead and start recording your trails!

Analog clock service for web apps

April 13th, 2008

I’m nowadays working in an international company which has offices in multiple countries. I was looking for a way to get our Confluence, Enterprise Wiki, to display current time in all of our offices in one page. I didn’t find any simple solutions as lots of services just provided me a chunk of HTML that I could add to my page to create a dynamic clock but wiki syntax doesn’t really let me do that.

I’m a great fan of Google Charts API. Developers at Google have developed a really nice URL based API for the charting purposes. This was inspiration for me when I created Clock Service API for my own needs.

Clock Service is a simple servlet implementation that generates an image with the specified parameters. API can be used to define image size (s=100), timezone (tz=zone), title (t=Helsinki) and 12h/24h format (f=24). With this I can use the following URLs to produce three different clock images for three different timezones.

/clockservice/clock?tz=America/New_York&s=150&t=Atlanta&f=12
/clockservice/clock?tz=Europe/Helsinki&s=150&t=Helsinki&f=12
/clockservice/clock?tz=Australia/Sydney&s=150&t=Sydney&f=12

If you use those URLs in IMG tags then the result would look like this:

Clock (Atlanta)Clock (Helsinki)Clock (Sydney)

The images above aren’t created dynamically as I don’t have any public servlet container available.

The code behind the service is really quite simple. There are only two classes ClockServlet and Clock. Servlet implementation is only used for parsing the parameters from the request and writing the bytes from Clock.getImageData(..) to the web response.

Timezones are handled using the Java’s Calendar and TimeZone classes like this:

  1. TimeZone tz = TimeZone.getTimeZone("Europe/Helsinki");
  2. Calendar cal = Calendar.getInstance(tz);
  3. int hour = cal.get(Calendar.HOUR);
  4. int minute = cal.get(Calendar.MINUTE);

You can find the source code and compiled WAR package from the application page, here. Application is distributed under the Apache License v2.0.

Test driving NetBeans IDE 6.1 Beta

April 8th, 2008

I’ve been using NetBeans IDE for quite a few years now. It has improved very nicely over the years and it have became a top player in the IDE field. If you are a Eclipse or IDEA developer I’d suggest you to at least try it out as it is not the same as it was year before.

NetBeans IDE 6.1 Splash Screen

I’m eagerly waiting for the actual release as it is packed with useful features that will truly improve the development flow. Here are some of the features what I’m waiting for the most:

  • JavaScript support with semantic highlighting, code completion, type analysis, quick fixes, semantic checks and refactoring
  • Spring framework support with features such as configuration file support, code completion and hyperlinks to speed navigation
  • New MySQL support in the Database Explorer to make it easier to create, launch and view MySQL databases
  • +lots of other features

See some of the highlights in action after the jump.

Read the rest of this entry »

Mobile Trail Explorer v1.9

April 1st, 2008

I’m proud to announce the release of Mobile Trail Explorer v1.9. Big thanks for all contributors and team members. This version should fix some of the issues with the Sony Ericsson phones and add bunch of great features such as:

  • Trail is now projected using the mercator projection
  • Both trail and map are now zoomed with same keys (1 and 3)
  • File browser for importing trails and selecting export path
  • Logger can now write to the filesystem
  • Signal strength SNR key to Sky View and updated help screen
  • Change screen on space key as well as 0 key
  • Export and import waypoints

One of the most wanted feature is the support for the internal GPS devices such as Nokia N95 and E90. This is now implemented in this version and it can be activated from the menu:

Settings > Development Menu > Use JSR179 (if available)

It would be great if N95, E90 and other JSR-179 device owners could test out this feature and report how it is working for them. This is something that will get me buying N95 (or N96) if we get it working correctly.

Go ahead and download the latest binaries from here or download the whole source from here. Don’t forget to send your feedback either to this blog post or to the Google Group of Mobile Trail Explorer.

Twittering with Twim v1.0

March 3rd, 2008

I have made a small improvements to my mobile Twitter client that is called Twim. I contacted Twitter engineers and they helped me so that status updates will now have a correct source in style “… from Twim” as seen on my Twitter page. poker texas holdem,poker texas holdem gratis,texas holdem poker downloadsexy poker gratis7 card stud gratisamerican pokergiochi da pokertexas holdem on linetornei texas holdempoker on line italianopoker play moneypoker da scaricare gratisstrip poker flashpai gow pokergioco poker freewarestreet poker onlinepoker tour gamegioco poker texasforum poker on linepoker machine gratispoker sexi gratisfree omaha pokerpoker holdtorneo poker on linegiochi flash pokerpoker on line gratuitogioco poker,gioco poker scaricare gratis,regole gioco pokergioca poker online gratis,giochi online poker gratis,poker online gratiseurobet pokerplay poker on line,video poker on line,poker on linegiochare omaha poker in lineatexas holdem poker regoletornei poker gratisdraw poker goldgioco texas holdemonline casino pokercard studpoker pc gratisstreet pokertexas holdem milanoil pokerplay free omaha poker onlinepoker gioco completoplay omaha pokergioca poker on linepoker texano on linepoker roomtorneo poker onlinegiochi 7 card stud gratisscaricare gioco pokerpoker gratuitopoker superstar gratis You can also now check the transferred data amount from the about screen. Here is a photo of Twim running on my Nokia N80. As you can see, it also now displays the status time (e.g. 2 hours ago).

Running Twim on my Nokia N80

So please upgrade your Twim to the latest version by downloading it from here. If you are a software developer you might be interested in looking at the source code that is available here with the Apache License 2.0.

Please send me any feature suggestions, bug reports and Twitter feeds that I should be checking out :) Happy Twittering!

Charting with JFreeChart

January 27th, 2008

I’ve been coding dashboard applications lately with Java SE. I have used JFreeChart library to generate all pie, line and bar charts. The library is awesome and is also Open Source. It would be very nice to see similar projects in the .NET world.

It was very easy to create first charts with JFreeChart mostly because it is so commonly used so there are many resources available in the Internet including tutorials and tips&tricks.

Here is a small sample how to create a simple pie chart and use it in your Swing application:

  1. // First create dataset
  2. DefaultPieDataset dataset = new DefaultPieDataset();
  3. dataset.setValue("Finland", 5300367);
  4. dataset.setValue("Sweden", 9107649);
  5. dataset.setValue("Norway", 4606363);
  6. dataset.setValue("Denmark", 5427459);
  7. dataset.setValue("Iceland", 309699);
  8.  
  9. // Create chart using the ChartFactory
  10. JFreeChart chart = ChartFactory.createPieChart(
  11. "the Nordic countries", // Title
  12. dataset, // Dataset
  13. false, // Don’t show legend
  14. false,
  15. false);

The following code adjusts chart appearance and section colors. This is not mandatory but shows how easily you can customize the visual parts of the chart.

  1. // Adjust appearance (optional)
  2. chart.getTitle().setPaint(Color.LIGHT_GRAY);
  3. chart.setAntiAlias(true);
  4. PiePlot plot = (PiePlot)chart.getPlot();
  5. plot.setShadowPaint(Color.DARK_GRAY);
  6. plot.setBackgroundPaint(
  7. new GradientPaint(0,0,Color.DARK_GRAY,0,100,Color.GRAY) );
  8. plot.setLabelBackgroundPaint(Color.GRAY);
  9. plot.setLabelLinkPaint(Color.LIGHT_GRAY);
  10. plot.setLabelOutlinePaint(Color.LIGHT_GRAY);
  11. plot.setLabelShadowPaint(Color.DARK_GRAY);
  12.  
  13. // Adjust section colors (optional)
  14. Color[] colors = {
  15.     new Color(0xB0CC99),
  16.     new Color(0×677E52),
  17.     new Color(0xB7CA79),
  18.     new Color(0xF6E8B1),
  19.     new Color(0×89725B)
  20. };
  21. for(int i=0; i<dataset.getItemCount(); i++) {
  22.     Color sectionColor = colors[i%colors.length];
  23.     plot.setSectionPaint(i, sectionColor);
  24. }

That is all you have to do to create a chart object. Then if you wish to display this chart for example in your Swing application you’ll need to do the following:

  1. ChartPanel chartPanel = new ChartPanel( chart );
  2. yourPanel.add( chartPanel );

And this is the result:

JFreeChart example of PieChart

Fix for Sony Ericsson phones (MTE Beta)

January 9th, 2008

Lots of Mobile Trail Explorer users have complained that application doesn’t work with Sony Ericcson phones. Latest version (1.8) doesn’t even seem to start. Phone only displays “Operation Failed” error message.

Fixed Sony Ericsson bug

Fortunately there are some active people in the community as one of the users discovered the source for the problem. He wrote the solution to the Google Code’s project site describing that the use of Samsung and Siemens specific APIs for the backlight feature was causing the trouble. When references were removed from the code base the application worked without problems.

import com.samsung.util.LCDLight;
import com.siemens.mp.game.Light;
...

Shortly after this I made the same changes to the code and I uploaded the fixed version for people to try out and I have already received multiple positive feedbacks from this change. Please try it out yourself and report back if the problems with the v1.8 are gone. Note: Unfortunately OutOfMemory exceptions are still there but hopefully we are also able to fix those in the future releases.

Download the beta v1.9 build here.

NetBeans Goodies

December 21st, 2007

NetBeans Goodies

I thought it was already Christmas as I just received a package from Sun Microsystems full of NetBeans goodies. I won these from the NetBeans.TV competition. Package included nice T-shirt, Rich Client Programming book, NetBeans pen, 1Gb memory stick and stress ball (or cube actually).

I have used NetBeans IDE 6.0 from the early daily builds and participated into NetCAT 6.0 program which was very nice experience. Now I’m using the latest release version of the NetBeans IDE and I’m loving every minute of it! NetBeans team have done excellent job! Best IDE just got better :)

Go ahead and download the latest release if you haven’t tried it out already.

Visualizing global networks with Java 3D

December 12th, 2007

I have had this idea of visualizing global networks and connections with 3d globe for a long time but haven’t had time to try it out. Now that I’ve been exploring possibilities of Java 3D I was able to implement this feature quite easily.

The current API looks like this:

Globe globe = new Globe(this);
globe.addConnection("Finland", "Germany");
globe.addConnection("Finland", "Italy");
globe.addConnection("Finland", "Egypt");
globe.addConnection("Finland", "United States");
globe.addConnection("Finland", "Japan");
globe.addConnection("Finland", "China");
globe.addConnection("Finland", "South Africa");
spinGroup.addChild(globe.getGroup());

And here is the result.

Global network with Java 3D