getting started with titanium
DESCRIPTION
It is just basic information and getting start with Titanium cross platform mobile application framework for future...TRANSCRIPT
![Page 1: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/1.jpg)
Getting started with Titanium
- Next-Generation Mobile Platform
![Page 2: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/2.jpg)
About Me…
• Naga Harish• AnuBaVam is my company
• My Blog : ShareOurIdeas.com• @nagaharishmovva
![Page 3: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/3.jpg)
Our Application
UI API Phone API
Bridge - JavaScript -Java / JavaScript - Objective C
OS - Android / iPhone
Native Android App Native iOS App
Optional Modules
Titanium MobileApplication Source Files
![Page 4: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/4.jpg)
JS files to native objective code
• JS is statically analyzed• Ti’s Python build scripts interact with native SDK
tools .• Native project stub will created• JS precompiled to bytecode(Android) or inlined
in a generated C file(iOS)• Your JS and native code package together with
V8/Rhino or JavaScriptCore to interpret JS code at runtime
![Page 5: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/5.jpg)
• PC or Mac machine (for iOS development)• XCode with iOS SDK• Android SDK• Titanium Studio with SDK
To start development…
![Page 6: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/6.jpg)
• Powerful Eclipse-based IDE• It will help you create, run for test and deploy
(to app store)
Small intro about Titanium Studio…
![Page 7: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/7.jpg)
• It always notifies you about latest SDK and Studio updates .
Ti Studio (why it so powerful)…
![Page 8: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/8.jpg)
• It is so smart, because it catches mistakes immediately!
Ti Studio (why it so powerful)…
![Page 9: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/9.jpg)
• Syntax highlighting
Ti Studio (why it so powerful)…
![Page 10: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/10.jpg)
• Content assist and more…
Ti Studio (why it so powerful)…
![Page 11: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/11.jpg)
Project structure…
![Page 12: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/12.jpg)
LET’S GET INTO THE INTERESTING PART. CODING…
![Page 13: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/13.jpg)
Create Window
We can also set properties like thiswin.backgroundColor="#F00";win.setBackgroundColor("#F00");
![Page 14: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/14.jpg)
Create Label
![Page 15: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/15.jpg)
Create Button
LET’S GUESS…
![Page 16: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/16.jpg)
Create Button
![Page 17: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/17.jpg)
Create button with add event listener
![Page 18: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/18.jpg)
Add sub view to Window or View
![Page 19: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/19.jpg)
Log methods
![Page 20: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/20.jpg)
Animate with UI elementsBefore start
After complete
![Page 21: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/21.jpg)
HELLO WORLDEvery software engineer’s first program
IDECreate new projectFolder structureBuild folderError handling (@ runtime)Include JS file
![Page 22: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/22.jpg)
Connect to Web Services
open( “GET|POST”, “[HTTP://URL…]”, “[TRUE|FLASE – async call]”] )This async parameter only for iOS
![Page 23: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/23.jpg)
Connect to Web Services
• How to send data using post method?
• How to stop request
![Page 24: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/24.jpg)
REQUEST.OPEN(“SHOW”,”DEMO”)Keep your app fresh. Use web services
![Page 25: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/25.jpg)
• Install will copy SQLite database file to device's internal storage. If file is there, it just uses the open method
• We can use Ti.App.Properties to set db install to true. For E.g. Ti.App.Properties. setBool(‘isDbInstalled’,true)
• Open will automatically open the DB to perform CRUD operations
Database
![Page 26: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/26.jpg)
Database code snippets
• Running SQL Queries against the DB
• We can also get number of Rows affected
![Page 27: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/27.jpg)
• What about SELECT Query?
Database code snippets
![Page 28: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/28.jpg)
DATABASE.OPEN(“DEMO”)CRUD operations
![Page 29: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/29.jpg)
• Create 2 letter folder inside “i18n” (18 stands for the number of letters between the first i and last n in internationalization) in root folder.
• Create Locale folder in it• In that Locale folder just keep strings.xml
Internationalization
http://bit.ly/TiLang
![Page 30: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/30.jpg)
• strings.xml
Our App in different languages
http://bit.ly/TiLang
![Page 31: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/31.jpg)
私のアプリケーション今すぐデモ ...
![Page 32: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/32.jpg)
• Just like CSS, we can use this JSS to bring rich user interface to apply styles to elements.
• Yes, here also we can create “Class” and “ID”. Just like .classname or #Idname
• How to include JSS in our view?– Just retain same name for the .JSS file– For Example :- ui.js and the JSS file ui.jss
Applying Styles using JSS
![Page 33: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/33.jpg)
CSS and JSS
#idName{ color:#f00; height:100px; width:100px;}
#idname{ color:#f00; height:100; width:100; text:”This is my CSS Text”;}
.className{backgroundColor:#fff;}
.className{ backgroundColor:#fff;}
![Page 34: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/34.jpg)
JSS {DEMO:’NOW’}Let’s apply style
![Page 35: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/35.jpg)
• Create a server backed for your app instantly• Launch and scale your app automatically• No server coding or administration required• Reduced Cost
Cloud Service
![Page 36: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/36.jpg)
• Standard(Tier 1)– Users– Key Values– Photos– Custom objects– Email Templates– Push notifications
• Advanced(Tier 2)– Chat– Check-ins– Social integration– Photo Collections– Clients– Places– Status– Ratings, Reviews & Likes– Posts
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
![Page 37: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/37.jpg)
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
![Page 38: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/38.jpg)
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
![Page 39: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/39.jpg)
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
![Page 40: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/40.jpg)
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
![Page 41: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/41.jpg)
Cloud Service (cont)
http://bit.ly/TiCloud http://bit.ly/TiCloudBook
https://api.cloud.appcelerator.com/v1/users/create.json?key=[Key Value]
![Page 42: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/42.jpg)
• We can also create a Module atop Titanium using native code (Objective C or Java)
• We can get more Free/$ modules from the marketplace
• You can also contribute!
Extend Ti API
http://bit.ly/TiMarket
![Page 43: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/43.jpg)
Useful Ti Modules
![Page 44: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/44.jpg)
• Ti for Titanium• L for Titanium.Locale.getString• alert for Titanium.UI.createAlertDialog• And also remember about Code snippets– For e.g. :- button then {ctrl + space} and see the
magic..
Macro
![Page 45: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/45.jpg)
File system
Few more code snippets
![Page 46: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/46.jpg)
Few more code snippets (cont)…
![Page 47: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/47.jpg)
Few more code snippets (cont)…
![Page 48: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/48.jpg)
To know more….http://bit.ly/TiMyPage http://bit.ly/TiVimeo http://bit.ly/TiCloud
http://bit.ly/TiLearninghttp://bit.ly/TiTutorial http://bit.ly/Ti7Days
![Page 49: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/49.jpg)
To know more (code github)….
• https://github.com/appcelerator• https://github.com/appcelerator-developer-relations • https://github.com/BradBroulik/titanium-mvc• https://github.com/tanin47/silver• https://github.com/railskarthi/
acs_custom_object_query• https://github.com/railskarthi/acs_android_push• https://github.com/guilhermechapiewski/titanium-
jasmine/
![Page 50: Getting started with titanium](https://reader033.vdocuments.us/reader033/viewer/2022061201/54799887b4af9f98668b495e/html5/thumbnails/50.jpg)
Thank You
Naga Harish MShareOurIdeas.com