Tagged: j2me Toggle Comment Threads | Keyboard Shortcuts

  • pit 10:13 am on February 25, 2010 Permalink | Reply
    Tags: , , , j2me,   

    MidMaps: new Google Maps API for J2ME 

    I finally found some time to finish and publish the first release of a tiny library that allow to easily integrate Google Maps in every J2ME application: MidMaps.

    You can read all the details, download the library together with sample code, and read the full JavaDocs here: MidMaps – J2ME Google Maps library.

    • yama 10:05 am on April 22, 2010 Permalink

      i am using your library.yours is a nice application but the only problem is that it shows path as a straight line instead of road to road view.please help me out with a solution that how should i show such road to road path in my application.Thanking you.

    • Nicholas Ndegwa 9:41 am on January 1, 2011 Permalink

      Hi I like your API it works perfectly on the SUN emulator but does not work on the Nokia emulator nor Nokia device am getting the following error.

      map error:1000, java.io.IOException: Error in

    • Umesh 7:45 am on March 15, 2011 Permalink

      can we add important location like hotels,historical monuments, etc to static maps.

    • azura 4:01 pm on April 13, 2011 Permalink

      thnks for share :) i will practice it dude

    • Dileep 10:47 am on October 31, 2011 Permalink

      i am used to your library. but It give the
      java.lang.InstantiationException: Class not a MIDlet
      at com.sun.midp.midlet.MIDletState.createMIDlet(+66)
      at com.sun.midp.midlet.Selector.run(+22)
      Unable to create MIDlet DisplayMap

      How to i solve this problem.. Help me..

  • pit 10:35 am on February 18, 2010 Permalink | Reply
    Tags: , , , j2me,   

    Deploying API Bridge apps the easy way: the delayed deploy model 

    When developing a Flash Lite, Web Runtime or Java ME application based on API Bridge, one of the things you know you’ll have to deal with is the Symbian packaging and signing process.

    For single-person and small developer teams, the whole Symbian process could be a not suitable option. For this reason, I’ve looked for an alternative deployment approach that could bypass this process. The approach presented here is based on a delayed deploy model, meaning that the API Bridge engine is not deployed with your application, but in a successive moment: actually, it is deployed only when the application needs it.

    How this can be achieved? Basically, there are 2 possible options to implement this model, and they’re based on:

    • AppManager API from Platform Services
    • Local HTTP calls

    Using the AppManager API to check API Bridge

    If the target devices support Platform Services, the AppManager API can be used to retrieve the list of installed applications, and so to check if API Bridge is installed on the device itself.

    The code below shows how this can be achieved by using JavaScript in a WRT widget. The same approach can be easily ported to ActionScript, and so used in a Flash Lite application.

    var apiBridgeFound = false;
    var apiBridgeCheckError = null;
    var so = device.getServiceObject("Service.AppManager", "IAppManager");
    var criteria = new Object();
    criteria.Type = 'Application';
    var result = so.IAppManager.GetList(criteria);
    if(result.ErrorCode == 0)
    	var iterator = result.ReturnValue;
    	var application;
    	while((application = iterator.getNext()) != undefined)
    		if(application.Uid == '0x20023710')
    			apiBridgeFound = true;
    	apiBridgeCheckError = result.ErrorMessage;

    The code works by checking the UID of all the installed applications, comparing them with the API Bridge UID (0×20023710). This code snipped defined 2 variables, that can be used to check for API Bridge availability:

    • apiBridgeFound: if true, it means that the API Bridge engine is installed on the device. If false, the API Bridge engine is not installed.
    • apiBridgeCheckError: if not null, it means that there was an error while checking for API Bridge, due to the AppManager API. In this case, the application cannot actually know if the API Bridge engine is installed or not.

    So, once these 2 variable have been set, the application can perform the most appropriate operation, based on the AppManager call result. The code snippet below shows a possible implementation:

    if(apiBridgeCheckError != null)
    	alert("There was an error! " + apiBridgeCheckError);
    else if(!apiBridgeFound)
    	if(confirm("You have to install API Bridge to continue, press OK to download it"))
    	alert("API Bridge is already installed on the device!");

    And below you can see this code running on a Nokia 5800 XpressMusic:

    Using local HTTP calls to check API Bridge

    Since the API Bridge engine works as a local HTTP server running on the mobile phone, the other possible approach is to make an HTTP request, and to check if any response from API Bridge comes.

    Note: this approach works by using the API Bridge default port (9080). There are no guarantees that this port number is fixed, and that it will not be changed in future API Bridge releases. For this reason, my advice would be to use this second approach only when Platform Services are not available.

    The code below shows how to make a request to the local API Bridge HTTP server, and how to check if it’s running or not: if it is running, the response status of the XMLHttpRequest object has to be different than zero.

    function pollApiBridgeServer(_callback)
    	var request = new XMLHttpRequest();
    	request.open("GET", "", true );
    	request.onreadystatechange = function()
    		if( request.readyState == 4)
    			if(request.status != 0)

    The approach described here can be used also when using API Bridge from other languages, as Flash Lite or Java ME. Anyway, when working with Flash Lite, in the scenario where API Bridge is not yet installed, you will incur in the typical (and horrible) error popups, that will inform you (and so the user) that the network call failed.

    How to use the code above? First, define a callback:

    function pollApiBridgeCallback(apiBridgeInstalled)
    		alert("API Bridge is already installed on the device");
    		if(confirm("You have to install API Bridge to continue, press OK to download it"))

    Then, just call the pollApiBridgeServer() method by passing a reference to this callback:


    Pros and cons

    Using one of the two approaches discussed above as some important advantages over the standard API Bridge deployment mechanism:

    • You don’t have to build a SIS package
    • You don’t have to sign your application to distribute it
    • You will save money :)

    On the other side, these approaches have the main drawback on the user-experience side, since your users could be asked to download and install an additional component when they start to use your application. Anyway, this event will happen only once at most, so it could be considered reasonable in most scenarios.

    • Pat 4:16 am on March 1, 2010 Permalink

      Hi Alessandro , I’m trying to understand how to package/install a custom API bridge with a J2ME app. A specific post about that would be great. Thanks.

    • Diogo Moreira 2:13 pm on June 7, 2010 Permalink

      Hi Alessandro, Is there anyway to change themes phone using APIBridge by requisition for wrt ?
      I wait answer, Thanks !

    • pit 2:38 pm on June 7, 2010 Permalink

      Yes, by implementing a custom plugin you can also let a WRT widget change the device active theme. This Forum Nokia Wiki article could help for the C++ part:


    • Pedro Cardoso 6:49 pm on June 25, 2010 Permalink


      I’m trying to use APIBridge on my app as you explain on this post, but whenever I try to do a function call (ie: retrieve the list of photos, or resize an image), the app crashes without any warning. Just quits and that’s it. The APIBridge detection is working as you outlined.

      Do you know any way I can troubleshoot, where/if any logs exist that explain the cause?

      Thanks a bunch.

  • pit 7:32 pm on February 11, 2010 Permalink | Reply
    Tags: , , , j2me, , ,   

    API Bridge version 1.1: plug-in creation package released! 

    The announced new version of API Bridge is out! With the new 1.1 release it is finally possible to create custom plugins that access all the Symbian functionalities, so practically opening up the doors to a new generation of Flash Lite, Web Runtime and Java ME applications.

    Start downloading the new release from Forum Nokia: API Bridge release 1.1.

    Then, check out this informative Wiki articles, that explain how to build a new, custom plugin and how to use it from JavaScript:

    For more information about API Bridge, check out its Forum Nokia page.

    • Mallikarjun 3:13 pm on March 22, 2010 Permalink

      Hey Anybody knows how to crate new plugin dll with APIBridge. My DLL is not getting invoked when i call from echoTest widget sample.

  • pit 11:28 am on February 11, 2010 Permalink | Reply
    Tags: , , , , j2me, ,   

    Platform Services and API Bridge: features, differences and advantages 

    If you’re developing applications for Nokia devices, and more specifically Web Runtime, Flash Lite or Java ME applications, you probably already had to deal with the platform limitations, and with the tools and libraries that allow to go beyond these limitations by adding more capabilities.

    Basically, when you want to extend the functionalities of a WRT widget or a Flash Lite application, you have two options:

    Both of them provide a set of tools and libraries that, added to your applications, allow them to access more functionalities than the ones that each technology naively supports.

    So, which approach is the best one? It’s not easy to give a unique answer to this question, so let’s go into details.

    Ease of use

    The Platform Services library is available from more time, and there’s a well established set of resources and code examples that will help you to quickly get your functionalities ready and running.The primary source of information is Forum Nokia Library, that has a detailed references of APIs and useful sample code. Then, also Forum Nokia Wiki provides an extensive set of examples that cover all the possible usage scenarios. Even if there is some little parts where this information could be improved, you shouldn’t get much in trouble when using Platform Services in your application.

    API Bridge is a fresher technology, released on November 2009, and so it’s harder to find complete documentation and usage examples. Anyway, Forum Nokia released a set of libraries for various platforms (Flash Lite, Web Runtime and Java ME) that will definitely help in starting to use API Bridge.

    Device support

    Platform Services are fully supported starting from S60 5th edition devices, but are also compatible with a subset of S60 3rd edition Feature Pack 2 devices: the full list of supported devices is available here: Web Runtime 1.1 compatible devices. This means that you can use them only on the touch screen Nokia devices.

    On the other side, API Bridge can work on all devices starting from S60 3rd edition Feature Pack 1 onwards, so meaning:

    Available features

    Current Platform Services (version 1.0) allow to access a wide set of features:

    • Application Management
    • Calendar
    • Contacts
    • Landmarks
    • Location
    • Logging
    • Media Management
    • Messaging
    • Sensors
    • System Information

    It is currently available also a beta release of Platform Services 2.0, that adds to this features’ set also the access to the device camera.

    API Bridge, instead, has a more limited set of functionalities, currently including:

    • Capture of photos, videos and audio streams
    • Files uploading
    • Files reading
    • Image resizing
    • Location
    • Logging
    • Media Management

    Supported technologies

    Platform Services are currently available for Flash Lite and Web Runtime applications.

    API Bridge libraries have been released for Flash Lite, Web Runtime and Java ME. Generally speaking, the API Bridge engine, working as a local HTTP server running on the device, is accessible from all technologies.

    Overall considerations

    The current implementation of Platform Services and API Bridge don’t allow to decide which approach is the best one, and there is no need to do it anyway. Right now, if you’re working in Flash Lite or Web Runtime, and as long as your set of target devices support them, you can benefit of both technologies, including the two libraries in your application.

    Talking about future perspectives of both approaches, we can see both of them evolving in more mature products.

    Platform Services 2.0 is already available as a beta release, so you can already start experimenting with the new APIs and features, including the access to the device camera. On the other side, API Bridge promises to allow everyone to create custom plugins, through the ECOM interface, as reported on Forum Nokia Blogs.

    Concluding, Platform Services, with the already mature and features-rich library, surely represents a simpler approach for developers who don’t want to deal with Symbian building and packaging, while API Bridge, with its plugin architecture becoming mature and open to developers, could definitely end up to be the best ally to allow widgets and Flash Lite apps access more and more features.

    • Trufanov 6:33 pm on February 11, 2010 Permalink

      >On the other side, API Bridge promises to allow everyone to create custom plugins, through the ECOM interface, as reported on Forum Nokia Blogs.

      They just release APIBridge Plug-in API: http://wiki.forum.nokia.com/index.php/APIBridge_Plug-in_API

    • pit 6:52 pm on February 11, 2010 Permalink

      Hi Trufanov,

      you’re right! Just noticed the same thing :)

    • rondo 10:24 am on August 9, 2010 Permalink

      Hi pit,
      I hava a problem using APIBridge.fileUpload method to upload a photo to the server. The method failed with error:404. The problem is driving me mad ! Do you have any suggestions?

  • pit 5:52 pm on October 28, 2009 Permalink | Reply
    Tags: blackberry, bmw, j2me, x1 mobil   

    New J2ME app released: X1 Mobil, discover the new BMW X1 

    A new Java ME application is available, currently only in Italian language, for all BMW fans!

    X1 Mobil allows to discover all the secrets of the new BMW X1, together with launch events, sport news, travel information and much more, with just a few clicks.

    The current version is compatible with various BlackBerry and Java ME enabled devices. Check out the app download page for more details: BMW X1 Mobil download page.

    Feedbacks are welcome! :)

  • pit 4:47 pm on April 30, 2009 Permalink | Reply
    Tags: , , j2me,   

    Gcal update: version 0.3.5 with manual timezone setting 

    After a while far from Gcal development (due to a lot of undercover work :) ) here is a new update for the Java ME Google Calendar client, specifically released to fix the different timezone issues that various users are reporting.

    With version 0.3.5 it’s now possible to manually set the preferred timezone from the application Settings screen. To do so, you have 2 choices:

    • If you want to use the timezone sent by Google Calendar server, you can set to “Yes” the “Use server timezone?” option
    • If you want to explicitly set your timezone, then set the previous option to “No“, and then specify your timezone offset in the “Timezone” field

    If you have problems with timezone in your GCal client, then you should definitely update. Just update from within GCal (“Options” -> “More..” -> “Check updates”), or download version 0.3.5 from here:

    JAD file is also available for download here: Gcal JAD download.

    • Laura 12:32 pm on May 4, 2009 Permalink

      Thank you thank you thank you!!!!

      One other request–is there a way to make it able to see a month view at a time? Or can it do that now and I just don’t know how?

      Thanks so much!!!

    • Dirk Kotze 9:41 am on May 6, 2009 Permalink

      Thank you for the time-zone functionality.

    • morguena 6:41 pm on May 7, 2009 Permalink

      in an n70 when it comes to loading the calendar closes the program automatically or gives the error java.io.IOException: -36
      ¿¿¿One of the questions is whether the program works offline or if there is to be connected?

    • Louis de Lange 11:06 pm on May 12, 2009 Permalink

      Phone: Samsung SCH-R610. Version 0.3.3 used to work. Then it stopped working. When I try to enter my password the text window on the phone allows me to input my full password, but when I accept the password and the screen returns back to the gcal login screen it only shows the first 5 character of the password. Obviously google won’t allow me to log in without the full password. Upgraded to 0.3.5, but same problem.

    • s t 6:19 pm on May 15, 2009 Permalink

      I use Willcom WX341K (PHS).
      I installed and ran Gcal.jad

      But I can not login google account.
      I can not push “Login” button,
      and “Exit” button.
      I can push “Cancel” / “Ok” button….

    • PB 9:25 am on May 27, 2009 Permalink

      Thank you for the time-zone functionality.

    • Nuno Gomes 2:39 pm on June 3, 2009 Permalink


      I’m not able to download the jad part using the provided link.

      By the way: do you foresee to have an “edit event” functionality


    • pit 2:48 pm on June 3, 2009 Permalink

      Hi all,

      @Laura: month and week views are planned, and should be included in a future release. Cannot give precise timeplan about it :(

      @morguena: thanks for your feedback, I’ll check your issue and let you know what I find. GCal works online. Browing events offline would be a nice functionality, but it is not currently implemented.

      @Louis de Lange: unfortunately this is a known issue, but I currently have not a fix for it. I’m actually working on it, and hope to have good news asap :) The five ‘*’ are only for security purposes, to avoid displaying the exact length of the typed password.

      @s t: unfortunately I have not that device to make tests, but I’ll check if I can find a fix for it.

      @Nuno Gomes: which error do you get when downloading the JAD? Edit functionality is surely planned, hope to include it in a very next release!


    • Thomas Gehring 8:50 am on June 7, 2009 Permalink

      is there a way to display Google´s tasks? They don´t show up on my calenders.


    • Grigory 6:39 pm on June 10, 2009 Permalink

      Hi, I can’t create a new event in my Google Calendar. When I click Create, program write “Error while saving new event (java.lang.Exeption:CODE:403)”.
      Reading calendar is Ok.

      Help me please
      What setting I can changed in Google that it work???
      or is it bag????

      Sorry for my English ))))

    • Grigory 7:04 pm on June 10, 2009 Permalink

      Philips Xenium X800

    • Julie 9:18 am on July 18, 2009 Permalink

      Hi Pit

      I’ve just installed this version on my Nokia N97 (previously had an E90), and all day events are showing up in the following day’s events list, saying “To All Day” (which is a strange phrase in itself).

      I’m pretty sure this didn’t used to happen on the previous version of GCal which was installed on my old phone.

      Then I realised that Use server timezone was set to No with Timezone +01:00 by default (I think the default should be to use it, as it was in previous versions where you had no choice). Setting Use server timezone to Yes fixed the problem. Presumably with a manual offset of +1, gCal thought All Day finishes at 1:00am?


    • Marty 8:49 pm on October 27, 2009 Permalink

      Love the GCal app but 0.3.5 doesn’t handle Eastern Time Zone “All-Day” events correctly.
      I have an all day event for 10/30 and it shows on 10/29′s list of events. Doesn’t matter what settings I use it will not work correctly. I have it set to be -04:00 and the times show correctly on regular events but the AllDay event is wrong. My Google calendar is set for Eastern GMT-05:00 but if I change Gcal to that my times are off an hour.

    • menetekel 11:37 am on November 13, 2009 Permalink

      Hi Pit, thanks for this GREAT app.

      One question: when I add a new event to my calendar from the app, it does not create a reminder for the it on Google, even though this is set as default on the website. Any way to fix this, please.

      Many thanks,


    • ffffff 1:31 pm on December 19, 2009 Permalink

      When I try to log in, there’s an Exception (javax.microedition.pki.CertificateException). Then I can only click Ok, which returns me to the login screen :-(

    • Elros 3:47 am on December 20, 2009 Permalink

      The jad download link returns this error: Error 404 – Not Found

    • pit 10:18 am on December 21, 2009 Permalink

      Hi all,

      thank you for your precious feedback!

      @Thomas: not yet, will check it out for including them in a future release

      @Grigory: are you creating an event on your personal calendar, or on a shared one?

      @Julie: not noticed yet, but I’ll try to reproduce your problem and see what could be the cause

      @Marty: I’m working to fix this, will release an update as soon as it properly works

      @menetekel: do you refer to mail/sms reminders? Actually, there’s no explicit support yet, but will be surely added in one of the next updates

      Elros: thanks, should be fixed now :)

    • Matt 5:59 pm on January 14, 2010 Permalink

      Is there a way to create repeating events in Gcal?

    • Brandon 11:14 pm on September 30, 2010 Permalink

      This is still a great application that I use quite often.

      The only glitch I have found so far is…
      If Use server timezone = Yes, the correct timezone is used for the primary calendar, but additional calendars do not seem to use the server timezone, so events show at the incorrect time or as All Day.
      If you set Use server timezone = No, and set the timezone manually, then all calendars show the correct time.

      Please continue developing this app! :)

    • Hermano 11:23 pm on December 10, 2010 Permalink

      Hi, there is anyway to setup reminders when creating an event? It would be really nice.

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