Phonegap + Blackberry webworks : ant build not generating standardinstall.zip - blackberry

I am trying to build a BlackBerry 7 and earlier project that uses the WebWorks SDK using Phonegap 2.9; but the build doesn't generate the StandardInstall.zip file as it's supposed to.
The project I'm trying to build is the example app found in the Phonegap 2.9 download (phonegap-2.9.0\lib\blackberry\bbos\example).
I followed the instructions in the Phonegap documentation and there is an overview of my environment:
My OS is Windows XP, I've got JDK, ANT and BlackBerry device manager installed. I've also installed the BlackBerry Webworks SDK and I've setup my Signing Keys (sigtool.csk and sigtool.db are in the bin folder of the webworks installation).
I also updated the project.properties file as explained in the documentation.
When I try to build the app, It doesn't print any error message, but the OTAInstall and StandardInstall folders are not generated (all I get is the zipped application folder and a widget folder).
I also tried deploying to simulator and to device, the errors thrown confirm just that the build step doesn't generate the files it should.
Screenshots: http://i.stack.imgur.com/XpN4M.png
Solutions I already tried:
JDK version problem
I downgraded JDK to 1.6.0_30 version (it seems that the Webworks SDK doesn't work with upper versions); but it didn't change anything.
White spaces
I also tried to avoid white spaces in paths like advised in other posts but it doesn't work:
C:
├ \ant
├ \java
└ \webworks
I don't know what else to do, any help would be much appreciated !

To make a blackberry phonegap project, the things you need are:
Phonegap (cordova libs)
BlackBerry WebWorks SDK
Ant, through which you will build your project.(Also add 'ANT' in you environment variables).
The steps to create a phonegap build:
Open the phonegap sample that came with it. Follow the location -
phonegap-2.3.0\lib\blackberry\sample
Copy cordova folder as you see the sample folder
Copy lib and www folder also. The lib folder contains the cordova library. The www folder is the only place for your files.
It contains your html, css, js and the config.xml
Copy blackberry.xml, build.xml and project.properties files.(change the properties in these files as per your project configurations)
'Build' folder is created once you run the script 'ant blackberry build'(To build the project) or 'ant blackberry load-simulator'(Build and run on simulator) or 'ant blackberry load-device'
Once you have built the project you can run it on device using the .cod files.
When you run the above build scripts you get the build folder in your PhonegapBlackberry project which looks like:

Setting the correct Java jdk home path in bbwp.properties file of my <BlackBerry SDK>/bin folder works for me.
Thanks,
prodeveloper.

Related

libGDX RoboVM fork iOS build error

I always get the same strange error when I try to run the iOS version of my libGDX game. The error only shows this message: Error:com.android.tools.idea.gradle.util.Projects.lastGradleSyncFailed(Lcom/intellij/openapi/project/Project;)Z
I can sync gradle successfully but the error message stays the same. It was suggested to use the same android studio version as the RoboVM fork version, so I did that. Now I use version 2.3.0 for them both, but it wasn't fixed by doing this. To set up RoboVM I followed the instructions from the RoboVM fork website: http://robovm.mobidevelop.com/.
Does someone know how to fix this problem?
RoboVM having some incompatibly issue with Android Studio/IDEA, version 2.3.0.
Try to use MobiDevelop RoboVM 2.3.2-SNAPSHOT version that having fixes for the same.
There is a pull request for this problem in master branch, you can check that.
You can work-around this problem with Android Studio higher than 2.2 (I am using AS 3.0 Canary 3, which supports Java 8 features) by splitting your project into two separate projects, one for Android and one for iOS, sharing an imported module where all the common code is.
To set this up you will need to copy your iOS app module into a separate folder. I use this structure:
Toplevel
android
androidApp
lib
ios
iosApp
Each project should have a copy of the gradle.build, gradlew script and gradle folders - easiest way is just to duplicate the tree then remove androidApp from one and iosApp from the other.
Both the android and ios folders contain a top level build.gradle, and a settings.gradle file. The common code is in the lib directory, so the ios folder will need a settings.gradle like this
include ':iosApp', ':lib'
project(':lib').projectDir = new File('../android/lib')
while the android project settings.gradle looks like this:
include ':lib', ':androidApp'
Open each project in its own window in AS, you can now build and run them independently. You can test from the command line (often easier to debug gradle issues) by using
gradlew androidApp:assembleDebug
for the android project and
gradlew iosApp:assemble
for the ios version.
The only issue I currently have with AS 3 is an occasional null pointer error during the dexing phase in the android project. Building from the command line makes this go away for a while. You can of course use AS 2.3 which does not have this issue (but doesn't support Java 8 features like lambdas in Android.)

Config.xml file for windows 7.8 mobile

Windows Phone 7.8 is supported till Phonegap 2.9
From Phonegap 3.0 its for WIndows Phone 8
I researched on net and found that there is need to crate config.xml file in project root directory where inex.html file is present.
Can anybody tell me what code to write in config.xml file?
Your best bet is to create a new Windows Phone 7 project via:
$ phonegap create Test
$ phonegap platform add wp7
$ phonegap build
Then when created, look in ./platforms/wp7/www for config.xml and you can get an idea there what is needed. In reality, you will just need to edit config.xml in the root folder - you should not need to create this or do any heavy changes to it...

PhoneGap 3.3 project structure and editing code

I'm about to give up on trying to build PhoneGap ready apps using Visual Studio and go the Mac route. My only hesitation is all of my WebApis for accessing server data is developed using ASP.Net MVC WebApi (C#). I really do not want to jump from Mac for developing UI to Windows for developing WebApi.
Anyways, in researching PhoneGap 3.3 and using the CLI to establish the project structure, I discovered that a shared www folder is created where all of your Html, JS, and CSS code should reside. Each platform you add to your project (iOS, Android, etc) resides in a separate platforms folder:
Project Root Folder
|- platforms
|- iOS
| - www
|- android
| - www
|- www
|- css
|- js
|- index.html
The documentation says that you should not do any editing of files in any of the platforms www folders because the build process copies the files from the root www folder to each www folder in platforms.
The iOS folder contains xcodeProject file that opens the iOS platform's specific www folder (not the root folder). I understand that the www folder under iOS is specific for iOS platform. But this means you cannot use XCode to edit any of the files you see. Right now XCode is useless as an editor as it edits the wrong files.
How are we supposed to utilize Xcode against the root www folder? Thanks for your help.
I'll show you how my team works with Cordova on iOS. This may not be the way recommended from the documentation but it works (Besides, the documentation has never been reliable).
We develop an Android version side by side, for Android, following the documentation works quite well:
Copy files to www folder
Execute cordova build android
Copy the compiled app from platforms/android/bin folder
However, for iOS it gets tricky. As you mentioned above, there is the xcodeProject file. If you made any changes from xcode, executing cordova build ios will definitely overwrite those changes. We also found that running cordva build ios a second time will corrupt the config.xml file - invalidating all the plugins we need to run the app correctly (this is true as of 3.3.0).
So the recommended approach for our iOS team is to:
After creating the iOS project file (xcodeProject) using cordova build ios.
All changes to the HTML files should be made to the folder platforms/ios/www/.
The root folder www will not be touched.
Compiling the iOS IPA is done exclusively within Xcode.
This approach works for us since we compile our Android build file separately on a Windows PC. If you use one system for multiple platforms then it could be wiser to make all your changes to the root www and then creating a symbolic link at platforms/ios/www/ - still keeping Xcode for compiling iOS and cordova build ** command line for other platforms.
Hope this helps!

Where can we place config.xml in IOS phone gap?

Hi I am new to IOS and Xcode. Can we use config.xml in IOS xcode? If we are using where can we place the config.xml. While creating my project I did not get config.xml. Is it will be a problem?
Using the latest versions of cordova tipically update the required files (config.xml) for you when you use the CLI with command
Cordova plugin add
The documentation explain specific tweaks to the config.xml
http://cordova.apache.org/docs/en/3.1.0/config_ref_index.md.html#The%20config.xml%20File
From the doc
For projects created with the Cordova CLI (described in The Command-line Interface The Command-line Interface), this file can be found in the top-level www directory. Using the CLI to build a project regenerates versions of this file in various subdirectories within platforms .Ifyou usetheCLI to create a project, but then shift your workflow to an SDK, the platform-specific file serves as a source.

Packaging a BlackBerry (WebWorks) PhoneGap/Cordova application

I'm working with PhoneGap/Cordova and the only options I see is to build to the emulator or to build for debuging to the device.
I want to package the app for further distribution and publishing. Any thoughts?
Thanks!!
First build with
ant blackberry build
Then, you need to get and install signing keys:
https://developer.blackberry.com/html5/documentation/signing_setup_smartphone_apps_1920010_11.html
Then finally, once you are able to code sign you need to use bbwp to sign and package the zip file generated by the build (the zip is in the build directory of the PhoneGap folder). So navigate to your sdk/bin directory and run:
bbwp C:\myapp\HelloWorld.zip -g mypassword -o C:\myapp\signed
This generates two folders in C:\myapp\signed which contain the signed files. You will need different files depending on the distribution method and a summary is here:
https://developer.blackberry.com/html5/documentation/distributing_your_app_1866990_11.html
https://developer.blackberry.com/html5/documentation/signing_landing_page.html
https://developer.blackberry.com/html5/documentation/distributing_your_app_1866990_11.html
You need to get a signing key from RIM in order to publish your apps to the Blackberry App World. My previous experiences was packaging the app with signing key and allow others to install the app with BlackBerry Desktop Manager using the .alx file generated.
cd into the top level directory of your project (the one that contains the www/ folder). Then call this command:
ant TARGET build
Where TARGET can be blackberry, playbook, or qnx (beta right now). This will create a build/ folder which should contain the needed files for further packaging.

Resources