Slide 1

Slide 1 text

Using JavaScript to Build Native iOS Applications Andrew Lombardi Owner, Tech Evangelist Mystic Coders, LLC andrew AT mysticcoders DOT com kinabalu @ irc://irc.freenode.net - ##wicket, ##java kinabalu @ twitter Saturday, March 3, 12

Slide 2

Slide 2 text

Saturday, March 3, 12

Slide 3

Slide 3 text

12 Years in business Saturday, March 3, 12

Slide 4

Slide 4 text

Software Consultants 12 Years in business Saturday, March 3, 12

Slide 5

Slide 5 text

Software Consultants International Speaker 12 Years in business Saturday, March 3, 12

Slide 6

Slide 6 text

Software Consultants International Speaker Training 12 Years in business Saturday, March 3, 12

Slide 7

Slide 7 text

Software Consultants International Speaker Training 12 Years in business Apache Wicket Contributor Saturday, March 3, 12

Slide 8

Slide 8 text

Software Consultants International Speaker Training 12 Years in business Apache Wicket Contributor iPhone Developer (Obj-C / JavaScript) Saturday, March 3, 12

Slide 9

Slide 9 text

To our success! Software Consultants International Speaker Training 12 Years in business Apache Wicket Contributor iPhone Developer (Obj-C / JavaScript) Saturday, March 3, 12

Slide 10

Slide 10 text

Saturday, March 3, 12

Slide 11

Slide 11 text

Appcelerator Titanium http://www.appcelerator.com/ Saturday, March 3, 12

Slide 12

Slide 12 text

Saturday, March 3, 12

Slide 13

Slide 13 text

Saturday, March 3, 12

Slide 14

Slide 14 text

“2011 OnMobile 100 Top Private Companies” Saturday, March 3, 12

Slide 15

Slide 15 text

“2011 OnMobile 100 Top Private Companies” “Best Developer Tool: Aptana Studio3’s PyDev” Saturday, March 3, 12

Slide 16

Slide 16 text

“#37 Most Innovative Companies in the Apple Ecosystem” “2011 OnMobile 100 Top Private Companies” “Best Developer Tool: Aptana Studio3’s PyDev” Saturday, March 3, 12

Slide 17

Slide 17 text

“5 Platforms That Defined the Mobile Space in 2010” “#37 Most Innovative Companies in the Apple Ecosystem” “2011 OnMobile 100 Top Private Companies” “Best Developer Tool: Aptana Studio3’s PyDev” Saturday, March 3, 12

Slide 18

Slide 18 text

“5 Platforms That Defined the Mobile Space in 2010” “#37 Most Innovative Companies in the Apple Ecosystem” “2011 OnMobile 100 Top Private Companies” “Best Developer Tool: Aptana Studio3’s PyDev” “Cool Vendor of the Year for Enterprise Mobility” Saturday, March 3, 12

Slide 19

Slide 19 text

Titanium is an open source framework for building mobile and desktop applications using JavaScript is... Saturday, March 3, 12

Slide 20

Slide 20 text

What we’ll cover Saturday, March 3, 12

Slide 21

Slide 21 text

1. The Setup What we’ll cover Saturday, March 3, 12

Slide 22

Slide 22 text

1. The Setup 2. Platform Overview What we’ll cover Saturday, March 3, 12

Slide 23

Slide 23 text

1. The Setup 2. Platform Overview 3. Simple Example What we’ll cover Saturday, March 3, 12

Slide 24

Slide 24 text

1. The Setup 2. Platform Overview 3. Simple Example 4. Supported Modules What we’ll cover Saturday, March 3, 12

Slide 25

Slide 25 text

1. The Setup 2. Platform Overview 3. Simple Example 4. Supported Modules 5. Demo What we’ll cover Saturday, March 3, 12

Slide 26

Slide 26 text

The Setup Saturday, March 3, 12

Slide 27

Slide 27 text

1. Download iOS SDK - http://developer.apple.com Saturday, March 3, 12

Slide 28

Slide 28 text

Saturday, March 3, 12

Slide 29

Slide 29 text

Pay the Saturday, March 3, 12

Slide 30

Slide 30 text

Pay the Apple Saturday, March 3, 12

Slide 31

Slide 31 text

Pay the Apple Tax Saturday, March 3, 12

Slide 32

Slide 32 text

Pay the Apple Tax $99 USD Saturday, March 3, 12

Slide 33

Slide 33 text

2. Download: http://www.appcelerator.com/products/download/ Saturday, March 3, 12

Slide 34

Slide 34 text

• Apache 2.0 Licensed • Commercial training and support services available • Core SDK - free and open source Saturday, March 3, 12

Slide 35

Slide 35 text

What is it good for? Saturday, March 3, 12

Slide 36

Slide 36 text

What is it good for? Data-driven web service clients Saturday, March 3, 12

Slide 37

Slide 37 text

What is it good for? Data-driven web service clients Web service mash-ups Saturday, March 3, 12

Slide 38

Slide 38 text

What is it good for? Data-driven web service clients Web service mash-ups Social utilities Saturday, March 3, 12

Slide 39

Slide 39 text

What is it good for? Data-driven web service clients Web service mash-ups Social utilities Casual games Saturday, March 3, 12

Slide 40

Slide 40 text

Hello, World! Saturday, March 3, 12

Slide 41

Slide 41 text

Mobile Architecture Saturday, March 3, 12

Slide 42

Slide 42 text

CFUB Saturday, March 3, 12

Slide 43

Slide 43 text

Universal Apps? if("Ti.Platform.osname === ”ipad”) { Ti.include(‘app_ipad.js’); } else { Ti.include(‘app_iphone.js’); } Saturday, March 3, 12

Slide 44

Slide 44 text

Memory Usage Ti.API.debug(Ti.Platform.availableMemory); Saturday, March 3, 12

Slide 45

Slide 45 text

Titanium Plus Saturday, March 3, 12

Slide 46

Slide 46 text

Titanium Plus • Commerce modules: Apple Storekit, Barcode reader, Magtek credit card reader, PayPal in-app purchase • Communication modules: Bump, SMS, Urban Airship • Media modules: Brightcove, TV Out • Analytics modules: Omniture, Titanium Analytics, Titanium Geo Saturday, March 3, 12

Slide 47

Slide 47 text

Titanium Studio Saturday, March 3, 12

Slide 48

Slide 48 text

Titanium Studio OFFLINE FAIL Saturday, March 3, 12

Slide 49

Slide 49 text

Titanium Studio • Find the TitaniumStudio.ini file Saturday, March 3, 12

Slide 50

Slide 50 text

Titanium Studio • Find the TitaniumStudio.ini file • No Debug Saturday, March 3, 12

Slide 51

Slide 51 text

Titanium Studio • Find the TitaniumStudio.ini file • No Debug Saturday, March 3, 12

Slide 52

Slide 52 text

Titanium Studio Saturday, March 3, 12

Slide 53

Slide 53 text

• Manage and run Titanium applications • Package applications for distribution • Run on a device for testing • Develop in derivative Eclipse editor Aptana Titanium Studio Saturday, March 3, 12

Slide 54

Slide 54 text

Titanium Studio Saturday, March 3, 12

Slide 55

Slide 55 text

Titanium Studio Saturday, March 3, 12

Slide 56

Slide 56 text

Access to Media Interact with the iOS built-in cameras Ti.Media.showCamera({ success: function(imageBlob) { }, cancel: function() { }, error: function(error) { }, allowImageEditing: true }); Saturday, March 3, 12

Slide 57

Slide 57 text

Network XHR-style object for remote data requests. var loader = Ti.Network.createHTTPClient(); loader.open("GET","http://www.google.com/api/something"); loader.onload = function() { } // Send the HTTP request loader.send(); Saturday, March 3, 12

Slide 58

Slide 58 text

Facebook Connect Titanium.Facebook.appid = '[YOUR APPID]'; Titanium.Facebook.permissions = ['publish_stream']; Titanium.Facebook.addEventListener('login', function(e) { if (e.success) { alert('Logged In'); } else if (e.error) { alert(e.error); } else if (e.cancelled) { alert("Cancelled"); } }); Titanium.Facebook.authorize(); Saturday, March 3, 12

Slide 59

Slide 59 text

Paypal Integration var ppButton = Ti.Paypal.createPaypalButton { width: 294, height: 50, bottom: 50, appId: “APP-120391209312”, paypalEnvironment: Ti.Paypal.PAYPAL_ENV_SANDBOX feePaidByReceiver: false, transactionType: Ti.Paypal.PAYMENT_TYPE_DONATION enableShipping: false, payment: { amount: 50.0, tax: 0.0, shipping: 0.0, currency: “SEK”, recipient: “[email protected]”, itemDescription: “Donation”, merchantName: “Mystic” } }); Saturday, March 3, 12

Slide 60

Slide 60 text

Native User Experience Native performance + Native UI (tables, animations, gestures, etc). Location-based Services Augmented reality, geo-location, compass, native maps Social Sharing Authenticated access to Facebook, Twitter, Yahoo YQL. Native email/ address book. Data Access online / device data, embedded SQL database, filesystem, web services Multimedia Camera, video camera, streaming / device audio/video Analytics Camera, video camera, native image viewers, streaming or device audio/ video Extensibility Add any native Obj. C (iPhone) or Java (Android) module into Titanium Development Tools Create, test, and publish your app Full-Featured Development... Saturday, March 3, 12

Slide 61

Slide 61 text

Titanium Fundamentals Saturday, March 3, 12

Slide 62

Slide 62 text

Titanium Fundamentals A Titanium application is a JavaScript program that is interpreted at runtime on the device Saturday, March 3, 12

Slide 63

Slide 63 text

Titanium Fundamentals A Titanium application is a JavaScript program that is interpreted at runtime on the device app.js = root execution context of the app Saturday, March 3, 12

Slide 64

Slide 64 text

Titanium Fundamentals A Titanium application is a JavaScript program that is interpreted at runtime on the device app.js = root execution context of the app No browser involved Saturday, March 3, 12

Slide 65

Slide 65 text

Titanium Fundamentals A Titanium application is a JavaScript program that is interpreted at runtime on the device app.js = root execution context of the app No browser involved We use the WebKit KJS JavaScript engine (iOS) or Rhino (Android/BB) Saturday, March 3, 12

Slide 66

Slide 66 text

• Organized into logical namespaces • “Titanium” (or just “Ti” for short) is the root namespace for all Titanium functionality • A few other odds and ends in the global space – setTimeout/setInterval – alert – JSON Titanium Javascript API Saturday, March 3, 12

Slide 67

Slide 67 text

• A single window or stack of windows • Tab Group containing many windows • Windows contain views Titanium UI Composition Saturday, March 3, 12

Slide 68

Slide 68 text

DEMO! Saturday, March 3, 12

Slide 69

Slide 69 text

Titanium PhoneGap Platform iOS, Android, (soon RIM) iOS, Android, WebOS, RIM, Symbian Device HW Support GPS, Vibration, Accelerometer, Compass, Camera, Microphone GPS, Vibration, Accelerometer, Compass, Camera, Microphone Native UI Yes No Performance Not as fast as native, but “good enough” As fast as HTML / Javascript on device Comparison with PhoneGap Saturday, March 3, 12

Slide 70

Slide 70 text

More websites for Titanium knowledge RESOURCES Saturday, March 3, 12

Slide 71

Slide 71 text

Training http://developer.appcelerator.com/training Saturday, March 3, 12

Slide 72

Slide 72 text

General Homepage: http://www.appcelerator.com Twitter: @appcelerator IRC: #twitter_app Source: http://github.com/appcelerator Saturday, March 3, 12

Slide 73

Slide 73 text

Saturday, March 3, 12

Slide 74

Slide 74 text

Titanium Rocks!! Saturday, March 3, 12

Slide 75

Slide 75 text

Q&A Thanks for listening! Andrew Lombardi Owner, Tech Evangelist Mystic Coders, LLC andrew AT mysticcoders DOT com kinabalu @ irc://irc.freenode.net - ##wicket, ##java Saturday, March 3, 12