Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

Archive for April 2013

Create new PhoneGap/Cordova projects using cordova-create-gui

leave a comment »

cordova_bot_osxThis is for OS X only, and does not check for project requirements yet (which may be coming with the bin/check_reqs scripts in 2.7.0). Essentially this proof of concept project is a GUI wrapper for the bin/create scripts you know and love. You could use this against the the iOS, OS X, Android and BlackBerry source (although I have only tested it for iOS and OS X projects). Think of this as Handbrake for ffmpeg.

The project routes the stderr and stdout from the script call back to your callback function, and also reports the resultcode for you to further process.

Ideally this would be a GUI for cordova-cli instead, that may come in the future. This app was also created using itself, and Cordova OS X.

Download the complete runnable project.

View and fork the source on Github.

The GUI itself won’t win any awards yet, but is workable (click to enlarge):

cordova-create-gui

Written by shazron

April 16, 2013 at 12:53 am

Posted in cordova, phonegap

Cordova OS X – Resurrection

with 15 comments

cordova_bot_osxNo, I didn’t use an Alien Queen embryo for this one. Dormant for so long, this has been brought up to date vis-à-vis the iOS Plugin architecture, and supports OS X 10.7 (Lion) and 10.8 (Mountain Lion). This means that if you know how to create an iOS Plugin, you can create an OS X one as well. The JavaScript to native bridge is synchronous, while the native to JavaScript bridge is asynchronous, just like iOS.

Not all core plugins are there. The only core plugins available at the moment are the Connection API, and the Device API, and the only event supported is the deviceready event.

To create a new project, follow the same command line usage as iOS. Download the source code.

The WebView used is from the system WebKit, which varies depending on your OS X version. Since it uses the system WebKit, the Web API support follows from it, and running Modernizr on a Cordova OS X project on OS X 10.8.3 there is broad support for most of the APIs out there except for indexeddb, some advanced input types, flexbox and WebGL. WebGL can be enabled in code however. See the Modernizr report below:

modernizr

Future updates will add support for the rest of the Cordova APIs, whether as a JavaScript shim or as complete plugins. Interfaces to create/update the native menus, and native context (right-click) menus are also on the plate as well. Full-screen support is there already. JavaScript bindings for native objects for plugins is being considered as well.

Written by shazron

April 9, 2013 at 12:22 am

Posted in cordova, phonegap

What’s new in Cordova iOS 2.6.0

with 8 comments

cordova_bot1. Config.xml <preference> changes – added KeyboardShrinksView and HideKeyboardFormAccessoryBar. UIWebViewBounce renamed to DisallowOverscroll. EnableLocation deprecated.

HideKeyboardFormAccessoryBar will hide the form accessory bar (the Next, Prev and Done buttons) when the keyboard is shown for  handling input in a textbox.

KeyboardShrinksView will shrink the WebView when the keyboard comes up. The WebView shrinks instead of the viewport shrinking and the page scrollable. This applies to apps that position their elements relative to the bottom of the WebView. This is the default behaviour on Android, and makes a lot of sense when building apps as opposed to webpages.

The UIWebViewBounce preference was changed to DisallowOverscroll to be consistent with Android (thus the default value is the opposite).

The EnableLocation preference is deprecated – set  the “onload” attribute of the CDVLocation plugin element instead.

2. InAppBrowser API – “loaderror” event added

You can listen for the loaderror event to be notified of any errors in loading any URLs in the InAppBrowser.

3. Notification API changes

notification.prompt feature added – allows a customizable prompt versus the JavaScript one. Also, You can also use commas for button labels for notification.confirm.

4. FileTransfer API changes

FileTransfer download allows setting of headers now. Both FileTransfer upload and download will now support Basic Auth automatically when the username and password is encoded in the URL.

5. Camera API changes

You can now select the front or back camera on Camera.getPicture().  EXIF metadata is also included in the images returned from the Camera API, see this issue. Fixed crash when camera not available.

6. Various splash-screen issues fixed

See this issue.

7. Various iframe issues fixed

See this and this.

8. Various FileReader issues fixed

See this and this.

9. Multi-part plugin result is now supported

See this and this. Basically now callbacks can receive more than one argument.

10. Plugins can be dynamically registered (outside of config.xml)

See this issue.

Other fixes are in the RELEASE NOTES.

Written by shazron

April 8, 2013 at 11:53 pm

Posted in cordova, phonegap

Follow

Get every new post delivered to your Inbox.

Join 1,540 other followers

%d bloggers like this: