SlideShare a Scribd company logo
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

More Related Content

What's hot

Swift Tableview iOS App Development
Swift Tableview iOS App DevelopmentSwift Tableview iOS App Development
Swift Tableview iOS App Development
Ketan Raval
 
RubyMotion
RubyMotionRubyMotion
RubyMotion
Mark
 
Ui BDD Testing
Ui BDD TestingUi BDD Testing
Ui BDD Testing
Taras Kalapun
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
Remy Sharp
 
Annotation Processing
Annotation ProcessingAnnotation Processing
Annotation Processing
Jintin 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
 

What's hot (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
 

Similar to Cross platform mobile development

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 Titanium
Techday7
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
Naga Harish M
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
Fokke Zandbergen
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
Petr Dvorak
 
iOS
iOSiOS
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 - Introduction to platform & SDK
Ios - Introduction to platform & SDKIos - Introduction to platform & SDK
Ios - Introduction to platform & SDK
Vibrant Technologies & Computers
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
Tunvir 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 Testing
Bitbar
 
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 answers
kavinilavuG
 
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
Filippo 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 arrived
Gil 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
 

Similar to Cross platform mobile development (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]
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 

Cross platform mobile development

  • 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