windows phonegap黑莓开发环境搭建(Getting Started with Blackberry for Phonegap in Windows

阅读更多

前期准备(下载并安装):

1.  Java Development Kit (JDK):http://www.oracle.com/technetwork/java/javase/downloads/index.html#jdk

2.  Apache ant: http://ant.apache.org/bindownload.cgi 或者http://download.csdn.net/download/loveanna7/4762784 ant-1.8.4.zip (for windows)<后面地址下载下来的,解压到一个目录下,然后设置下环境变量,如我在path中增加D:\dev\apache-ant-1.8.4\bin。有朋友下载后不知道使用说不能用,望成功的朋友纠正下。我公司xp和家里win7两套环境就这样安装的。>

3.  phonegap:http://phonegap.com/download

4.  黑莓WebWorks SDK:

黑莓手机(BlackBerry WebWorks Smartphone SDK):https://bdsc.webapps.blackberry.com/html5/download/sdk

如果支持平板开发,另外需要BlackBerry WebWorks Tablet OS SDK:https://bdsc.webapps.blackberry.com/html5/download/sdk 以及Adobe Air SDK的支持http://www.adobe.com/devnet/air/air-sdk-download.html

5.  Apache Tomcat(可选),如果你下载了Ripple在浏览器上做测试的话,需要建个web服务,或者你想在BlackBerry模拟器或者真机上高效测试WebWorks/PhoneGap程序--不需要重新打包编译的话,也需要建个Web服务。有很多web服务器的weblogic等,我习惯用tomcat。(测试让人很纠结- -!)

 

我只做手机版,所以在此不讨论平板相关的。

我的环境:

windows:xp/win7

JDK:1.6.0_32

ANT:1.8.4

Phonegap/cordova:2.2

WebWorks SDK:2.3.1.5

Tomcat:6.x

 

现在拿个project来试试手,当然主要是为了试运行环境。

在phonegap/lib/blackberry下面有两个文件夹,sample和www。sample是个完整的demo。把sample拷贝到你的黑莓工作目录下,如我的:E:\works\bb\ 。

然后进入sample文件夹(我重命名成了sample22),修改project.properties文件中的blackberry.bbwp.dir=

playbook.bbwp.dir=值(不做平板后面这个可不用改)。注意这里路径的\都要换成\\

  

部署到模拟器:修改project.properties文件中的blackberry.sim.dir和blackberry.sim.bin。平板还要修改playbook.sim.ip和playbook.sim.password等

  

如我的project.properties文件内容:

blackberry.bbwp.dir=D:\\dev\\Research In Motion\\BlackBerry WebWorks SDK 2.3.1.5

playbook.bbwp.dir=D:\\dev\\Research In Motion\\BlackBerry WebWorks SDK for TabletOS 2.2.0.5\\bbwp

blackberry.sim.dir=D:\\dev\\Research In Motion\\BlackBerry WebWorks SDK 2.3.1.5\\simpack\\7.0.0.318

#blackberry.sim.bin=9930.bat

blackberry.mds.dir=D:\\dev\\Research In Motion\\BlackBerry WebWorks SDK 2.3.1.5\\mds

blackberry.sigtool.password=

playbook.sigtool.csk.password=
playbook.sigtool.p12.password=

blackberry.sim.password=

playbook.sim.ip=

playbook.sim.password=

playbook.device.ip=

playbook.device.password=

 

现在运行sample测试环境安装配置是否成功。打开终端(dos)依次执行命令:

E:

E:\works\bb\sample22

ant blackberry load-simulator

(真机用命令ant blackbery device 。平板上把blackberry换成playbook)

日志信息:

E:\works\bb\sample22>ant blackberry load-simulator
Buildfile: E:\works\bb\sample22\build.xml

blackberry:

load-simulator:

generate-cod-name:
     [echo] Generated name: cordovaExample.cod

clean:
   [delete] Deleting directory E:\works\bb\sample22\build

package-app:
    [mkdir] Created dir: E:\works\bb\sample22\build\widget
     [copy] Copying 64 files to E:\works\bb\sample22\build\widget
      [zip] Building zip: E:\works\bb\sample22\build\cordovaExample.zip

build:
     [exec] [INFO]                      Parsing command line options
     [exec] [INFO]                      Parsing bbwp.properties
     [exec] [INFO]                      Validating application archive
     [exec] [INFO]                      Parsing config.xml
     [exec] [INFO]                      Populating application source
     [exec] [INFO]                      Compiling BlackBerry WebWorks application
     [exec] [INFO]                      Generating output files
     [exec] [INFO]                      BlackBerry WebWorks application packaging complete

load-simulator:
     [echo] Simulator directory=D:\dev\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\simpack\7.0.0.318
     [echo] Simulator directory=D:\dev\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\simpack\7.0.0.318
     [echo] Simulator executable=D:\dev\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\simpack\7.0.0.318/9930.bat
     [echo] Closing all running simulators...
     [exec] No sessions currently running.
     [exec] Result: 1
     [echo] MDS directory=D:\dev\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\mds
     [copy] Copying 4 files to D:\dev\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5\simpack\7.0.0.318

BUILD SUCCESSFUL
Total time: 57 seconds

E:\works\bb\sample22>

 

接着我们会看到自动打开了一个终端和模拟器

应用在的位置如图:

windows phonegap黑莓开发环境搭建(Getting Started with Blackberry for Phonegap in Windows_第1张图片

 

 

参考链接http://docs.phonegap.com/en/2.2.0/guide_getting-started_blackberry_index.md.html#Getting%20Started%20with%20Blackberry

  

 

 

ps:在草稿箱忘发布了= =!

你可能感兴趣的:(cordova,phonegap,黑莓开发环境,Getting,Started,with,Blackberry)