PhoneGap webOS
=====================================================
PhoneGap webOS is a skeleton HP webOS application, along with JavaScript wrapper libraries, which allow a developer to build an application for an HP webOS device using web technologies. This same code can be built for iPhone, BlackBerry, Symbian, and more to come ...
Pre-requisites
-----------------------------------------------------
You should have VirtualBox (virtual machine software which runs the Palm emulator) and the webOS SDK installed. Both of these can be found at [Palm's Developer Site](http://developer.palm.com/index.php?option=com_content&view=article&id=1545).
Set up your environment and install the skeleton app
-----------------------------------------------------
Open a terminal, and navigate to the root PhoneGap webOS folder (where this readme.md file is located). A Makefile resides here; running make here will package your application, and install it to either the emulator, or the device. Or you can run make on individual target tasks:
- `make js` - builds phonegap.js from source javascript files to libs/phonegap.js
- `make copy_js` - copies libs/phonegap.js to framework/phonegap.js - modify this path if you want phonegap.js in another location
- `make package` - builds the webOS app (located in framework/) into an webOS .ipk installer package in the phonegap_root/palm/ folder
- `make deploy` - installs the .ipk package to a device if detected, otherwise the emulator if its running
If a connected webOS device is detected, the application will be installed to the device. If not, and the emulator is running, the application will be installed to the emulator. To run the emulator, search for Palm Emulator.app in the finder, and run it.
Build your PhoneGap app
-----------------------------------------------------
Navigate to `phonegap_root/webOS_new/framework/`; this is where your application will reside. If you have already built a phonegap application on another platform, drop your html,js, css and assets into this folder (starting with the required index.html). Don't forget phonegap.js!
Just open framework/ in your favourite editor, build your web app, and run the appropriate make command indicated above. Edit appinfo.json to set your app id (see Notes below), version, etc.
PhoneGap-webOS doesn't need to do any native initialization, but it does fire a `deviceready` that guarantees all the PhoneGap APIs are in place. You can run your code at `deviceready` like so:
document.addEventListener('deviceready', function() {
// do cool PhoneGap things
}, false);
To enable a javascript debug console, open a new terminal window and type:
phonegap-log app_id
Where the app id is your app id as set in `appinfo.json`
This will tail your log file; it will default to the device if detected, otherwise it will read logs from the emulator.
To log from your JS code, use `console.log`
Notes & Caveats
-----------------------------------------------------
- In order to use the vibration API on palm, your application needs to have a "com.palm.*" namespace, as vibration on webOS is a private API. The caveat of doing this is that you are essentially indicating that your app should pretend to be a "Palm app" (rather than a Nitobi app, for example) ... and as a result your app will be denied from the Palm app catalog.
- Currently the map.show function can only accept one position, as Palm uses google maps as its native maps application, and it only can take one marker as a parameter.
- Touch event not supported, natively. PhoneGap now includes event handlers for mouse & touch events - please see the example app bundled with PhoneGap-webOS
- If using Lawnchair, the only supported adaptor is webkitsqlite.
- html select boxes are implemented by phonegap, not supported natively (believe it or not). only the most basic functionality is implemented, so be aware using this control could cause problems.
- To enable verbose logging, add the file framework_config.json to your framework/www/ folder, containing the following json content: { "logLevel": 99 }
Helpful Links
-----------------------------------------------------
- PhoneGap API Docs: [docs.phonegap.com](http://docs.phonegap.com)
- PhoneGap Wiki: [phonegap.pbworks.com](http://phonegap.pbworks.com)
- Palm webOS developer site: [developer.palm.com](http://developer.palm.com)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
phonegap 开发包 案例源码 (420个子文件)
Network.as 3KB
Network.as 3KB
cordova.js.base 16KB
phonegap.bat 166B
proguard.cfg 1KB
changelog 6KB
config 106B
Contacts.cpp 18KB
WebForm.cpp 5KB
Notification.cpp 5KB
GeoLocation.cpp 4KB
Accelerometer.cpp 3KB
Network.cpp 3KB
Compass.cpp 3KB
Cordova.cpp 3KB
Kamera.cpp 3KB
DebugConsole.cpp 2KB
Device.cpp 2KB
CordovaEntry.cpp 948B
CordovaCommand.cpp 281B
create 1KB
File.cs 53KB
Capture.cs 25KB
AudioPlayer.cs 21KB
Contacts.cs 18KB
Media.cs 15KB
CordovaView.xaml.cs 14KB
VideoRecorder.xaml.cs 13KB
Compass.cs 13KB
AudioRecorder.xaml.cs 12KB
FileTransfer.cs 12KB
Accelerometer.cs 10KB
Camera.cs 10KB
Notification.cs 7KB
NativeExecution.cs 7KB
MimeTypeMapper.cs 7KB
App.xaml.cs 6KB
DOMStorageHelper.cs 5KB
App.xaml.cs 5KB
App.xaml.cs 5KB
App.xaml.cs 5KB
OrientationHelper.cs 4KB
PluginResult.cs 4KB
BaseCommand.cs 4KB
AudioCaptureTask.cs 4KB
VideoCaptureTask.cs 4KB
CommandFactory.cs 4KB
Device.cs 3KB
CordovaCommandCall.cs 3KB
Connection.cs 3KB
JsonHelper.cs 3KB
ScriptCallback.cs 2KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
DebugConsole.cs 1KB
GeoLocation.cs 1KB
Calculator.cs 1011B
Calculator.cs 735B
MainPage.xaml.cs 719B
MainPage.xaml.cs 719B
MainPage.xaml.cs 719B
MainPage.xaml.cs 512B
GapExample.csproj 7KB
WP7CordovaClassLib.csproj 7KB
MobileSpecUnitTests.csproj 6KB
WP7CordovaClassLibBare.csproj 6KB
GapAppProj.csproj 5KB
GapAppProj.csproj 5KB
index.css 6KB
qunit.css 4KB
qunit.css 4KB
master.css 2KB
master.css 2KB
master.css 2KB
master.css 2KB
mobile.css 2KB
prettify.css 1022B
menu.css 623B
master.css 294B
master.css 294B
debug 149B
WP7CordovaClassLib.dll 130KB
Cordova-1.5.0.dmg 6.6MB
emulate 411B
.gitignore 346B
WebForm.h 2KB
Cordova.h 1KB
Network.h 1KB
Contacts.h 1KB
Accelerometer.h 768B
GeoLocation.h 767B
Compass.h 693B
Notification.h 658B
Kamera.h 642B
CordovaCommand.h 523B
DebugConsole.h 451B
Device.h 420B
共 420 条
- 1
- 2
- 3
- 4
- 5
资源评论
Rocco仔
- 粉丝: 3
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功