Updates from June, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • pit 1:30 pm on June 11, 2008 Permalink | Reply
    Tags: , , , mobile mapping, static maps   

    Google Maps mobile tutorial is Wiki article of the Month! 

    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! :)

  • pit 2:47 pm on June 9, 2008 Permalink | Reply
    Tags: , , google maps api, map static images   

    J2ME Google Maps API is article of the week on Forum Nokia! 

    I’m really happy to announce that my J2ME Google Maps API article on Forum Nokia Wiki has been selected as Article of the Week! :)

    J2ME Google Maps API Article of the Week

    And, to celebrate this event, I’ve added a brand new feature to my article that will allow you to:

    • create larger tiled maps
    • support map scrolling

    How does it work?

    You start instantiating a GoogleMaps object as usual:

    GoogleMaps gMap = new GoogleMaps("API_KEY");

    Then you get your map, for example geocoding a given address:

    double[] coords = gMap.geocodeAddress("Leicester square, London");
    Image mapImage = gMap.retrieveStaticImage(
    	150, 150,
    	coords[0], coords[1],
    	12, "png"

    Then, let’s say you want to scroll your map 100 pixels up, what you’ll do is:

    double[] newCoords = gMap.adjust(
    	coords[0], coords[1],
    	0, -100, 12
    Image newMapImage = gMap.retrieveStaticImage(
    	150, 150,
    	newCoords[0], newCoords[1],
    	12, "png"

    As you’ve seen, the adjust method takes these arguments:

    • the current latitude and longitude
    • the deltaX and deltaY, in pixels
    • the current zoom level

    and returns the new map center latitude and longitude coordinates.

    You can check the full updated source code on Forum Nokia Wiki article: J2ME Google Maps API, and a full-featured example, with the scrolling feature, on the emulator page: J2ME Google Maps API in action.

    • HSCharles 4:35 am on November 14, 2008 Permalink

      I have a flash website
      i’m looking for the script who of google adsense with flash.
      can you give me the link?

    • aditya 2:27 pm on February 16, 2009 Permalink

      Is there a zip file which has the .jar , .jad and .java file that i could try on J2Me wireless tool kit. I am a j2me beginner

    • zibi 5:12 pm on August 13, 2011 Permalink

      I am trying to use adjust function for scrolling tiles, and i think that its inaccurate, i cant get two tiles match correctly

  • pit 2:37 pm on June 6, 2008 Permalink | Reply
    Tags: animations, , , j2me api, j2me library,   

    ImageFx: J2ME image effects library 

    After two tutorials on Image animations in J2ME, I’ve finally decided to put together a library to easily integrate Image effects in a Java ME application. This first release is very very early, and is intended to be tested and to allow developers to give their feedbacks about it, so It’d be possible to modify and improve it.

    ImageFx Banner

    Currently supported effects are visible on the emulator page, and are:

    • BlindsFx
    • ExplodeFx
    • PuzzleFx
    • ShakeFx
    • SlideFx
    • SpiralFx
    • WaveFx
    • WipeFx

    How to use it?

    Let’s start from a simple usage example. We start creating an Image, and then using it to create an AnimatedImage instance:

    Image baseImage = Image.createImage("/base.png");
    AnimatedImage animated = new AnimatedImage(baseImage);

    Now, we have created an AnimatedImage, that is the base class that will allow us to apply effects to Images.

    Now, we can create an effect (that will be a subclass of ImageFx) and apply it to our AnimatedImage:

    ImageFx fx = new PuzzleFx(8, 8, ImageFx.TYPE_IN);

    In this example, we have chosen a PuzzleFx effect, that will show (or hide, depending on Fx type) our image piece by piece. As you can check on JavaDocs page for PuzzleFx class, first 2 arguments represent the horizontal and vertical pieces to split the Image into, while the last one is the type of the Fx itself.

    Now, our AnimatedImage is ready to be animated. To start the animation, simply call the AnimatedImage start() method, passing as argument the effect duration in milliseconds:


    About painting, you’ll simply have to call the paint() method, in a way that is really similar to Graphics drawImage():

    animated.paint(g, 100, 100, Graphics.TOP | Graphics.LEFT);

    Now, to begin using this library, you don’t really need any more infos. Just to point out some methods you can find useful in your app:

    //stop() method will immediatly stop the FX
    //isRunning() method tells if the FX is running or not
    //isEnded() method tells if the FX animation is ended
    //and, if you want a looping effect, you can use

    Further information

    You can library JAR file here: ImageFx.jar. Current version requires MIDP 2.0 and CLDC 1.1 to be used (a version compatible with CLDC 1.0 will be released as soon as I’ve got time :)).

    Full API JavaDocs (still in early phase too :)) are also available here.

    • javad 7:30 pm on February 25, 2010 Permalink

      waht is error in my code?

      Image baseImage = Image.createImage(“/Splash.png”);

      AnimatedImage animated = new AnimatedImage(baseImage);
      ImageFx fx = new PuzzleFx(8, 8, ImageFx.TYPE_IN);


      catch(Exception e)
      System.out.println(“Error in image loading …”);

      Show nothing

    • pit 1:17 pm on February 26, 2010 Permalink

      Hi javad,

      do you get any Exceptions in your code?

    • mohammad 12:11 pm on May 6, 2010 Permalink

      hi Alessandro
      how to use this library?
      i read library doc and i use in my program but show nothing …..
      please create a source code sample to help use.

    • pit 12:13 pm on May 6, 2010 Permalink

      Hi mohammad,

      I’ll share the source code of the sample MIDlet, shown in the emulator page, really soon ;)


    • Mohammad 9:52 am on May 7, 2010 Permalink

      Hi Alessandro,
      I’m still waiting for your promise….
      Thank you for sharing my request

    • Ali 8:01 am on May 8, 2010 Permalink

      hi dear
      i use library in try catch but dont show no thing and no error in catch …..
      plz help me
      what must i do ?

    • pit 5:00 pm on May 9, 2010 Permalink

      @Mohammad: just let me polish the code a bit, and I’ll publish the whole source code

      @Ali: can you share your code (in a comment or by email, as you prefer)?

    • Ali 3:36 pm on May 10, 2010 Permalink

      my code :
      what is error in my code?
      try block run normal and no error in catch ….but show noting

      import javax.microedition.lcdui.Canvas;
      import javax.microedition.lcdui.Graphics;
      import javax.microedition.lcdui.Image;

      • @author Ali

      public class menu extends Canvas {
      Image im1;
      AnimatedImage animatedImage;

      public menu(){
      animatedImage=new AnimatedImage(im1);
      ImageFx fx1=new BlindsFx(10, ImageFx.TYPE_IN, ImageFx.ORIENTATION_VERTICAL);
      catch(Exception e){e.printStackTrace();}

      public void paint(Graphics g){
      animatedImage.paint(g, getWidth()/2, getHeight()/2, Graphics.LEFT|Graphics.TOP);


    • Ali 4:03 pm on May 10, 2010 Permalink

      hi pit
      tanks dear….
      solve my problem …
      i dont use Thread in my program and same is my wrong ….
      very very tanks for your good library ….
      Good Luck..

    • pit 11:42 am on May 11, 2010 Permalink

      Hi Ali,

      I’m happy to know that you solved your problem :) just let me know if any other issues arise.

    • mz 4:02 am on August 15, 2010 Permalink

      Hi Alessandro
      Tx for your good library
      I want to use in cldc 1.0 but it isnt compatible !!!!…
      when is ready version of compatible with cldc 1.0?
      i need it soon…
      Tank you if you help me…

    • MZ 3:27 pm on August 15, 2010 Permalink

      Hi Alessandro
      Tx for your good library
      I want to use in cldc 1.0 but it isnt compatible !!!!…
      when is ready version of compatible with cldc 1.0?
      i need it soon…
      Tank you if you help me…

    • srinivas 1:57 pm on September 23, 2011 Permalink

      i didnt get any animation.why i am using .gif images

  • pit 9:56 am on June 4, 2008 Permalink | Reply
    Tags: iphone 3g, , nokia code camp   

    Nokia Code Camp Winners, iPhone 3G and Jarpa 

    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 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 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!

compose new post
next post/next comment
previous post/previous comment
show/hide comments
go to top
go to login
show/hide help
shift + esc