SlideShare a Scribd company logo
1 of 19
Download to read offline
SYCS 402 Mobile App
Development
Day 13 - 3/12/2015
Housekeeping
• Camera/Image View Assignment is DUE TODAY
• Wireframes or some sort of flow document is due
Thursday, if your diagram is not self-explanatory please
provide additional documentation with the wireframes -
DUE TODAY
• Final project overview document due Thursday after break
• Wires, project feature, project overview
• please include team members name on document
Today
• Review “require” for including controllers and external
libraries
• Review Titanium ListViews/Templates
• Integrating Promises with Appcelerator Alloy
• Geo Location & Reverse GeoLocation
• Opening new controller and passing data - IOS, will post
sample code for Android
• See: https://github.com/aaronksaunders/scs-backbonetest1
Including w/Require
• The “src” identifies where the controller and view
are, and the id is how the item is accessed in the
parent controller
Accessing functions in child
controller (PhotoListView.js)
• use the identifier, so in this example it is
“$.photoListView” which would call functions using
this format
!
// in the parent controller
$.photoListView.functionInOtherController();	
!
// code in the child controller
$.functionInOtherController = function() {	
	 // DO SOMETHING AMAZING	
}
Alloy ListView
Adding the data to the
ListView
Adding the data to the
ListView
• Loop through the array of objects adding them to
the template
• The template has “bindId”s that are mapped to
the properties of the data objects
• The last step is to add the item to the specific
section of the ListView
Using gittio for Appcelerator
Modules - Pull to Refresh
• Install the javascript gittio module on your computer
npm	
  install	
  -­‐g	
  gittio
• Got to project directory in the terminal and install the
module in your project
gittio	
  install	
  nl.fokkezb.pullToRefresh	
  
• This will install the module in the project for you, then
follow instructions for using it
http://gitt.io/component/nl.fokkezb.pullToRefresh
Add Widget to view.xml file -
Pull to Refresh
• Wrap your ListView with the widget object and
specify the function to call to update the view
!
Add code to controller.js file
- Pull to Refresh
• Add the function refreshData to your controller to
update the data in the view
• Code is added to PhotoListView.js
/**	
* called when user pulls down on list	
*	
* @param {Object} _event	
*/	
function refreshData(_event) {	
	 $.loadImages(function() {	
	 	 _event.hide();	
	 });	
}
Capturing Click Events in
ListView
• Create a new controller/view/style set named PhotoDetail
Capturing Click Events in
ListView - Updating ListView
• Add an eventListener to the listView for an onClick
event in PhotoListView.xml
• REMEMBER Events bubble so we only need to
listen on the whole view and not each item in the list
<ListView id="listView" onItemclick="listItemClicked">
Capturing Click Events in ListView
- Updating ListView Controller
• Create new function to respond to onClick event in
PhotoListView.js
• When the event is passed to the function we have
information on the item that was clicked, we use
that to setup the display in details view
PhotoDetail.xml
• Once we have the details, we will create a new
controller and pass it the information to display
Capturing Click Events in ListView
- Updating ListView Controller
function listItemClicked(_event) {	
!
	 var currentItem = $.listViewSection.getItemAt(_event.itemIndex);	
	 var selectedObject = currentItem.properties.photoObject;	
!
	 // log for debugging purposes and convert object to	
	 // string that is readable	
	 console.log("selectedObject " + JSON.stringify(selectedObject, null, 2));	
!
	 // create the new controller and pass in the	
	 // model object as an argument 'item'	
	 var ctrl = Alloy.createController('PhotoDetail', {	
	 	 'item' : selectedObject	
	 });	
!
	 setTimeout(function() {	
	 	 $.photoListTab.open(ctrl.detailWindow);	
	 }, 200);	
}
PhotoDetail View - Layout of
UI Element Values
<Alloy>	
	 <Window class="container" id="detailWindow">	
	 	 <ActionBar displayHomeAsUp="true"	
	 	 onHomeIconItemSelected="closeWindow"	
	 	 platform="android"/>	
	 	 <View class="wrapper">	
	 	 	 <Label id="locationInfo" onClick="showMap"></Label>	
	 	 	 <View id='imageViewWrapper'>	
	 	 	 	 <ImageView id="imageView"></ImageView>	
	 	 	 </View>	
	 	 </View>	
	 </Window>	
</Alloy>
Initializing PhotoDetail Controller
- Setting UI Element Values
// arguments from initializing the controller, arg.items	
// holds the information on the selected image	
var args = arguments[0] || {};	
!
// set the image view to the proper URL	
$.imageView.image = args.item.urls.medium_500 || args.item.urls.hd;	
!
// location information	
$.locationInfo.text = args.item.custom_fields.location_address;	
!
// free the model-view data binding resources when this	
// view-controller closes	
$.detailWindow.addEventListener("close", function() {	
	 $.destroy();	
});
Sample Codehttps://github.com/aaronksaunders/testInClass
aaron@clearlyinnovative.com
@aaronksaunders
github:aaronksaunders

More Related Content

What's hot

Railsconf 2017 - React & React Native a common codebase across native and web
Railsconf 2017 - React & React Native a common codebase across native and webRailsconf 2017 - React & React Native a common codebase across native and web
Railsconf 2017 - React & React Native a common codebase across native and webtalkingquickly
 
Angular presentation
Angular presentationAngular presentation
Angular presentationmerlihan
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjsErhwen Kuo
 
A To-do Web App on Google App Engine
A To-do Web App on Google App EngineA To-do Web App on Google App Engine
A To-do Web App on Google App EngineMichael Parker
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear
 
Angular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4UAngular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4Usharsen
 
Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsAleksandar Bozinovski
 
Session 3 android study jam
Session 3 android study jamSession 3 android study jam
Session 3 android study jamAtharvKarbhari
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIWinston Teo
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesGaston Cruz
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubsomberfan2012
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubsomberfan2012
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubsuccessfuloutdo12
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubclammyhysteria698
 

What's hot (20)

Railsconf 2017 - React & React Native a common codebase across native and web
Railsconf 2017 - React & React Native a common codebase across native and webRailsconf 2017 - React & React Native a common codebase across native and web
Railsconf 2017 - React & React Native a common codebase across native and web
 
Understanding AJAX
Understanding AJAXUnderstanding AJAX
Understanding AJAX
 
Angular presentation
Angular presentationAngular presentation
Angular presentation
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
 
A To-do Web App on Google App Engine
A To-do Web App on Google App EngineA To-do Web App on Google App Engine
A To-do Web App on Google App Engine
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
AngularJS
AngularJSAngularJS
AngularJS
 
Appear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.jsAppear IQ - Tutorials Backbone.js
Appear IQ - Tutorials Backbone.js
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
 
Angular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4UAngular data binding by Soft Solutions4U
Angular data binding by Soft Solutions4U
 
Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure Functions
 
Angular js
Angular jsAngular js
Angular js
 
Session 3 android study jam
Session 3 android study jamSession 3 android study jam
Session 3 android study jam
 
React vs-angular-mobile
React vs-angular-mobileReact vs-angular-mobile
React vs-angular-mobile
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization API
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHub
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHub
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHub
 
idlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHubidlesign/django-sitecats · GitHub
idlesign/django-sitecats · GitHub
 

Similar to Getting Started with Appcelerator Alloy - Cross Platform Mobile Development - Howard class day-13

Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaLXMetaL
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSMin Ming Lo
 
Desbravando Web Components
Desbravando Web ComponentsDesbravando Web Components
Desbravando Web ComponentsMateus Ortiz
 
OSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler ParcelOSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler ParcelTed Leung
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13Alfresco Software
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudRoger Brinkley
 
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2Paras Mendiratta
 
Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)Oro Inc.
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlIlia Idakiev
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rulesSrijan Technologies
 
MobileCity:Core Data
MobileCity:Core DataMobileCity:Core Data
MobileCity:Core DataAllan Davis
 
Peggy angular 2 in meteor
Peggy   angular 2 in meteorPeggy   angular 2 in meteor
Peggy angular 2 in meteorLearningTech
 
Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJsTudor Barbu
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJSRajthilakMCA
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6William Marques
 

Similar to Getting Started with Appcelerator Alloy - Cross Platform Mobile Development - Howard class day-13 (20)

Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaL
 
Javascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JSJavascript Application Architecture with Backbone.JS
Javascript Application Architecture with Backbone.JS
 
Desbravando Web Components
Desbravando Web ComponentsDesbravando Web Components
Desbravando Web Components
 
OSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler ParcelOSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler Parcel
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile Cloud
 
Angular JS2 Training Session #2
Angular JS2 Training Session #2Angular JS2 Training Session #2
Angular JS2 Training Session #2
 
Lightning Components Workshop
Lightning Components WorkshopLightning Components Workshop
Lightning Components Workshop
 
Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)Adding custom ui controls to your application (1)
Adding custom ui controls to your application (1)
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
Modern android development
Modern android developmentModern android development
Modern android development
 
React js
React jsReact js
React js
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
MobileCity:Core Data
MobileCity:Core DataMobileCity:Core Data
MobileCity:Core Data
 
Peggy angular 2 in meteor
Peggy   angular 2 in meteorPeggy   angular 2 in meteor
Peggy angular 2 in meteor
 
Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJs
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 

More from Aaron Saunders

Mobile Application Workshop - So You Want To Build a Mobile App?
Mobile Application Workshop - So You Want To Build a Mobile App?Mobile Application Workshop - So You Want To Build a Mobile App?
Mobile Application Workshop - So You Want To Build a Mobile App?Aaron Saunders
 
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part OneAppcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part OneAaron Saunders
 
Identify & Unlock Your Mobile Strategy
Identify & Unlock Your Mobile StrategyIdentify & Unlock Your Mobile Strategy
Identify & Unlock Your Mobile StrategyAaron Saunders
 
SubAid User Guide - Overview
SubAid User Guide - OverviewSubAid User Guide - Overview
SubAid User Guide - OverviewAaron Saunders
 
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...Aaron Saunders
 
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013Aaron Saunders
 
Quick Way to work with Models and Alloy in Appcelerator Titanium
Quick Way to work with Models and Alloy in Appcelerator TitaniumQuick Way to work with Models and Alloy in Appcelerator Titanium
Quick Way to work with Models and Alloy in Appcelerator TitaniumAaron Saunders
 
Simple Unit Testing in Appcelerator Titanium Alloy
Simple Unit Testing in Appcelerator Titanium AlloySimple Unit Testing in Appcelerator Titanium Alloy
Simple Unit Testing in Appcelerator Titanium AlloyAaron Saunders
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013Aaron Saunders
 
modeveast 2012 Appcelerator Alloy & Cloud Services Presentation
modeveast 2012 Appcelerator Alloy & Cloud Services Presentationmodeveast 2012 Appcelerator Alloy & Cloud Services Presentation
modeveast 2012 Appcelerator Alloy & Cloud Services PresentationAaron Saunders
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumAaron Saunders
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App DemonstrationAaron Saunders
 
Clearly Innovative Inc Capabilities
Clearly Innovative Inc CapabilitiesClearly Innovative Inc Capabilities
Clearly Innovative Inc CapabilitiesAaron Saunders
 
PaaS + Appcelerator = WIN
PaaS + Appcelerator = WINPaaS + Appcelerator = WIN
PaaS + Appcelerator = WINAaron Saunders
 
StackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneStackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneAaron Saunders
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 

More from Aaron Saunders (16)

Mobile Application Workshop - So You Want To Build a Mobile App?
Mobile Application Workshop - So You Want To Build a Mobile App?Mobile Application Workshop - So You Want To Build a Mobile App?
Mobile Application Workshop - So You Want To Build a Mobile App?
 
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part OneAppcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
 
Identify & Unlock Your Mobile Strategy
Identify & Unlock Your Mobile StrategyIdentify & Unlock Your Mobile Strategy
Identify & Unlock Your Mobile Strategy
 
SubAid User Guide - Overview
SubAid User Guide - OverviewSubAid User Guide - Overview
SubAid User Guide - Overview
 
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...
DC Health Link New Mobile App 1.0 Brings Health Insurance Resources to Consum...
 
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
 
Quick Way to work with Models and Alloy in Appcelerator Titanium
Quick Way to work with Models and Alloy in Appcelerator TitaniumQuick Way to work with Models and Alloy in Appcelerator Titanium
Quick Way to work with Models and Alloy in Appcelerator Titanium
 
Simple Unit Testing in Appcelerator Titanium Alloy
Simple Unit Testing in Appcelerator Titanium AlloySimple Unit Testing in Appcelerator Titanium Alloy
Simple Unit Testing in Appcelerator Titanium Alloy
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
 
modeveast 2012 Appcelerator Alloy & Cloud Services Presentation
modeveast 2012 Appcelerator Alloy & Cloud Services Presentationmodeveast 2012 Appcelerator Alloy & Cloud Services Presentation
modeveast 2012 Appcelerator Alloy & Cloud Services Presentation
 
Introduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator TitaniumIntroduction to Module Development with Appcelerator Titanium
Introduction to Module Development with Appcelerator Titanium
 
Alloy Simple App Demonstration
Alloy Simple App DemonstrationAlloy Simple App Demonstration
Alloy Simple App Demonstration
 
Clearly Innovative Inc Capabilities
Clearly Innovative Inc CapabilitiesClearly Innovative Inc Capabilities
Clearly Innovative Inc Capabilities
 
PaaS + Appcelerator = WIN
PaaS + Appcelerator = WINPaaS + Appcelerator = WIN
PaaS + Appcelerator = WIN
 
StackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part OneStackMob & Appcelerator Module Part One
StackMob & Appcelerator Module Part One
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Getting Started with Appcelerator Alloy - Cross Platform Mobile Development - Howard class day-13

  • 1. SYCS 402 Mobile App Development Day 13 - 3/12/2015
  • 2. Housekeeping • Camera/Image View Assignment is DUE TODAY • Wireframes or some sort of flow document is due Thursday, if your diagram is not self-explanatory please provide additional documentation with the wireframes - DUE TODAY • Final project overview document due Thursday after break • Wires, project feature, project overview • please include team members name on document
  • 3. Today • Review “require” for including controllers and external libraries • Review Titanium ListViews/Templates • Integrating Promises with Appcelerator Alloy • Geo Location & Reverse GeoLocation • Opening new controller and passing data - IOS, will post sample code for Android • See: https://github.com/aaronksaunders/scs-backbonetest1
  • 4. Including w/Require • The “src” identifies where the controller and view are, and the id is how the item is accessed in the parent controller
  • 5. Accessing functions in child controller (PhotoListView.js) • use the identifier, so in this example it is “$.photoListView” which would call functions using this format ! // in the parent controller $.photoListView.functionInOtherController(); ! // code in the child controller $.functionInOtherController = function() { // DO SOMETHING AMAZING }
  • 7. Adding the data to the ListView
  • 8. Adding the data to the ListView • Loop through the array of objects adding them to the template • The template has “bindId”s that are mapped to the properties of the data objects • The last step is to add the item to the specific section of the ListView
  • 9. Using gittio for Appcelerator Modules - Pull to Refresh • Install the javascript gittio module on your computer npm  install  -­‐g  gittio • Got to project directory in the terminal and install the module in your project gittio  install  nl.fokkezb.pullToRefresh   • This will install the module in the project for you, then follow instructions for using it http://gitt.io/component/nl.fokkezb.pullToRefresh
  • 10. Add Widget to view.xml file - Pull to Refresh • Wrap your ListView with the widget object and specify the function to call to update the view !
  • 11. Add code to controller.js file - Pull to Refresh • Add the function refreshData to your controller to update the data in the view • Code is added to PhotoListView.js /** * called when user pulls down on list * * @param {Object} _event */ function refreshData(_event) { $.loadImages(function() { _event.hide(); }); }
  • 12. Capturing Click Events in ListView • Create a new controller/view/style set named PhotoDetail
  • 13. Capturing Click Events in ListView - Updating ListView • Add an eventListener to the listView for an onClick event in PhotoListView.xml • REMEMBER Events bubble so we only need to listen on the whole view and not each item in the list <ListView id="listView" onItemclick="listItemClicked">
  • 14. Capturing Click Events in ListView - Updating ListView Controller • Create new function to respond to onClick event in PhotoListView.js • When the event is passed to the function we have information on the item that was clicked, we use that to setup the display in details view PhotoDetail.xml • Once we have the details, we will create a new controller and pass it the information to display
  • 15. Capturing Click Events in ListView - Updating ListView Controller function listItemClicked(_event) { ! var currentItem = $.listViewSection.getItemAt(_event.itemIndex); var selectedObject = currentItem.properties.photoObject; ! // log for debugging purposes and convert object to // string that is readable console.log("selectedObject " + JSON.stringify(selectedObject, null, 2)); ! // create the new controller and pass in the // model object as an argument 'item' var ctrl = Alloy.createController('PhotoDetail', { 'item' : selectedObject }); ! setTimeout(function() { $.photoListTab.open(ctrl.detailWindow); }, 200); }
  • 16. PhotoDetail View - Layout of UI Element Values <Alloy> <Window class="container" id="detailWindow"> <ActionBar displayHomeAsUp="true" onHomeIconItemSelected="closeWindow" platform="android"/> <View class="wrapper"> <Label id="locationInfo" onClick="showMap"></Label> <View id='imageViewWrapper'> <ImageView id="imageView"></ImageView> </View> </View> </Window> </Alloy>
  • 17. Initializing PhotoDetail Controller - Setting UI Element Values // arguments from initializing the controller, arg.items // holds the information on the selected image var args = arguments[0] || {}; ! // set the image view to the proper URL $.imageView.image = args.item.urls.medium_500 || args.item.urls.hd; ! // location information $.locationInfo.text = args.item.custom_fields.location_address; ! // free the model-view data binding resources when this // view-controller closes $.detailWindow.addEventListener("close", function() { $.destroy(); });