本文主要是介绍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 | |
它实际上使用的是标准的NPAPI方式对webkit进行的扩展,所以可能真没有所谓的native API了 |
注:我还没看这个原理是啥,现在还看不懂,先记录,后面再仔细分析。
这篇关于WebOS程序原理的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!