WebOS程序原理

http://bbs.51pda.cn/simple/?t5629.html

WebOS程序原理

Application Framework
From WebOS Internals
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;

znsoft 2009-09-12 17:10
使用類似 web中applet的技術來實現功能的,也類似於ie中的activex控件

以Classic 爲例就明白了
znsoft  
它實際上使用的是標準的NPAPI方式對webkit進行的擴展,所以可能真沒有所謂的native API了

注:我還沒看這個原理是啥,現在還看不懂,先記錄,後面再仔細分析。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章