Application Framework

From WebOS Internals

Revision as of 22:39, 28 July 2009 by Hopspitfire (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

todo: talk about the app framework!

Applications that come bundled on the device are located here.

root@castle:/usr/palm/applications# ls -lah
drwxr-xr-x   44 root     root         4.0k May 22 13:10 .
drwxr-xr-x    8 root     root         4.0k May 22 14:37 ..
drwxr-xr-x    6 root     root         4.0k Dec 31  1999 com.handson.app.nascar
drwxr-xr-x    6 root     root         4.0k Dec 31  1999 com.mobitv.app.sprinttv
--More--
root@castle:/usr/palm/applications#

Where as downloaded applications from the Palm app store are here.

root@castle:/var/usr/palm/applications# ls -lah
drwxr-xr-x   11 root     root         4.0k Jun 10 20:05 .
drwxr-xr-x    3 root     root         4.0k May 29 14:48 ..
drwxr-xr-x    7 root     root         4.0k Jun  6 19:53 com.accuweather.palm
drwxr-xr-x    6 root     root         4.0k Jun  6 13:12 com.flixster.app.movies
drwxr-xr-x    8 root     root         4.0k Jun  8 14:34 com.lumoslabs.speed-brain
drwxr-xr-x    6 root     root         4.0k Jun 10 20:05 com.motionapps.app.classic
drwxr-xr-x    5 root     root         4.0k Jun  6 11:49 com.palm.pandora
--More--
root@castle:/var/usr/palm/applications# 

The applications use a standard MVC (Model, View, Controller) format.

//TODO : Use an existing application to explain framework

Native Applications

It is obvious to see that the Classic app is not purely JavaScript, and native code would have to be required. How did they pull it off? Quite simply; they used a browser plugin.

                //Setup the adapter                                                           
                sampleAdapterApp = document.createElement('object');                          
                sampleAdapterApp.type = 'application/x-motionapps-partsadapter';              
                sampleAdapterApp.width = 320;                                                 
                sampleAdapterApp.height = 320;

The plugin is embedded like you would with any other plugin, specifying the type and size of the actual object. Afterwards, they've tied events from the object to listeners in the JavaScript code.

In the browser.conf file, it points to a directory for these plugins. No other specification was found, so it is assumed that if you drop the plugin into the aforementioned directory, it will be referenced automatically.

Personal tools
Google AdSense