Click here to load reader
Upload
yiguang-hu
View
463
Download
0
Embed Size (px)
DESCRIPTION
This present talks about using Titanium to develop cross platform mobile applications. Compare native development, phonegap, html5,javascript with titanium.
Citation preview
Mobile App Development with Titanium
Yiguang Huyighu@yahoo, twitter, facebook,
Mobile Development tools
HTML5+JavaScript
PhoneGap (HTML5+JavaScript)
Titanium (JavaScript)
Native(ObjectiveC, Java)
Factors to Consider
• Native (iOS, Android, Windows etc)• Web (html5+javascript, phoneGap)• Database support(preloaded?, Native,
Titanium)• UI look and feel (Native?)• Developer skills
Titanium Developers stats
One Code Base->Native, Hybrid, and Mobile Web
Titanium SDK
• Features• Supports 5,000+ native APIs• JavaScript-based platform• Support for iOS, Android, and HTML5• Benefits• 70% faster than developing in Objective-C or Java• Single platform• Unlimited extensibility
Demonstration
• Download/Install Titanium SDK Studio – http://www.appcelerator.com/platform/titanium-s
tudio– Create a project– File-> New Titanium Project– Input Project information– Select template– Write the Code
Demonstration
• tiapp.xml file under root• Under Resources– Images here and under • android• iphone • mobileweb • to be replaced by your app images/icons etc.
– app.js
Sqlite Database
• Use groovy to setup preloaded sqlite databaseString dbLocation = "jdbc:sqlite:db/mytable.db"String dbDriver = "org.sqlite.JDBC"def getDb(){return groovy.sql.Sql.newInstance(dbLocation,
dbDriver)}
Create Sqlite Table
• def sql = getDb()• try{• sql.execute("create table if not exists mytable(id
Integer, sayittxt BLOB, sayitref BLOB, sayitcmt BLOB, conittxt BLOB, conitref BLOB, conitcmt BLOB, renittxt BLOB, renitref BLOB, renitcmt BLOB, ptittxt BLOB, ptitref BLOB, ptitcmt BLOB, itittxt BLOB, ititref BLOB, ititcmt BLOB, afittxt BLOB, afitref BLOB, afitcmt BLOB, tkittxt BLOB, tkitref BLOB, tkitcmt BLOB, csittxt BLOB, csitref BLOB, bvky BLOB, bvnm BLOB)")
• }catch (Exception e){ e.printStackTrace()}
Insert Sqlite Data
• sql.execute("insert into mytable(id,sayittxt,sayitref,sayitcmt,conittxt,conitref,conitcmt,renittxt,renitref,renitcmt,ptittxt,ptitref,ptitcmt,itittxt,ititref,ititcmt,afittxt,afitref,afitcmt,tkittxt,tkitref,tkitcmt,csittxt,csitref,bvky,bvnm)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",data)
• }
Write/Test code
• Simulator• Real devices– Android devices– iOS devices
Deployment
• Titanium Studio Workspace/{project}/build• Open developer account at Android market
and appStore• Setup profiles, certificate at appStore• Prepare images for different devices– Use the sample images as template to create
images for the application for all platforms
Deploy to Market
• Sign the apk file and upload to Android Market• Many other places without sign• Follow procedures to put to appStore– Titanium has simplified this process very much