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 :
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 :
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 :
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 :
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 :
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 :
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 :
By Robert Burdick
Wish u easy Flash Programming ……..
Sajid Ali Anjum (SajiSoft)