180 likes | 376 Views
Going Native: How to build mobile apps. Stefan Wittmann Zen Product Specialist. ‘Killer app‘?. * www.dilbert.com. I have to build a mobile app. But how?. The native approach. iOS Objective-C Android Java Windows .NET. The native approach.
E N D
Going Native: How to build mobile apps Stefan Wittmann Zen Product Specialist
‘Killer app‘? * www.dilbert.com
I have to build a mobile app Buthow?
The native approach • iOS Objective-C • Android Java • Windows .NET
The native approach * This listing is neither complete nor prioritized
The web approach • Leverages HTML 5 + CSS3
The web approach * This listing is neither complete nor prioritized
So many roads… • Native Development • Longer release cycles • Rewrite code for device types • Web base Development • Not a native app • Browser Feeling • Limited access to device features
What about a hybrid? Native App Native App Browser Native Code HTML Code HTML Code Device API Device API Device API Native Hybrid Web
What does PhoneGap offer? • Native Stub Native App • Runs web pages in a container • Provides access to device features • Supports and more!
Four steps to your mobile app • Setup PhoneGap • Develop mobile app with ZEN • Point the stub to your start URL • Test mobile app and deploy stub
Setup • iOS • Install Xcode(part of the iOS SDK) • iOS Developer License • Android • Install Java SDK + Eclipse • Install Android SDK Tools • Etc.
Step 1: How do I setup PhoneGap? • http://phonegap.com • Mac: • Install Node.js • $ sudo npm install -g phonegap • $ phonegap create my-app • $ cd my-app • $ phonegap run ios
Step 2: How do I setup the stub? • Point it to your start URL • Choose an app name • Configure permissions and device support • Add icons • Configure whitelist URL’s!
Step 3+4: Getting access to the device • Include cordova.js in your page • Gives access to multiple API’s • Wraps plugin API • Communication based on request/response to native stub
Using the camera is easy! navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI }); function onSuccess(imageURI) { var image = document.getElementById('myImage'); image.src = imageURI; } function onFail(message) { alert('Failed because: ' + message); }
What about the content? • Zen Mobile • Zen Desktop