Archive for April, 2008

How to implement a loading bar with J2me

Wednesday, April 30th, 2008

Do you need a simple, effective j2me loading bar for your long-running operations? And would you like to avoid using (horrible) forms and gauges? Here’s a simple component you can freely use, modify or even ignore :)

j2me canvas loading bar

You can see a live preview on the emulator. To use it, you’ll simply instantiate and start it, like this:

LoadingBar bar = new LoadingBar(100, 40, 5, 10, 0xff0000);
bar.start();

For an explanation of source code you can go to my Forum Nokia Article: J2ME Canvas Loading Bar. If you simply want rude code, here it is: LoadingBar.java, and here is a sample Canvas using it: LoadingBarCanvas.java.

Mobile Web Server 1.3 released: ready to share!

Wednesday, April 30th, 2008

Mobile Web Server has reached 1.3 version, and It’s time to give it a try!

Mobile Web Server

The setup process is really simple: you must register, and then download the software (a single SIS installer). Done that, you’re ready to share all your phone content! More in details, here are the features of the last release:

  • Guest and friend user accounts
  • Calendar - manage your calendar, and share your availability for others too
  • Messaging - SMS inbox/outbox and SMS sending
  • Phone log - view missed calls
  • Contacts - manage your contacts easily
  • Blog - tell stories on your journeys
  • Camera - share instant pictures
  • Gallery - browse pictures taken with camera phone, and share them to others
  • Guestbook - visitors can leave their comments
  • Contact me - visitors can send instant messages to you
  • Presence - share your status and device state
  • Web chat - communicate with friends

The concept behind it is really attractive: have your web server always with you, and share things without the need to upload anything anywhere. Even letting users use your phone features, like taking instant picture with the phone camera!

Mobile Web Service using phone Camera

For sure, at least here in Italy, network speed and operator plans should evolve a bit to fully allow this technology to be really used. Also, with a lot of tools to upload you content on your favorite sites, I’m a bit unsure about the real target, in terms of users and possible usages, of this product.

Said that, I definitely think It’s cool, at least for real geeks!

And, for the curious out there, if you want to browse my phone content, you can simply go to: http://jappit.mymobilesite.net.

TvProgrammi.com goes mobile!

Tuesday, April 29th, 2008

TvProgrammi.com, the Italian TV guide, finally has its mobile version!

TvProgrammi mobile

If you have a phone supporting J2me (MIDP 2.0), you can download its first version directly from www.tvprogrammi.com.

Navigation is really straightfoward:

  • 1 .. 9 keys allow channel switching
  • left/right keys change the selected date
  • up/down keys scroll the program text
  • left soft key updates programs informations
  • right soft key closes the application

This version is not suitable for devices with small displays (let’s say, with a width of less than 128px), but for those a new version will be released soon.

New KuneriLite version with cool improvements

Monday, April 28th, 2008

KuneriLite is a great tool to extend FlashLite functionalities adding support for native features like local filesystem read/write, camera recording, accelerometer capabilities and much more. All these without the need to have any Symbian knowledge.

Practically, you interact with KuneriLite engine via localhost calls. For example, if you want to get recursive folder listing starting from current application base path, you can simply do:

loadVariables("http://127.0.0.1:1001/Basic/file?
klCommand=dir&klPath=\\&klArgs=/s", targetMc);

Their tool comes with an integrated wizard and an emulator, to be used with Symbian S60 3rd edition SDK Maintenance Release, to allow full development without the need of a real device.

KuneriLite logo

Now they’ve just released 0.9.6.1 version, that fixes issues with Flash Lite 3 and add new cool features, as you can read on their blog, and it’s more than ever worth a try!

Google launches mobile image ads

Thursday, April 24th, 2008

From Google Mobile Blog good news for mobile developers: Mobile Image Ads will allow us to integrate Google image ads within our mobile websites the same way, and with the same useful analysis and report tools, as their web counterpart.

Google Mobile Ads

At the moment is still unclear how, and if, these ads could be used within mobile applications, like with other mobile ads services (i.e. AdMob), but it’ll be worth investigating a bit :)

Web Compatibility Test for Mobile Browsers

Thursday, April 24th, 2008

Mobile browsers are really grown up, and it’s a clear symptom of this the fact that W3C published a Compatibility Test for Mobile Browsers (found via Ajaxian). You can simply launch test page within your mobile browser and you’ll get visual feedbacks about supported features, including:

  • XMLHTTPRequest object support
  • <canvas> element with its Javascript API
  • contenteditable, to allow rich content editing
  • transparent PNG support
  • Dynamic SVG
  • CSS3 selectors

Test page will give you a visual feedback like this:

mobile acid test result

Where each green square means that a feature is supported on your phone, while it’s not with a red one.
If you want to give it a try just point your browser to this url: http://tinyurl.com/37e33p, or use this QR code:

Mobile acid test QR code

Building a fisheye menu in J2ME with JSR 226

Thursday, April 24th, 2008

I’ve always loved fisheye menus but, while there are quite a lot of ready-to-use components for web applications, when it comes to mobile it’s hard to find something. What better reason to build one? :)

Since we’ll have dynamically resizable icons, a natural choice to build one with J2ME is JSR 226, that give us full support of SVG Tiny. This will limit portability of code, since this JSR is not supported on all J2me phones, but support is rapidly growing with latest generation phones.

As you’ll see, code is quite straightforward, and great part of it is dedicated to coordinates/size calculations, to create that “slide/resize” effect that is soooooo cool :)

J2ME fisheye menu

You can find menu source code on my Forum Nokia Wiki article: J2ME Fisheye Menu with JSR 226, or download sample midlet here (and source code here).

FlashLite and MovieClipLoader loadClip issue

Wednesday, April 23rd, 2008

I’ve recently faced a tedious issue with MovieClipLoader and its loadClip method and finally realized its root cause thanks to this post on Jesse Warden’s blog.

Flash Lite logo

What happens is this: if you start loading a clip via loadClip(), and then, before it finishes, you remove the target MovieClip, FlashLite (noticed the same behavior in both FL2.x and FL3.0) will raise a “Unable To Load Data” error. That’s absolutely senseless and, above all, you have no ways to catch this error and avoid the horrible popup to… popup.

So, what’s the solution? Easy: do not remove MovieClips while you’re loading something within them! :)

J2ME Table component with focus and scroll

Tuesday, April 22nd, 2008

Sometimes it happens that you must draw a table within a J2ME application. Even if there are some nice UI frameworks out there, they’re simply oversized if you need only a simple, plain, scrollable table.

This is the reason why I’ve decided to write a custom component that you can use to draw tables, with the following features:

  • Focusable cells
  • Vertical scrolling
  • Auto-sizing columns

J2ME canvas table screenshot

Some nice features to be added in a future version could be, for example:

  • Cell wrap when moving from a cell to another
  • Horizontal scrolling, to support tables with a lot of columns
  • Support for headers

You can see a live version on the emulator page. Full midlet source code is available here.

Faceroller: mobile geotagged microblogging

Thursday, April 17th, 2008

FaceRoller is a micro-blogging service with integrated picture and geo-locating funcionalities: practically, you snap a photo, write what you want and tell where you are, and the job is done :) and, if you’ve got a Flickr or Facebook account, your pictures will be automatically uploaded there.

Faceroller mobile microblogging

It has also a J2me mobile client to upload photos when you’re on the go, directly from your java enabled phone.

If you want to give it a try signup on FaceRoller and then download the j2me client.

We’re still developing and expanding its concept, so comments and feedback are welcome!