Getting started with titanium

50
Getting started with Titanium - Next-Generation Mobile Platform

description

It is just basic information and getting start with Titanium cross platform mobile application framework for future...

Transcript of Getting started with titanium

Page 1: Getting started with titanium

Getting started with Titanium

- Next-Generation Mobile Platform

Page 2: Getting started with titanium

About Me…

• Naga Harish• AnuBaVam is my company

• My Blog : ShareOurIdeas.com• @nagaharishmovva

Page 3: Getting started with titanium

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

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

• 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

• 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

• It always notifies you about latest SDK and Studio updates .

Ti Studio (why it so powerful)…

Page 8: Getting started with titanium

• It is so smart, because it catches mistakes immediately!

Ti Studio (why it so powerful)…

Page 9: Getting started with titanium

• Syntax highlighting

Ti Studio (why it so powerful)…

Page 10: Getting started with titanium

• Content assist and more…

Ti Studio (why it so powerful)…

Page 11: Getting started with titanium

Project structure…

Page 12: Getting started with titanium

LET’S GET INTO THE INTERESTING PART. CODING…

Page 13: Getting started with titanium

Create Window

We can also set properties like thiswin.backgroundColor="#F00";win.setBackgroundColor("#F00");

Page 14: Getting started with titanium

Create Label

Page 15: Getting started with titanium

Create Button

LET’S GUESS…

Page 16: Getting started with titanium

Create Button

Page 17: Getting started with titanium

Create button with add event listener

Page 18: Getting started with titanium

Add sub view to Window or View

Page 19: Getting started with titanium

Log methods

Page 20: Getting started with titanium

Animate with UI elementsBefore start

After complete

Page 21: Getting started with titanium

HELLO WORLDEvery software engineer’s first program

IDECreate new projectFolder structureBuild folderError handling (@ runtime)Include JS file

Page 22: Getting started with titanium

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

Connect to Web Services

• How to send data using post method?

• How to stop request

Page 24: Getting started with titanium

REQUEST.OPEN(“SHOW”,”DEMO”)Keep your app fresh. Use web services

Page 25: Getting started with titanium

• 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

Database code snippets

• Running SQL Queries against the DB

• We can also get number of Rows affected

Page 27: Getting started with titanium

• What about SELECT Query?

Database code snippets

Page 28: Getting started with titanium

DATABASE.OPEN(“DEMO”)CRUD operations

Page 29: Getting started with titanium

• 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

• strings.xml

Our App in different languages

http://bit.ly/TiLang

Page 31: Getting started with titanium

私のアプリケーション今すぐデモ ...

Page 32: Getting started with titanium

• 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

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

JSS {DEMO:’NOW’}Let’s apply style

Page 35: Getting started with titanium

• 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

• 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

Cloud Service (cont)

http://bit.ly/TiCloud http://bit.ly/TiCloudBook

Page 38: Getting started with titanium

Cloud Service (cont)

http://bit.ly/TiCloud http://bit.ly/TiCloudBook

Page 39: Getting started with titanium

Cloud Service (cont)

http://bit.ly/TiCloud http://bit.ly/TiCloudBook

Page 40: Getting started with titanium

Cloud Service (cont)

http://bit.ly/TiCloud http://bit.ly/TiCloudBook

Page 41: Getting started with titanium

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

• 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

Useful Ti Modules

Page 44: Getting started with titanium

• 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

File system

Few more code snippets

Page 46: Getting started with titanium

Few more code snippets (cont)…

Page 47: Getting started with titanium

Few more code snippets (cont)…

Page 48: Getting started with titanium

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

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

Thank You

Naga Harish MShareOurIdeas.com