Updates from February, 2010 Toggle Comment Threads | Keyboard Shortcuts

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

    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: , , , ,   

    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;
     
    			break;
    		}
    	}
    }
    else
    {
    	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"))
    	{
    		widget.openURL('http://www.yourserver.com/APIBridge_v1_1.sis');
    	}
    }
    else
    {
    	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", "http://127.0.0.1:9080", true );
     
    	request.send(null);
     
    	request.onreadystatechange = function()
    	{
    		if( request.readyState == 4)
    		{
    			if(request.status != 0)
    			{
    				_callback(true);
    			}
    			else
    			{
    				_callback(false);
    			}
    		}
    	}
    }

    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)
    {
    	if(apiBridgeInstalled)
    	{
    		alert("API Bridge is already installed on the device");
    	}
    	else
    	{
    		if(confirm("You have to install API Bridge to continue, press OK to download it"))
    		{
    			widget.openURL('http://www.yourserver.com/APIBridge_v1_1.sis');
    		}
    	}
    }

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

    pollApiBridgeServer(pollApiBridgeCallback);

    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:

      http://wiki.forum.nokia.com/index.php/TSS000456_-_Changing_the_active_theme

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

      Hi,

      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 11:17 am on February 16, 2010 Permalink | Reply
    Tags: developers guide, , , , ria,   

    Rich Internet Application developer’s guide for Nokia devices 

    Forum Nokia has recently published a very informative guide about developing RIAs for mobile devices: A developer’s guide to creating Rich Internet Applications for Nokia devices.

    The document focuses on three kind of applications: websites, web apps, and stand-alone Adobe Flash applications, covering all topics involved in design and development of a RIA, from development tools to user experience design and evaluation, from testing to going to market.

    Mobile offers significant opportunities for RIAs. The ability to access data and information anywhere there is a suitable network connection is of significant appeal to mobile users. The knowledge that their data is also securely stored on a remote server, regardless of what happens to the mobile device, is a significant attraction as well.
    With many hundreds of millions of Nokia devices already in the market place that can run RIAs now, there has never been a better time to go mobile with your RIA.

    Check it out!

     
  • pit 12:06 pm on February 15, 2010 Permalink | Reply
    Tags: intel, linux, , meego, moblin, ,   

    Maemo and Moblin merged to MeeGo! 

    Here’s the big news from Intel, Maemo and Nokia: MeeGo!

    MeeGo is an open source, Linux project which brings together the Moblin project, headed up by Intel, and Maemo, by Nokia, into a single open source activity. MeeGo integrates the experience and skills of two significant development ecosystems, versed in communications and computing technologies. The MeeGo project believes these two pillars form the technical foundations for next generation platforms and usages in the mobile and device platforms space.

    Moblin and maemo are merging! We are taking the best pieces from these two open source projects and are creating the MeeGo software platform. Both teams have worked for a long time to support the needs of the mobile user experience – and MeeGo will make this even better. We want it to be fun, focused, flexible, technically challenging and ultimately, something that can change the world.

     
  • pit 11:03 pm on February 14, 2010 Permalink | Reply
    Tags: , , location,   

    Ovi Maps: a flexible platform for web and mobile location based services 

    This week Forum Nokia Wiki features an article explaining the opportunities that the Ovi Maps service offers to web and mobile developers.

    Ovi Maps offers a complete and flexible platform to build rich location-based services. By providing a consistent set of components and libraries, Ovi Maps allows developers to build both a web a mobile version of their applications with minimum effort.

    Interested in what can be done with Ovi Maps? Here are some links taken from the article:

    Next steps? Check out the whole article: Ovi – Opportunities for developers, and then sign up for the Ovi Maps beta program!

     
  • pit 5:51 pm on February 12, 2010 Permalink | Reply
    Tags: , , testing, tips   

    How to speed up deploying and testing of your API Bridge-based applications 

    When working with API Bridge applications, you need to package them with the API Bridge engine within a Symbian SIS package each time you want to deploy it on a device. This could actually be a big drawback when developing a new app, since it greatly slows down all the building and deploying process.

    This is right, but luckily enough there’s an alternative, really easy approach to test your API Bridge-based applications on your devices. The picture below should say it all:

    It couldn’t have been simpler:

    1. Deploy the APIBridge SIS (APIBridge_v1_1.sis for API Bridge version 1.1) on the device, only once
    2. Deploy your application (Web Runtime, Flash Lite or Java ME) as you would have done without API Bridge, all the times you want
    3. Done!

    By deploying the APIBridge engine separately, you can actually save tons of time during all the development phase, since you don’t need anymore to package your apps in a classical Symbian package. Hurrah!

     
    • Ashish 1:12 pm on May 7, 2010 Permalink

      Is there any other difference between the two methods than the time saving? I mean, if we use the first method, we can directly call the API bridge methods and if we use your method, do we have to call it using localhost?

    • pit 1:15 pm on May 7, 2010 Permalink

      Hi Ashish,

      the way you call API Bridge methods doesn’t change, regardless of which way you choose to deploy the engine. So, this method actually helps to speed up deploying/testing of apps based on API Bridge, without changing anything else.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel