SlideShare uma empresa Scribd logo
1 de 17
Cross-Platform Mobile Apps
& Drupal Web Services
TiConf Mobile Developers Conference 2013

Presented by LTC Bob Sims
CIS Branch Head, Training Support Division

www.jftc.nato.int                   NATO UNCLASSIFIED
About Me

Bob Sims
US Army
Information Systems Manager

•   Lots of living and working abroad, currently
    Bydgoszcz, Poland
•   Connecting people through systems
•   Not terribly bright, just likes problem solving

bob.sims@gmail.com
@2wheelsburning
bobsims.tumblr.com
github.com/bob-sims

Disclaimer:
Mentions in this brief != Endorsements

                                           NATO UNCLASSIFIED
About the JFTC Facility




       www.jftc.nato.int


        NATO UNCLASSIFIED
About Our Mission




     NATO UNCLASSIFIED
Why Mobile Matters




U.S. Army photo by Capt. Thomas Cieslak/Task Force 1-82 PAO   NATO UNCLASSIFIED
Which Problem Space?




     http://events.jftc.nato.int
          NATO UNCLASSIFIED
Why Drupal?

• Manage data + content
• Users, registration,
  permissions, roles
• Flexible themes, content
  types, views, search, more
• Readily publish data
• Vast module repository and
  open-source community
• Enterprise-ready



                                            Source: Josh Schroeder
                        NATO UNCLASSIFIED    http://jdschroeder.ca
Use Case: Collect Dynamic Data

                  How to change data structure (content
                  type) on Drupal web app without
                  breaking native mobile app?
                        –   New allowed field values (pickers)?
                        –   Add/remove new fields?
                        –   X-platform + native app
                  Ingredients:
                  • Drupal 6 backend
                        –   Services + REST server module
                        –   Views + CCK modules
                  •    Custom node form Drupal module
                        https://gist.github.com/bob-sims/4094461
                  •    Code from “Forging Titanium Episode
                       10: Forms” http://is.gd/dPGqBG
                  •    Custom Drupal Services CommonJS
                       library https://gist.github.com/bob-sims/1966524
                  •    Titanium 3.x + Alloy (w/some cheating!)
            NATO UNCLASSIFIED
Secret Sauce
Hard Part: building node object in Drupal node-friendly format

        {"title": "Attend TiConf",
                 "type":"todo",
                 "body": "Prepare presentation",
                 "field_status":[{"value":2}], //cck text field
                 "field_category":[{"value":"Travel"}, //cck text field
                           {"value":"Work"}] }         // multiple selects


Easy Part: posting node object with Titanium API to Drupal Services endpoint

       exports.createNode = function(node, url) {
                  var xhr = Titanium.Network.createHTTPClient();
                  xhr.open('POST', url);
                  xhr.onload = function(e) { /* passback awesome here */ }
                  xhr.setRequestHeader('Content-Type','application/json; charset=utf-
            8');
                  var obj = (node);
                  xhr.send(JSON.stringify(obj));
            };
                                   NATO UNCLASSIFIED
User Authentication
Tip: wait for login success response before creating content, don't send CRUD
action before xhr.onload() fires.

        exports.userLogin = function(url, opts) {
                 var xhr = Titanium.Network.createHTTPClient();
                 url = url + 'user/login.json'; // Services endpoint
                 xhr.open('POST', url);
                 xhr.setRequestHeader('Content-Type','application/json; charset=utf-
            8');

                 xhr.send({"username":opts.username,"password":opts.password});
                 xhr.onload = function() {
                                    var jsonObject = JSON.parse(this.responseText);
                                    opts.success && opts.success(jsonObject);
                          };
                 xhr.onerror = function(e) {
                          opts.error && opts.error({
                                    "status":xhr.status,
                                    "statusText":xhr.statusText
                          });
                 };
                                   NATO UNCLASSIFIED
Use Case: Event Statistics

            How to provide executive leadership
            real-time “business intelligence”?
                  – Limited authenticated roles?
                  – Dynamic graphing of collated data?
                  – X-platform + native app


            Ingredients:
            • Drupal 6 backend
                  – Services + REST Server module
                  – Custom statistics Drupal module
            • RGraph.js charting library
                  – Sample code: http://is.gd/qtVOTS
                  – HTML5 Canvas element
            • Titanium 3.x + Alloy (no cheating!)
                  Custom backbone.js sync adapter

         NATO UNCLASSIFIED
Secret Sauce
Passing dynamic data from Alloy controller to webview

   detail.xml:

         <WebView id="webcharts" url="/html/charts.htm" onLoad="drawCharts"/>


   detail.js:

         // build JSON data object to populate your webview chart
         var chartData = {"canvas":"signupPie",
                                     "title":"Signups",
                                     "data":dataArray,
                                     "labels":labelArray,
                                     "colors":colorArray
                            };

         function drawCharts(e) {
                  $.webcharts.evalJS('drawChart(' + JSON.stringify(chartData) + ')');
                  }

                                    NATO UNCLASSIFIED
Prior Art

Titanium + Drupal Integration
• Drupanium: integrated Drupal distro + sample TiMobile app
• Tyler Frankenstein blog post + examples
    –   Drupal 7 Services + Phonegap + JQuery Mobile
•   Josh Schroeder "App-ify Drupal Titanium Project"
    –   Drupal Camp Alberta 2010 presentation
•   Sumit Kataria civicactions.com

Drupal Services
• post.node create using custom fields (drupal.org)
• IBM Developer Works: Create custom web services project in Drupal 7

Dynamic Graphing with WebViews
• Tim Poulsen – jqPlot x-platform WebView graphing demo
• Aaron Saunders – Titanium Appcelerator Quickie: Google Charts and Appcelerator

                                           NATO UNCLASSIFIED
Pirate Hunter
  Title
  • Dynamic real-world piracy data
          –   Sharepoint-hosted XML to JSON via YQL
          –   Updated daily
  •     NATO Shipping Centre (NSC)
          –   Northwood, UK
          –   www.shipping.nato.int
  •     Case study of "decoupled", informal
        collaboration




      NATO UNCLASSIFIED
Lessons Learned

• Alloy (+ backbone.js) is a "must-learn" for rapid, x-
  platform, data-driven Titanium apps
• underscore.js eases burden of parsing complex JSON
  data returns
• Rendering complex forms or workflows: integrated
  WebViews vs. native UI objects?
• Drupal + Titanium platforms = compelling web/mobile
  solution for organizations




                        NATO UNCLASSIFIED
Credits/Resources

• Aaron Saunders – if he hasn't
  already posted a solution to your
  problem, one doesn't exist
• Raul Riera – Super awesome
  HTTP client for Appcelerator
  Titanium (includes taffydb.js
  caching)
• Grzegorz Bartman – Drupal +
  mobile app ninja in Wroclaw,
  Poland.




                                                   Photo by Justin Pepus
                               NATO UNCLASSIFIED
Conclusion




Photo by Staff Sgt. James Selesnick     NATO UNCLASSIFIED

Mais conteúdo relacionado

Mais procurados

Java overview the piramide of success
Java overview the piramide of successJava overview the piramide of success
Java overview the piramide of successArtem Bilan
 
A quick review of Python and Graph Databases
A quick review of Python and Graph DatabasesA quick review of Python and Graph Databases
A quick review of Python and Graph DatabasesNicholas Crouch
 
The power of datomic
The power of datomicThe power of datomic
The power of datomicKonrad Szydlo
 
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...FIWARE
 
Riak from Small to Large
Riak from Small to LargeRiak from Small to Large
Riak from Small to LargeRusty Klophaus
 
MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers ProgramFIWARE
 
N hidden gems in hippo forge and experience plugins (dec17)
N hidden gems in hippo forge and experience plugins (dec17)N hidden gems in hippo forge and experience plugins (dec17)
N hidden gems in hippo forge and experience plugins (dec17)Woonsan Ko
 
Appli légère avec d3.js, sinatra, elasticsearch et capucine
Appli légère avec d3.js, sinatra, elasticsearch et capucineAppli légère avec d3.js, sinatra, elasticsearch et capucine
Appli légère avec d3.js, sinatra, elasticsearch et capucineyann ARMAND
 
SWAT4LS Wikidata tutorial cambridge dec 2015
SWAT4LS Wikidata tutorial cambridge dec 2015SWAT4LS Wikidata tutorial cambridge dec 2015
SWAT4LS Wikidata tutorial cambridge dec 2015Sebastian Burgstaller
 
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015 Neo4j + Tableau Visual Analytics - GraphConnect SF 2015
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015 Neo4j
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
 
Objective-C Is Not Java
Objective-C Is Not JavaObjective-C Is Not Java
Objective-C Is Not JavaChris Adamson
 
Introduction to Globus: Research Data Management Software at the ALCF
Introduction to Globus: Research Data Management Software at the ALCFIntroduction to Globus: Research Data Management Software at the ALCF
Introduction to Globus: Research Data Management Software at the ALCFGlobus
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramFIWARE
 
High Performance Applications with MongoDB
High Performance Applications with MongoDBHigh Performance Applications with MongoDB
High Performance Applications with MongoDBMongoDB
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBWilliam Candillon
 
N hidden gems in forge (as of may '17)
N hidden gems in forge (as of may '17)N hidden gems in forge (as of may '17)
N hidden gems in forge (as of may '17)Woonsan Ko
 
Neo4j Fundamentals
Neo4j FundamentalsNeo4j Fundamentals
Neo4j FundamentalsMax De Marzi
 

Mais procurados (20)

Java overview the piramide of success
Java overview the piramide of successJava overview the piramide of success
Java overview the piramide of success
 
A quick review of Python and Graph Databases
A quick review of Python and Graph DatabasesA quick review of Python and Graph Databases
A quick review of Python and Graph Databases
 
The power of datomic
The power of datomicThe power of datomic
The power of datomic
 
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
Session 7 - Connecting to Legacy Systems, IoT and other Systems | Train the T...
 
Riak from Small to Large
Riak from Small to LargeRiak from Small to Large
Riak from Small to Large
 
MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business Insights
 
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 -  NGSI-LD Advanced Operations | Train the Trainers ProgramSession 5 -  NGSI-LD Advanced Operations | Train the Trainers Program
Session 5 - NGSI-LD Advanced Operations | Train the Trainers Program
 
N hidden gems in hippo forge and experience plugins (dec17)
N hidden gems in hippo forge and experience plugins (dec17)N hidden gems in hippo forge and experience plugins (dec17)
N hidden gems in hippo forge and experience plugins (dec17)
 
Appli légère avec d3.js, sinatra, elasticsearch et capucine
Appli légère avec d3.js, sinatra, elasticsearch et capucineAppli légère avec d3.js, sinatra, elasticsearch et capucine
Appli légère avec d3.js, sinatra, elasticsearch et capucine
 
SWAT4LS Wikidata tutorial cambridge dec 2015
SWAT4LS Wikidata tutorial cambridge dec 2015SWAT4LS Wikidata tutorial cambridge dec 2015
SWAT4LS Wikidata tutorial cambridge dec 2015
 
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015 Neo4j + Tableau Visual Analytics - GraphConnect SF 2015
Neo4j + Tableau Visual Analytics - GraphConnect SF 2015
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
Objective-C Is Not Java
Objective-C Is Not JavaObjective-C Is Not Java
Objective-C Is Not Java
 
Introduction to Globus: Research Data Management Software at the ALCF
Introduction to Globus: Research Data Management Software at the ALCFIntroduction to Globus: Research Data Management Software at the ALCF
Introduction to Globus: Research Data Management Software at the ALCF
 
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers ProgramSession 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
Session 2 - NGSI-LD primer & Smart Data Models | Train the Trainers Program
 
High Performance Applications with MongoDB
High Performance Applications with MongoDBHigh Performance Applications with MongoDB
High Performance Applications with MongoDB
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDB
 
N hidden gems in forge (as of may '17)
N hidden gems in forge (as of may '17)N hidden gems in forge (as of may '17)
N hidden gems in forge (as of may '17)
 
Neo4j Fundamentals
Neo4j FundamentalsNeo4j Fundamentals
Neo4j Fundamentals
 
Lokijs
LokijsLokijs
Lokijs
 

Semelhante a Cross-Platform Mobile Apps & Drupal Web Services

Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responsesdarrelmiller71
 
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasBerlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasMapR Technologies
 
Web_of_Things_2013
Web_of_Things_2013Web_of_Things_2013
Web_of_Things_2013Max Kleiner
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DayTechMaster Vietnam
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupRafal Kwasny
 
Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Radek Simko
 
Jump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksJump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksDatabricks
 
Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetesSamuel Terburg
 
Big data, just an introduction to Hadoop and Scripting Languages
Big data, just an introduction to Hadoop and Scripting LanguagesBig data, just an introduction to Hadoop and Scripting Languages
Big data, just an introduction to Hadoop and Scripting LanguagesCorley S.r.l.
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Docker, Inc.
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioiguazio
 
Sf big analytics_2018_04_18: Evolution of the GoPro's data platform
Sf big analytics_2018_04_18: Evolution of the GoPro's data platformSf big analytics_2018_04_18: Evolution of the GoPro's data platform
Sf big analytics_2018_04_18: Evolution of the GoPro's data platformChester Chen
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldChristian Melchior
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersBurr Sutter
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBDenny Lee
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hourshanhvi
 

Semelhante a Cross-Platform Mobile Apps & Drupal Web Services (20)

Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasBerlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
 
Web_of_Things_2013
Web_of_Things_2013Web_of_Things_2013
Web_of_Things_2013
 
Web Ninja
Web NinjaWeb Ninja
Web Ninja
 
Social Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech DaySocial Photos - My presentation at Microsoft Tech Day
Social Photos - My presentation at Microsoft Tech Day
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetup
 
Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)Building infrastructure with Terraform (Google)
Building infrastructure with Terraform (Google)
 
Jump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on DatabricksJump Start with Apache Spark 2.0 on Databricks
Jump Start with Apache Spark 2.0 on Databricks
 
Open shift enterprise 3.1 paas on kubernetes
Open shift enterprise 3.1   paas on kubernetesOpen shift enterprise 3.1   paas on kubernetes
Open shift enterprise 3.1 paas on kubernetes
 
Big data, just an introduction to Hadoop and Scripting Languages
Big data, just an introduction to Hadoop and Scripting LanguagesBig data, just an introduction to Hadoop and Scripting Languages
Big data, just an introduction to Hadoop and Scripting Languages
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
 
Running High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclioRunning High-Speed Serverless with nuclio
Running High-Speed Serverless with nuclio
 
Sf big analytics_2018_04_18: Evolution of the GoPro's data platform
Sf big analytics_2018_04_18: Evolution of the GoPro's data platformSf big analytics_2018_04_18: Evolution of the GoPro's data platform
Sf big analytics_2018_04_18: Evolution of the GoPro's data platform
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java Developers
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hours
 

Último

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Cross-Platform Mobile Apps & Drupal Web Services

  • 1. Cross-Platform Mobile Apps & Drupal Web Services TiConf Mobile Developers Conference 2013 Presented by LTC Bob Sims CIS Branch Head, Training Support Division www.jftc.nato.int NATO UNCLASSIFIED
  • 2. About Me Bob Sims US Army Information Systems Manager • Lots of living and working abroad, currently Bydgoszcz, Poland • Connecting people through systems • Not terribly bright, just likes problem solving bob.sims@gmail.com @2wheelsburning bobsims.tumblr.com github.com/bob-sims Disclaimer: Mentions in this brief != Endorsements NATO UNCLASSIFIED
  • 3. About the JFTC Facility www.jftc.nato.int NATO UNCLASSIFIED
  • 4. About Our Mission NATO UNCLASSIFIED
  • 5. Why Mobile Matters U.S. Army photo by Capt. Thomas Cieslak/Task Force 1-82 PAO NATO UNCLASSIFIED
  • 6. Which Problem Space? http://events.jftc.nato.int NATO UNCLASSIFIED
  • 7. Why Drupal? • Manage data + content • Users, registration, permissions, roles • Flexible themes, content types, views, search, more • Readily publish data • Vast module repository and open-source community • Enterprise-ready Source: Josh Schroeder NATO UNCLASSIFIED http://jdschroeder.ca
  • 8. Use Case: Collect Dynamic Data How to change data structure (content type) on Drupal web app without breaking native mobile app? – New allowed field values (pickers)? – Add/remove new fields? – X-platform + native app Ingredients: • Drupal 6 backend – Services + REST server module – Views + CCK modules • Custom node form Drupal module https://gist.github.com/bob-sims/4094461 • Code from “Forging Titanium Episode 10: Forms” http://is.gd/dPGqBG • Custom Drupal Services CommonJS library https://gist.github.com/bob-sims/1966524 • Titanium 3.x + Alloy (w/some cheating!) NATO UNCLASSIFIED
  • 9. Secret Sauce Hard Part: building node object in Drupal node-friendly format {"title": "Attend TiConf", "type":"todo", "body": "Prepare presentation", "field_status":[{"value":2}], //cck text field "field_category":[{"value":"Travel"}, //cck text field {"value":"Work"}] } // multiple selects Easy Part: posting node object with Titanium API to Drupal Services endpoint exports.createNode = function(node, url) { var xhr = Titanium.Network.createHTTPClient(); xhr.open('POST', url); xhr.onload = function(e) { /* passback awesome here */ } xhr.setRequestHeader('Content-Type','application/json; charset=utf- 8'); var obj = (node); xhr.send(JSON.stringify(obj)); }; NATO UNCLASSIFIED
  • 10. User Authentication Tip: wait for login success response before creating content, don't send CRUD action before xhr.onload() fires. exports.userLogin = function(url, opts) { var xhr = Titanium.Network.createHTTPClient(); url = url + 'user/login.json'; // Services endpoint xhr.open('POST', url); xhr.setRequestHeader('Content-Type','application/json; charset=utf- 8'); xhr.send({"username":opts.username,"password":opts.password}); xhr.onload = function() { var jsonObject = JSON.parse(this.responseText); opts.success && opts.success(jsonObject); }; xhr.onerror = function(e) { opts.error && opts.error({ "status":xhr.status, "statusText":xhr.statusText }); }; NATO UNCLASSIFIED
  • 11. Use Case: Event Statistics How to provide executive leadership real-time “business intelligence”? – Limited authenticated roles? – Dynamic graphing of collated data? – X-platform + native app Ingredients: • Drupal 6 backend – Services + REST Server module – Custom statistics Drupal module • RGraph.js charting library – Sample code: http://is.gd/qtVOTS – HTML5 Canvas element • Titanium 3.x + Alloy (no cheating!) Custom backbone.js sync adapter NATO UNCLASSIFIED
  • 12. Secret Sauce Passing dynamic data from Alloy controller to webview detail.xml: <WebView id="webcharts" url="/html/charts.htm" onLoad="drawCharts"/> detail.js: // build JSON data object to populate your webview chart var chartData = {"canvas":"signupPie", "title":"Signups", "data":dataArray, "labels":labelArray, "colors":colorArray }; function drawCharts(e) { $.webcharts.evalJS('drawChart(' + JSON.stringify(chartData) + ')'); } NATO UNCLASSIFIED
  • 13. Prior Art Titanium + Drupal Integration • Drupanium: integrated Drupal distro + sample TiMobile app • Tyler Frankenstein blog post + examples – Drupal 7 Services + Phonegap + JQuery Mobile • Josh Schroeder "App-ify Drupal Titanium Project" – Drupal Camp Alberta 2010 presentation • Sumit Kataria civicactions.com Drupal Services • post.node create using custom fields (drupal.org) • IBM Developer Works: Create custom web services project in Drupal 7 Dynamic Graphing with WebViews • Tim Poulsen – jqPlot x-platform WebView graphing demo • Aaron Saunders – Titanium Appcelerator Quickie: Google Charts and Appcelerator NATO UNCLASSIFIED
  • 14. Pirate Hunter Title • Dynamic real-world piracy data – Sharepoint-hosted XML to JSON via YQL – Updated daily • NATO Shipping Centre (NSC) – Northwood, UK – www.shipping.nato.int • Case study of "decoupled", informal collaboration NATO UNCLASSIFIED
  • 15. Lessons Learned • Alloy (+ backbone.js) is a "must-learn" for rapid, x- platform, data-driven Titanium apps • underscore.js eases burden of parsing complex JSON data returns • Rendering complex forms or workflows: integrated WebViews vs. native UI objects? • Drupal + Titanium platforms = compelling web/mobile solution for organizations NATO UNCLASSIFIED
  • 16. Credits/Resources • Aaron Saunders – if he hasn't already posted a solution to your problem, one doesn't exist • Raul Riera – Super awesome HTTP client for Appcelerator Titanium (includes taffydb.js caching) • Grzegorz Bartman – Drupal + mobile app ninja in Wroclaw, Poland. Photo by Justin Pepus NATO UNCLASSIFIED
  • 17. Conclusion Photo by Staff Sgt. James Selesnick NATO UNCLASSIFIED