API Bridge – More Platform Services For Flash Lite & WRT

I just give API Bridge a try & thinks to share it with other developers. After Platform services API , it is a new tool which provides some other Platform Services. Btw, I like to write my article in form of questions .

What is API Bridge ?

API Bridges is actually a Symbian Server which provides http interface for communication between Server  (API Bridge) & Client (Flash Lite/WRT App). In short, it is a http server which enrich its clients (Flash Lite/WRT app) with different services like accessing camera & taking photos , uploading files , accessing call logs etc.

How a single API Bridge works for both Flash Lite & WRT ?

As we already discussed that API Bridge is actually a local http server. It provide services to all those clients which can send them http requests (ofcourse, only those requests which API Bridge accepts) .  Therefore , it will works for both Flash Lite & WRT .

How to get started with API Bridge for Flash Lite?

Just follow these steps :

1- Unlike Platform Services API, you have to install API Bridge sis package on your phone first . You can find the sis package inside the zip file provided here :

API Bridge

Just send the swf files to your phone and test them .If they are working fine then ur API Bridge is successfully installed.

2- Install the APIBridge sis package in your phone.

3- After installing APIBridge , now u r ready to go to test API Bridge samples. You can find API Bridge samples here :

APIBridge_FlashLiteCode.zip

4- For creating your own contents with Flash Lite API Bridge,  u need Action Script classes which can be found in the above zip file i.e inside a folder with name “si” .Just copy paste the “si” folder in Flash Library path or in the folder where u r saving ur fla file.

5- Just read this article for more details and a clear view of API Bridge :

http://wiki.forum.nokia.com/index.php/Flash_Lite_API_Bridge_Interface

How to distribute a Flash Lite content which uses API Bridge Services ?

Two ways to distribute these contents :

1 – I want to use Flash Lite Stub using Symbian C++ i.e Kuneri Lite, Online FN Packager , Adobe FL Packager etc

It is a very famous way of distributing Flash Lite contents (also known as swf to sis) . Lets follow steps to explain :

1 – Provide swf file to any of these tools and they give u sis file in return.

2 – Now, u can simply edit the sis file , embeds the API Bridge sis (which can be found inside this zip file  API Bridge ) and self signed it again (because once u modified sis u need to resign ur sis file) .

3 – To acheive step 2 , one can use SISContent , it is GUI application which makes packaging related tasks EASY.

4 – Open your sis file (obtained from any packaing tool) in SISContent . Click Tools>Edit . Click on Contents Icon > Add > Embed Package  & select API Bridge sis (keep the check mark on the statement “Install only when package doesnt exists)  and press ok.Now, Click Edit > sign > key pairs > add your own self signed certificate and sign ur sis . Now, goto file and save this modified sis.

Note : If u dont know how to make ur own self signed certificates .Just read the second last paragraph of this article :

How_to_sign_a_.Sis_file_with_Self-Sign_Certificate

BTW, it is very easy, you just need a makekeys.exe and u have to give command as described in the page .

5- Now , you are ready to distribute .

2 – I want to use Flash Lite Content Embeds into a WRT.

To distibute ur swf using WRT , just read this article :

How_to_Package_A_Flash_Lite_Application_that_uses_the_APIBridge

What is the default port of  API Bridge ?

Its Default Port is 9080 and u can find the port by looking at the text file placed in C:\\inovait\\apibridge\\port.txt (after installing API Bridge SIS).You can try a simple test to check it i.e use this actionscript in swf :

loadVariables(“http://127.0.0.1:9080/newfileservice?fileType=Image”, _root);

and u  will see camera application launched in phto shoot mode . However, u cannot change API Bridge port by editing the text file . 🙂

Where to read more :

–  http://wiki.forum.nokia.com/index.php/Flash_Lite_API_Bridge_Interface By Robert Burdick

http://dalerankine.com/index.php/2009/11/new-nokia-apibridge-for-extending-flash-lite-applications-on-s60/ By Dale Rankine

http://dalerankine.com/index.php/2009/12/new-training-video-accessing-the-camera-using-nokia-api-bridge/ By Dale Rankine

Wish u easy Flash Programming ……..

Best Regards,

Sajid Ali Anjum (SajiSoft)

Advertisements

7 Responses to “API Bridge – More Platform Services For Flash Lite & WRT”

  1. Volker Says:

    Hi,

    can you tell me how the server does get started? I noticed the recognizer dll in the winscw directory of the emulator – so is it used to start the server automatically at boot time?

    Best Regards,
    Volker

    • sajisoft Says:

      Yes! the server get started automatically when ur phone boots up & if u want to know that which excecutable (of API Bridge) is actually launched , just hack the sis file.

      Best Regards,
      SajiSoft

  2. Supriya Tenany Says:

    Hi,

    How does the API bridge work for Flash lite 3.x mobile applications that are installed in the mobile handsets, require the internet connectivity and packaged through Helisso.

    Regards,
    Supriya Tenany

    • sajisoft Says:

      API Bridge doesnt require internet connectivity to install if it is embeds in ur SIS Package and it can be embeds in a SIS created by Helisso. Just create a SIS using Helisso and apply the technique provided under “I want to use Flash Lite Stub using Symbian C++ i.e Kuneri Lite, Online FN Packager , Adobe FL Packager etc” topic.

      Best Regards,
      SajiSoft

      • Supriya Tenany Says:

        Hi SajiSoft,

        I need to cache some images in my application, that are I get from my webservice. Later, when I revisit the page in which the images were displayed, they should be fetched from the cache(if possible for installed apps on a mobile) instead of fetching from the website. Is this possible? If yes, please help me modify my FL 3.0/AS 2.0 code? I havent found any help on any of the APIBridge related links.

        Regards,
        Supriya Tenany

  3. shams Says:

    hy saju u r genious yar… we proud of u,,,,,…..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: