Archive for the ‘nokia’ Category

FliKun: KuneriLite based FlashLite photo uploader for Flickr

Wednesday, June 25th, 2008

Today, we’ll see how it’s possible to build a Flickr uploader in FlashLite using KuneriLite, geotagging our photos with the current GPS location.

You can download the current FliKun version (for FlashLite 3.0) here: FliKun_3rd_edition_unsigned.sis (please read the notes at the end of this article).

Flikun Screenshots

So, let’s start from the beginning.

Flickr API

To upload photos to Flickr we’ll need to use Flickr API: this way we’ll be able to authenticate the user and upload/geotag photos using its REST services, all from within our application.

First thing we should do is to setup an API key for our service, going on the request page. Here you have to fill out the application details, with special care to the authentication method we want to use: suitable choices for our needs would be both desktop and mobile application authentications:

  • With the first option the user will be redirected to a Flickr page, from within our application, where he should authenticate and grant necessary permissions to our application.
  • With the second option we can let the user generate a mini-token from a dedicated page, using his desktop browser, and then tell him to insert this mini-token within in our application.

In both cases, we will get a token that will be used for all future uses of our application, so there would be no more need to authenticate the user after the first time.

KuneriLite Plugins

In our application, we will need to access these functionalities:

  • Retrieve photos stored in phone’s gallery
  • Make thumbs to show them in our application
  • Start the GPS and retrieve user’s current location
  • Upload stored photo on Flickr server

So, we’ll need to use the following KuneriLite plugins:

  • GPS: we’ll use the start command to start GPS, and the read command to read current location
  • File: with dir command we’ll be able to list files in phone’s gallery folders. We’ll use this also to store textual infos, like the user token
  • Upload/Download: with this plugin we’ll upload the photos to Flickr website, using its API, and create the thumbs (with the resize command) to show them within our application

Get a token

We’ll use the desktop authentication method, so these are the steps required to authenticate the user, and to get his token:

  • Get a frob, with the Flickr flickr.auth.getFrob method
  • Generate the desktop authentication URL with the given frob
  • Send the user to the generated URL, using the phone browser, where he should authenticate and grand permissions to our application
  • When the user is back to our application, we will finally get his authentication token with the flickr.auth.getToken Flickr method

All these Flickr API calls need to be signed with an api_sig parameter, that is explained here: Flickr Authentication API page (in the Signing paragraph). To generate it in our FlashLite application, we’ll use the following function:

function getApiSignature(args:Object)
{
	var authSig:Array = new Array();
 
	for(var key:String in args)
	{
		authSig.push(key + args[key]);
	}
	authSig = authSig.sort();
 
	var apiSig:String = this._md5.hash(<API_SECRET> + authSig.join(''));
 
	return apiSig;
}

where <API_SECRET> is the API Secret associated to your API Key (you can see both of them on Flickr API Keys page).

If all has gone well, we will finally get the user token, that we must store somewhere (for example using SharedObject, or within a local file using KuneriLite file plugin).

Show phone gallery photos

Since we’ll use S60 3rd edition phones, we’ll search for photos in these folders: “C:\Data\Images\” and “E:\Images\”. Since on these phones photos will be stored in many subfolders, we’ll search within them, using “/s” argument within KuneriLite dir call. Also, we should avoid listing photo thumbs, that are stored
in subfolders named “_PAlbTN”, so it’ll be easy to spot out and avoid to get them.

Once we have the photo paths, we can use the KuneriLite resize command to resize them to our preferred size, and use those thumbs within our application. In doing this, we should care for the following points:

  • It’s not possible to load more than 5 resources at once, so we should generate and load thumbs in a progressive manner, otherwise we will have lost calls (without any feedback or exception) within our application
  • While loading a thumb in a MovieClip, we should take care not to remove the Clip while it’s loading (for example, because the user has navigated to another screen). Doing this we’ll avoid the issue described here.

Enter photo details and upload it!

Once the user has selected a photo, we should let him enter photo data (title, description and tags), and then let him choose if he wants to tag with his location the photo itself.

In this case, we can use the approach described in this other article to retrieve the current GPS location: Displaying gps position in flashlite using google static maps and kunerilite.

Once we have the GPS location coordinates, we can finally upload the photo to Flickr website with the upload API. Since the upload API itself requires, apart from the file itself, to send the other params within the POST body, we should use some sort of server proxy, since KuneriLite upload command does not allow to post them this way. What we could do is to send the textual parameters within the upload URL, and then let our proxy POST them to Flickr server.

Get FliKun!

This first release of FliKun is very (very!) alpha, so try it at your own risk :) jokes apart, there are still many points open (like the horrible graphics!), so expect new versions as soon as I’ve got the time to work more on it!

Download FliKun_3rd_edition_unsigned.sis (for FlashLite 3.0).

Currently known issues/bugs are:

  • Sometimes upload fails, especially when using some special characters
  • There is no upload progress bar (but will be added very soon)
  • File upload fails (with error code -4) when photo size is bigger than approx 450 Kb (I’m currently working to solve this)

For any other bugs you may encounter, please leave comment on this post! Thanks :)

Finally note that, to use the GPS feature, you’ll need to sign the SIS file with a valid certificate.

I’m a Forum Nokia Super Contributor (with a custom Avatar :))

Monday, June 23rd, 2008

Just a post with some self celebration :)

I’ve recently hit the target of 500 posts on Forum Nokia Discussion Boards, and so I’ve acquired the Super Contributor title! Here’s the related post, but the best thing is absolutely the customizable avatar bonus, so here it is:

Jappit Avatar

My design skills are not that good, don’t you think? :)

Meanwhile, also a new Forum Nokia Champion Champion of the Month has been proclamed, so kudos to Pankaj Nathani (already Forum Nokia Champion at the beginning of this year) for his great contributions and participation in Forum Nokia community! Keep up the good work!

Forum Nokia 2008 Code Example Challenge Winners announced!

Friday, June 13th, 2008

2008 Code Example Challenge took place on Forum Nokia Wiki, and reached the goal of nearly 300 articles (code examples and applications) submitted by more than 50 developers around the globe.

2008 Code Example Challenge winners banner

And finally… here are the Winners!

Also, special prizes (Nokia 6220 Classic Devices) were given to: Raheal Akhtar, David Caabeiro, Gerald Madlmayr, Felipe Andrade, Olympio Cipriano and… me :) I’m too happy!!

If you want to take a look at the impressive list of all articles submitted by developers for the whole contest, take a look here: 2008 Code Example Challenge article list.

Google Maps mobile tutorial is Wiki article of the Month!

Wednesday, June 11th, 2008

I’m really honored that another article, published on Forum Nokia Wiki, has been selected as Article of the Month!

Google Maps article of the month

As the previous one, this also is related to Google Maps usage in mobile applications, and you can read it here: How to use Google Maps data in mobile applications.

As its name says, It’s an introductory article on how to use Google Maps services, in particular the geocoding and static maps ones, from a mobile application, where standard Google Maps API code is not suitable (since it is thought for web based and Ajax’d apps). Its content does not focus on any particular programming language, but gives base guidelines to use those services using REST.

So… any kind of feedbacks is welcome! :)

Nokia Code Camp Winners, iPhone 3G and Jarpa

Wednesday, June 4th, 2008

After a busy period, I finally got some time to come back to Jappit blog, just in time to announce…

Forum Nokia Code Champ Winners!

This competition, launched by Nokia to promote the development of WebRuntime and Flash-based applications has finally announced his winners, and there are really cool applications!

CityLite

CityLite of IdeasLite is a guide to night life in Latin American capitals, with informations about events, theaters, and a lot more. Really cool interface!

Kuneri EasyVote

KuneriLite team also won the award for Europe/Middle East/Africa with their one-button voting system: Kuneri Easy Vote! Congratulations for their good work!

For the full list of winners, you can look here.

iPhone 3G is finally here!

Iphone 3g

After months of guessing and posting, Apple will finally announce, during San Francisco Apple WorldWide Developers Conference of June 9th, the 3G version of its iPhone. And it seems that it’ll arrive in Italy before the end of June branded by the two Carriers Tim and Vofafone.

While it’s definitely a good news that it’ll support HSDPA, it seems that we’ll not have a builtin GPS… too bad for all location-fanatics! :)

Jarpa, source code is out!

Jarpa

Jarpa is an absolutely interesting project aiming to extend FlashLite and Java ME feature by allowing them to intercommunicate, and so allowing developers to create hybrid applications that can take the best of both worlds.

Some days ago, Felipe Andrade has finally released Jarpa sourcecode, so developers can finally start to benefit of this framework, and for J2ME and FL-addicted like me, this is a GREAT news!

And, if you need one more reason to congratulate with Felipe for its great and extensive work, here is its Nokia Championship award!

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.

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!

AnimaLogic: S60 Web Runtime game

Wednesday, April 16th, 2008

I’ve got some fun with my friend Fabio in creating a first game for Nokia Web Runtime.

Since Web Runtime allows building mobile applications with classic web technologies, we’ve used nothing more that html, css and plain-old-good javascript… isn’t it great? :D

Animalogic Web Runtime game

It’s a very first alpha release with not too much functionalities (local hi-scores and a single game mode), but feel free to take a try :)

The main interface was done using classical <a> elements to represent the menu options, but this has 2 important drawbacks, as you can see:

  • links (like also input fields and other focusable elements) when focused are surrounded by a thick border: not really beautiful..
  • managing of focus itself, between different screens, is not easy, so it happens that focus sometimes disappears, or starts from the last menu options, or other odd things.

Next release will try to solve those and other issues… meanwhile, we’ll be happy of any kind of feedback about it :)

Download Web Runtime AnimaLogic

Forum Nokia Wiki.. my first article!

Wednesday, April 9th, 2008

Forum Nokia Wiki

Yeah, I’ve finally done it!

Forum Nokia Wiki is a precious source for any kind of mobile related problems or questions, and now I’m really happy to have found the time to post my first article, that is…

How to implement custom Text Fields with J2ME!

Hope you’ll find it useful :)

EDIT: you can now test the custom Text Field component with the web emulator here.