SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
CROSS PLATFORM
MOBILE DEVELOPMENT
         Alberto De Bortoli
       www.albertodebortoli.it
        twitter: @albertodebo




  #pip11 meeting, January 21st 2011
     www.programmersinpadua.it
The purpose
• Write   once, run everywhere

• No   specific language/API/IDE knowledge
Native development
          from scratch
•Learn the language
•Learn how tools work
•Learn how to develop
 starting from samples

•Learn how to test and deploy
 A LOT OF TIME TO GET STARTED!
The iPhone (iOS) way to go
•Learn Objective-C

• Getting started with the IDE
  (Xcode, Interface Builder, Instruments...)
•Look at the samples...

• Get the license and
  distribute the apps
  (Developer Program,
  Developer Portal, iTunes
  Connect...)



• Start developing!
Higher-level frameworks
•Develop apps using web developers knowledge
 and web languages

   javascript   ruby python CSS HTML ...

                                   Rhodes
                                  PhoneGap
                                   Titanium
Titanium


•   Create powerful apps with native controls using the Web
    technologies you know

•   Framework for developing desktop and native mobile applications

•   For Windows and Mac

•   Mobile developing with JavaScript for Apple App Store & Google
    Android Market
Titanium Developer
•   NO IDE

•   NO visual UI editor

•   NO Debug tools


    doh... but...
• No ‘serious’ memory
     management
• No strong typing
• Simple native API use
• ...
A Titanium project

                         root




      build                                 Resources

                       tiapp.xml
                                                        ...
android       iphone               app.js    images
How to start with Titanium

  Read “Getting started with Titanium”        3 hours
       Download & Install Titanium            10 mins
Take a glance to Titanium app and set it up   30 mins
   Download & Test “Kitchen Sink” app         1 hour
             Amaze yourself                   2-3 days

    Keep studying/testing samples and
                                                 ...
             documentation
Comparison between filling a
tableView natively and with Titanium
 Objective-C 1/4


@interface myViewController : UITableViewController
! <UITableViewDelegate, UITableViewDataSource> {
! !    IBOutlet UITableView       *myTableView;
! !    IBOutlet UIView            *myView;
! !    NSArray                    *myArray;! !
}

@property (nonatomic, retain) IBOutlet UITableView    *myTableView;
@property (nonatomic, retain) IBOutlet UIView         *myView;


@end
Objective-C 2/4
// Load DB from file
dbPath = [[NSBundle mainBundle] pathForResource: @"db"
                                         ofType: @"plist"];

myArray = [[NSArray alloc] initWithContentsOfFile: dbPath];!
!
#pragma mark -
#pragma mark Table View data source

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return [myArray count];
}

- (NSInteger)tableView:(UITableView *)tableView
  numberOfRowsInSection:(NSInteger)section {
! return [[myArray objectAtIndex: section] count];
}

- (NSString *)tableView:(UITableView *)tableView
titleForHeaderInSection:(NSInteger)section {
! if (section < sectionName.length)
! !    return sectionName[section];
! else
! !    return @"unknown section";
}
Objective-C 3/4
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {
! UITableViewCell *cell =![tableView dequeueReusableCellWithIdentifier: @"Cell"];
!
! // create a cell
! if (cell == nil) {
       cell = [[UITableViewCell alloc]
                                                                 best practice...
                initWithStyle: UITableViewCellStyleSubtitle
              reuseIdentifier: @"Cell"];
! }
! // determine the correct row.
! // it will be restarted from 0 every time, and as
! // we're just loading in from one array, we need to
  // offset it by the right amount depending on the section.
!
  cell.textLabel.text = [[[myArray objectAtIndex: indexPath.section]
                                   objectAtIndex: indexPath.row]
                                    objectForKey: @"title"];
  cell.detailTextLabel.font = [UIFont systemFontOfSize: 11];
  cell.detailTextLabel.text = [[[myArray objectAtIndex: indexPath.section]
                                         objectAtIndex: indexPath.row]
                                          objectForKey: @"subtitle"];
! cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
!
! // return it
! return cell;
}
Objective-C 4/4
#pragma mark -
#pragma mark Table View delegate

//returns floating point which will be used for a cell row height at specified row index
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 46.0;
}


- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
!
// Navigation logic may go here -- for example, create and push another view controller.
! myDetailViewController *myDetail = [[myDetailViewController alloc]
                                initWithNibName: @"myDetailView"
                                         bundle:nil];
!
  // passing the right kid of scale (NSDictionary)
  myDetail.scale = [[myArray objectAtIndex: indexPath.section]
                             objectAtIndex: indexPath.row];
  iHarmonyAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
  [delegate.myNavigationController pushViewController: myDetail
                                             animated: YES];
!
! [myDetail release];
}
Javascript 1/2

// get the JSON file
var file = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,
'ext/database/notes.js');
var listArray = JSON.parse(file.read().text);

// the data to load in the tableView
var data = [];


// create table view
var tableView = Titanium.UI.createTableView({
                style: Titanium.UI.iPhone.TableViewStyle.GROUPED
});



/* LOAD DATA */
                                                  the core, next slide
tableView.setData(data);
Javascript 2/2
/* BEGIN - loading data for TableView */

// create first section
if (listArray[0] != null) {
! var section           = Ti.UI.createTableViewSection();




                                                            !!!
! section.headerTitle = listArray[0].group;
}

// update section name tracking variable
var sectionTitle = listArray[0].group;

for (var i=0; i<listArray.length; i++) {
!
! // if the group is changed
! if (sectionTitle != listArray[i].group) {
! !      // apply rows to data array
! !      data.push(section);
! !      // create new section
! !      var section = Ti.UI.createTableViewSection();
! !      section.headerTitle = listArray[i].group;
! !      // update section name tracking variable
! !      sectionTitle = listArray[i].group;
! }
! var row = Ti.UI.createTableViewRow({
!             hasChild:                true,
!             title:                   listArray[i].info
! });!
! section.add(row);
}
// push the last section
data.push(section);

/* END - loading data for TableView */
Titanium documentation
• developer.appcelerator.com
iHarmony Titanium porting
•   My first simple app (back to 2008)

•   Musical app about musical harmony, chords, scales...

•   One of the first 5.000 apps on the App Store

•   Developed in Xcode
    (2 weeks, September 2008-June 2010)
    1.0    1.1     1.2    2.0

•   Developed using Titanium
    (2 days for full porting, January 2011,
    not yet on any market)
iHarmony Titanium porting




Standard developing   Titanium developing
Thanks for watching




 Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App DevelopmentKetan Raval
 
RubyMotion
RubyMotionRubyMotion
RubyMotionMark
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the webRemy Sharp
 
Annotation Processing
Annotation ProcessingAnnotation Processing
Annotation ProcessingJintin Lin
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdevFrank Rousseau
 

Was ist angesagt? (6)

Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App Development
 
RubyMotion
RubyMotionRubyMotion
RubyMotion
 
Ui BDD Testing
Ui BDD TestingUi BDD Testing
Ui BDD Testing
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
 
Annotation Processing
Annotation ProcessingAnnotation Processing
Annotation Processing
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 

Ähnlich wie CROSS-PLATFORM MOBILE DEVELOPMENT WITH TITANIUM

FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumTechday7
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titaniumNaga Harish M
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)Netcetera
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Nicholas Jansma
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to DistributionTunvir Rahman Tusher
 
TiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewTiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewJamil Spain
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical StuffPetr Dvorak
 
Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Shih-Ting Huang
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answerskavinilavuG
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Filippo Matteo Riggio
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Sentinel Solutions Ltd
 

Ähnlich wie CROSS-PLATFORM MOBILE DEVELOPMENT WITH TITANIUM (20)

Intro to appcelerator
Intro to appceleratorIntro to appcelerator
Intro to appcelerator
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
iOS
iOSiOS
iOS
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)
 
Ios - Introduction to platform & SDK
Ios - Introduction to platform & SDKIos - Introduction to platform & SDK
Ios - Introduction to platform & SDK
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
 
TiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy OverviewTiAppCamp Atlanta 2013: Alloy Overview
TiAppCamp Atlanta 2013: Alloy Overview
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)Declarative UI on iOS without SwiftUI (中文)
Declarative UI on iOS without SwiftUI (中文)
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
 
Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2Mobile App Development: Primi passi con NativeScript e Angular 2
Mobile App Development: Primi passi con NativeScript e Angular 2
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

CROSS-PLATFORM MOBILE DEVELOPMENT WITH TITANIUM

  • 1. CROSS PLATFORM MOBILE DEVELOPMENT Alberto De Bortoli www.albertodebortoli.it twitter: @albertodebo #pip11 meeting, January 21st 2011 www.programmersinpadua.it
  • 2. The purpose • Write once, run everywhere • No specific language/API/IDE knowledge
  • 3. Native development from scratch •Learn the language •Learn how tools work •Learn how to develop starting from samples •Learn how to test and deploy A LOT OF TIME TO GET STARTED!
  • 4. The iPhone (iOS) way to go •Learn Objective-C • Getting started with the IDE (Xcode, Interface Builder, Instruments...)
  • 5. •Look at the samples... • Get the license and distribute the apps (Developer Program, Developer Portal, iTunes Connect...) • Start developing!
  • 6. Higher-level frameworks •Develop apps using web developers knowledge and web languages javascript ruby python CSS HTML ... Rhodes PhoneGap Titanium
  • 7. Titanium • Create powerful apps with native controls using the Web technologies you know • Framework for developing desktop and native mobile applications • For Windows and Mac • Mobile developing with JavaScript for Apple App Store & Google Android Market
  • 8. Titanium Developer • NO IDE • NO visual UI editor • NO Debug tools doh... but... • No ‘serious’ memory management • No strong typing • Simple native API use • ...
  • 9. A Titanium project root build Resources tiapp.xml ... android iphone app.js images
  • 10. How to start with Titanium Read “Getting started with Titanium” 3 hours Download & Install Titanium 10 mins Take a glance to Titanium app and set it up 30 mins Download & Test “Kitchen Sink” app 1 hour Amaze yourself 2-3 days Keep studying/testing samples and ... documentation
  • 11. Comparison between filling a tableView natively and with Titanium Objective-C 1/4 @interface myViewController : UITableViewController ! <UITableViewDelegate, UITableViewDataSource> { ! ! IBOutlet UITableView *myTableView; ! ! IBOutlet UIView *myView; ! ! NSArray *myArray;! ! } @property (nonatomic, retain) IBOutlet UITableView *myTableView; @property (nonatomic, retain) IBOutlet UIView *myView; @end
  • 12. Objective-C 2/4 // Load DB from file dbPath = [[NSBundle mainBundle] pathForResource: @"db" ofType: @"plist"]; myArray = [[NSArray alloc] initWithContentsOfFile: dbPath];! ! #pragma mark - #pragma mark Table View data source // Customize the number of sections in the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [myArray count]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { ! return [[myArray objectAtIndex: section] count]; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { ! if (section < sectionName.length) ! ! return sectionName[section]; ! else ! ! return @"unknown section"; }
  • 13. Objective-C 3/4 // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ! UITableViewCell *cell =![tableView dequeueReusableCellWithIdentifier: @"Cell"]; ! ! // create a cell ! if (cell == nil) { cell = [[UITableViewCell alloc] best practice... initWithStyle: UITableViewCellStyleSubtitle reuseIdentifier: @"Cell"]; ! } ! // determine the correct row. ! // it will be restarted from 0 every time, and as ! // we're just loading in from one array, we need to // offset it by the right amount depending on the section. ! cell.textLabel.text = [[[myArray objectAtIndex: indexPath.section] objectAtIndex: indexPath.row] objectForKey: @"title"]; cell.detailTextLabel.font = [UIFont systemFontOfSize: 11]; cell.detailTextLabel.text = [[[myArray objectAtIndex: indexPath.section] objectAtIndex: indexPath.row] objectForKey: @"subtitle"]; ! cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; ! ! // return it ! return cell; }
  • 14. Objective-C 4/4 #pragma mark - #pragma mark Table View delegate //returns floating point which will be used for a cell row height at specified row index - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 46.0; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ! // Navigation logic may go here -- for example, create and push another view controller. ! myDetailViewController *myDetail = [[myDetailViewController alloc] initWithNibName: @"myDetailView" bundle:nil]; ! // passing the right kid of scale (NSDictionary) myDetail.scale = [[myArray objectAtIndex: indexPath.section] objectAtIndex: indexPath.row]; iHarmonyAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.myNavigationController pushViewController: myDetail animated: YES]; ! ! [myDetail release]; }
  • 15. Javascript 1/2 // get the JSON file var file = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'ext/database/notes.js'); var listArray = JSON.parse(file.read().text); // the data to load in the tableView var data = []; // create table view var tableView = Titanium.UI.createTableView({ style: Titanium.UI.iPhone.TableViewStyle.GROUPED }); /* LOAD DATA */ the core, next slide tableView.setData(data);
  • 16. Javascript 2/2 /* BEGIN - loading data for TableView */ // create first section if (listArray[0] != null) { ! var section = Ti.UI.createTableViewSection(); !!! ! section.headerTitle = listArray[0].group; } // update section name tracking variable var sectionTitle = listArray[0].group; for (var i=0; i<listArray.length; i++) { ! ! // if the group is changed ! if (sectionTitle != listArray[i].group) { ! ! // apply rows to data array ! ! data.push(section); ! ! // create new section ! ! var section = Ti.UI.createTableViewSection(); ! ! section.headerTitle = listArray[i].group; ! ! // update section name tracking variable ! ! sectionTitle = listArray[i].group; ! } ! var row = Ti.UI.createTableViewRow({ ! hasChild: true, ! title: listArray[i].info ! });! ! section.add(row); } // push the last section data.push(section); /* END - loading data for TableView */
  • 18. iHarmony Titanium porting • My first simple app (back to 2008) • Musical app about musical harmony, chords, scales... • One of the first 5.000 apps on the App Store • Developed in Xcode (2 weeks, September 2008-June 2010) 1.0 1.1 1.2 2.0 • Developed using Titanium (2 days for full porting, January 2011, not yet on any market)
  • 19. iHarmony Titanium porting Standard developing Titanium developing