SlideShare a Scribd company logo
How to build integrated, professional enterprise-grade cross-platform mobile apps 
Build a simple enterprise mobility application with data sync using AngularJS, Backbone or Sencha Touch 
using our simple step by step tutorials. 
Our tutorials demonstrate how to develop a basic “train times” viewing 
application using the AppearIQ API. This includes generation of a boilerplate 
HTML5 hybrid cross-platform app (capable of running on either iOS or 
Android devices), introduction to data formats, application logic, how to 
synchronize data, testing in browsers and on devices. 
The tutorials assume that you already have basic knowledge of HTML and JavaScript. If you feel that you 
need to go through the basics, check out some excellent external tutorials like W3Schools HTML tutorials 
or W3Schools Javascript tutorials. 
Use of the AppearIQ cloud developer platform is free of charge. To access the tutorials click here (links to 
AppearIQ.com developer site). 
The tutorial examples provided here are shared with the Slideshare audience. Readers are encouraged to visit 
www.appeariq.com for access to the full AppearIQ documentation and to review more up to date tutorials (including any 
modifications to this one) as they become available. 
Develop Your First App 
Introduction 
In this tutorial, you will learn how to develop a basic single view AIQ application using the AIQ API. This application will 
display a simple read-only list of trains using the AIQ DataSync module. Remember to consult the API documentation in 
case you get lost or you are not sure what the API being used does. 
This tutorial assumes that you already have basic knowledge of HTML and JavaScript. If you feel that you need to go 
through the basics, don't hesitate to read external tutorials like this and this. 
If you need to see the final application source code at any point, it's available on Github in the Mobile samples repository. 
Just follow the Getting Started guide to deploy it to your device. 
Generate Boilerplate App 
Navigate to a folder in which you want to have your AIQ applications and execute the aiq generate command: 
$ aiq generate -n hello-world
This will create a new folder called hello-world and will put the app content inside this folder. 
Your folder structure will look like this: 
Note: The API implementation stored in the aiq folder is only for testing purposes in order to use it in the local 
web browser and will be replaced by the proper implementation when your application is deployed to a device. 
Keeping this folder in your application structure is not obligatory, though we strongly encourage you to use it and 
test your applications in browser before publishing them to device. 
Note: In this tutorial we skip editing the stylesheet. If you want to know the details on how to apply css styles to the 
application, go to this page. 
Entry Point 
Just like the regular web browser, AIQ client launches the index.html file which comes with the application. This file takes 
responsibility of loading and initializing the AIQ API. 
This is how your Hello World's index file should look like: 
<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8"> 
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, 
maximum-scale=1.0"> 
<meta name="MobileOptimized" content="320"> 
<meta name="HandheldFriendly" content="True"> 
<title>Hello world</title> 
<script type="text/javascript" src="/aiq/aiq-api.js"></script> 
<script type="text/javascript" src="/js/app.js"></script> 
<link type="text/css" rel="stylesheet" href="/css/app.css">
</head> 
<body> 
<h1>Hello world</h1> 
<div id="error"></div> 
<ul id="list"></ul> 
<script> 
document.addEventListener("aiq-ready", HW.aiqReady, false); 
</script> 
</body> 
</html> 
Let's go through the most important parts of it one by one. 
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, 
maximum-scale=1.0"> 
<meta name="MobileOptimized" content="320"> 
<meta name="HandheldFriendly" content="True"> 
Web pages display differently on desktop and mobile browsers. In order to make sure that your application is recognized 
as mobile and display all graphical elements correctly, you should use the viewport property and set it to device width. 
Unfortunately not all devices recognize this property, therefore you must use dedicated fallbacks (MobileOptimized for 
Windows based devices and HandheldFriendly for other proprietary operating systems). 
<script type="text/javascript" src="/aiq/aiq-api.js"></script> 
This declaration imports and initializes the AIQ API. The path remains the same no matter if you run the application in the 
browser or in the AIQ client. After the AIQ APIs are initialized and ready to use, aiq-ready document event is generated. 
<div id="error"></div> 
This DIV tag is a placeholder for errors which might occur while retrieving the documents, like connectivity issues or 
unresponsive backend. It will be referred to by its id, which is safe in this case because it is the only element in the 
application with this identifier. 
<ul id="list"></ul> 
This UL tag is a placeholder for the list of trains. It will be referred to by its id, which is safe in this case because it is the only 
element in the application with this identifier. 
<script> 
document.addEventListener("aiq-ready", HW.aiqReady, false); 
</script> 
AIQ API initialization is not instantaneous because it takes a bit time to initialize all of its components. In order not to 
perform any operation before the API is ready, your must subscribe to aiq-ready event generated when everything is in 
place and safe to use. The aiqReady function is defined in HW namespace in the application logic and will be described in 
the next section of this tutorial. 
Note: Placing this SCRIPT tag right before the closing BODY tag will ensure that the contained code will be 
executed only after the DOM tree is parsed and ready to be worked on.
At this point you have an empty view with a Hello World header on top. 
Data Format 
The next step is to define the data structure on which your application will base. Since this applicaiton will show a train list, 
so each document will represent a single train. Let's create adatasync.json file in mock-data folder as described here 
with the following contents: 
{ 
"documents":[ 
{ 
"_type": "TD.Train", 
"number": "9001" 
}, 
{ 
"_type": "TD.Train", 
"number": "9002" 
}, 
{ 
"_type": "TD.Train", 
"number": "9003" 
}, 
{ 
"_type": "TD.Train", 
"number": "9004" 
}, 
{ 
"_type": "TD.Train", 
"number": "9005" 
}, 
{ 
"_type": "TD.Train", 
"number": "9006" 
}, 
{ 
"_type": "TD.Train", 
"number": "9007" 
}, 
{ 
"_type": "TD.Train", 
"number": "9008" 
} 
] 
} 
The _type field is used throughout the whole AIQ system and specifies the type of the document. Document types are 
arbitrary but we encourage you to use prefixes implying an application to which these documents belong (the overall 
namespace in this example is HW. Note however that we're using TD in the data format, which stands for Train Damage. 
The reason for this is that the business data is shared between different sample applications). This reduces the possibility 
of naming conflicts. 
Application Logic 
After the AIQ API is ready to use, you can start populating the initially empty view with some data. This is the example 
app.js file which you will be using in this tutorial: 
/* global AIQ:false, HW:true */ 
var HW = HW || {}; 
(function() { 
"use strict";
HW.aiqReady = function() { 
aiq.datasync.getDocuments("TD.Train", { 
success: function(docs) { 
if (docs.length === 0) { 
this.error({ 
message: "No documents to display" 
}); 
} else { 
var fragment = document.createDocumentFragment(); 
var list = document.getElementById("list"); 
docs.forEach(function(doc) { 
var entry = document.createElement("li"); 
entry.innerHTML = doc.number; 
fragment.appendChild(entry); 
}); 
list.appendChild(fragment); 
} 
}, 
error: function(arg) { 
var error = document.getElementById("error"); 
error.innerHTML = arg.message; 
} 
}); 
}; 
}()); 
Let's try to understand what's going on in this piece of code. 
Retrieving Documents 
In order to retrieve a list of our TD.Train documents, we use getDocuments method of theData Synchronization module. 
aiq.datasync.getDocuments("TD.Train", { 
success: function(docs) { 
... 
}, 
error: function(arg) { 
... 
} 
}); 
Handling Empty List 
To simplify things, we use the error handler to display an information when the document list is empty. 
if (docs.length === 0) { 
this.error({ 
message: "No documents to display" 
}); 
} else { 
... 
} 
Note: Note that we can use "this" in this context because it will point to the object containing both "success" and 
"error" methods. 
Populating the List 
In this line, we retrieve the list element declared in the entry point. We can do this easily thanks to the id we assigned to it.
var list = document.getElementById("list"); 
Then, we need to populate the list with the names of our trains. We know that all documents of TD.Train type have a field 
called number, so we go through the available documents, create a new LI element for every train number and append 
them to our list. 
docs.forEach(function(doc) { 
var entry = document.createElement("li"); 
entry.innerHTML = doc.number; 
fragment.appendChild(entry); 
}); 
Error Proofing 
While it is not obligatory, we advise to use code quality tools like JSHint to make sure that your very liberal by default 
JavaScript code doesn't contain common and easy to overlook mistakes, like using undeclared variables. The "global" 
section 
declares static objects used in the file (their boolean values tell whether they can be changed from within the file). For a 
comprehensive list of available options, visit this page). Note that there is no space after the opening comment. 
/*global AIQ:false, HW:true */ 
Using strict modeis is another way of making the code more error proof. Some browsers implement the strict mode which 
makes the JavaScript parser much less liberal and thus making it easy to spot mistakes. If a browser doesn't support this 
mode, this declaration is treated as a regular string, not causing any problems. 
"use strict"; 
Testing in Browser 
Now your application is ready for the initial testing. The simplest is to test it in Google Chrome to start with. After having 
setup your environment following those guidelines, you should see the following view:
You can see that the list has been populated with eight trains included in the test data. 
Testing on Device 
Testing on a device is explained here. After uploading the application, launch the mobile client and click on the new Hello 
World application that appeared on the home screen. You should see the familiar view containing eight trains:
This is it. Now you have a working example on how to create a simple application and integrate it with the AIQ API. 
Conclusion 
In this tutorial you have learned how to design the business data, create an AIQ enabled application and test it in both local 
browser and on a real device. If you want to learn about more advanced functions like editing documents, using camera or 
performing direct calls, visit our Development Home.

More Related Content

What's hot

How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
shravan kumar chelika
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
Agile Testing Alliance
 
React native app with type script tutorial
React native app with type script tutorialReact native app with type script tutorial
React native app with type script tutorial
Katy Slemon
 
An R shiny demo for IDA MOOC facilitation, Developing Data Products
An R shiny demo for IDA MOOC facilitation, Developing Data ProductsAn R shiny demo for IDA MOOC facilitation, Developing Data Products
An R shiny demo for IDA MOOC facilitation, Developing Data Products
Wei Zhong Toh
 
User hook implemantation sample example
User hook implemantation  sample exampleUser hook implemantation  sample example
User hook implemantation sample example
Ashish Harbhajanka
 
Crash Course on R Shiny Package
Crash Course on R Shiny Package Crash Course on R Shiny Package
Crash Course on R Shiny Package
Rohit Dubey
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor packageShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
Sean Davis
 
Using Page Objects
Using Page ObjectsUsing Page Objects
Using Page Objects
Getch88
 
Angular js
Angular jsAngular js
Mvc by asp.net development company in india - part 2
Mvc by asp.net development company in india  - part 2Mvc by asp.net development company in india  - part 2
Mvc by asp.net development company in india - part 2
iFour Institute - Sustainable Learning
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
AdobeMarketingCloud
 
Hilt Annotations
Hilt AnnotationsHilt Annotations
Hilt Annotations
Ali Göktaş
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You Typed
Marvin Heng
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
Tarunsingh198
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
Mohammad Shaker
 
Web application development process
Web application development processWeb application development process
Web application development process
John Smith
 
Introduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in R
Paul Richards
 

What's hot (20)

How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
 
React native app with type script tutorial
React native app with type script tutorialReact native app with type script tutorial
React native app with type script tutorial
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
An R shiny demo for IDA MOOC facilitation, Developing Data Products
An R shiny demo for IDA MOOC facilitation, Developing Data ProductsAn R shiny demo for IDA MOOC facilitation, Developing Data Products
An R shiny demo for IDA MOOC facilitation, Developing Data Products
 
User hook implemantation sample example
User hook implemantation  sample exampleUser hook implemantation  sample example
User hook implemantation sample example
 
Crash Course on R Shiny Package
Crash Course on R Shiny Package Crash Course on R Shiny Package
Crash Course on R Shiny Package
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor packageShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
ShinySRAdb: an R package using shiny to wrap the SRAdb Bioconductor package
 
70562 (1)
70562 (1)70562 (1)
70562 (1)
 
Using Page Objects
Using Page ObjectsUsing Page Objects
Using Page Objects
 
Angular js
Angular jsAngular js
Angular js
 
Mvc by asp.net development company in india - part 2
Mvc by asp.net development company in india  - part 2Mvc by asp.net development company in india  - part 2
Mvc by asp.net development company in india - part 2
 
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEMBuild single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
 
Hilt Annotations
Hilt AnnotationsHilt Annotations
Hilt Annotations
 
AI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You TypedAI: Mobile Apps That Understands Your Intention When You Typed
AI: Mobile Apps That Understands Your Intention When You Typed
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Web application development process
Web application development processWeb application development process
Web application development process
 
Introduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in R
 

Similar to How to build integrated, professional enterprise-grade cross-platform mobile apps

The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
marcocasario
 
ANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 schANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 sch
kannikadg
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
mrdon
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
Skills Matter
 
Gears User Guide
Gears User GuideGears User Guide
Gears User Guide
Muthuselvam RS
 
API Integration in Web Application
API Integration in Web ApplicationAPI Integration in Web Application
API Integration in Web Application
ijtsrd
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
Sarah Maddox
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
Akhil Mittal
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPI
Eric Wise
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
ssuser65180a
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)
Katy Slemon
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api's
Ortus Solutions, Corp
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
Francesco Marchitelli
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Lookrumsan
 
Angular js
Angular jsAngular js
Angular js
prasaddammalapati
 
Apache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social GadgetsApache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social Gadgets
Tyrell Perera
 
Flask
FlaskFlask
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 Overview
Lars Vogel
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
{item:foo}
 

Similar to How to build integrated, professional enterprise-grade cross-platform mobile apps (20)

The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
The ActionScript Conference 08, Singapore - Developing ActionScript 3 Mash up...
 
ANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 schANGULAR JS LAB MANUAL(final) vtu2021 sch
ANGULAR JS LAB MANUAL(final) vtu2021 sch
 
The Web on OSGi: Here's How
The Web on OSGi: Here's HowThe Web on OSGi: Here's How
The Web on OSGi: Here's How
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
Gears User Guide
Gears User GuideGears User Guide
Gears User Guide
 
API Integration in Web Application
API Integration in Web ApplicationAPI Integration in Web Application
API Integration in Web Application
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
C sharp and asp.net interview questions
C sharp and asp.net interview questionsC sharp and asp.net interview questions
C sharp and asp.net interview questions
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPI
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)
 
Into The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api'sInto The Box | Alexa and ColdBox Api's
Into The Box | Alexa and ColdBox Api's
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
Angular js
Angular jsAngular js
Angular js
 
Apache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social GadgetsApache Shindig, from Server Side Portlets to Open Social Gadgets
Apache Shindig, from Server Side Portlets to Open Social Gadgets
 
Flask
FlaskFlask
Flask
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 Overview
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
 

More from Appear

Improving the efficiency of aircraft turnaround
Improving the efficiency of aircraft turnaroundImproving the efficiency of aircraft turnaround
Improving the efficiency of aircraft turnaround
Appear
 
Appear IQ The Business Case for hybrid html5 mobile apps
Appear IQ The Business Case for hybrid html5 mobile appsAppear IQ The Business Case for hybrid html5 mobile apps
Appear IQ The Business Case for hybrid html5 mobile apps
Appear
 
White Paper - Securing Mobile Access to enterprise data
White Paper - Securing Mobile Access to enterprise dataWhite Paper - Securing Mobile Access to enterprise data
White Paper - Securing Mobile Access to enterprise data
Appear
 
Appear IQ8 - Mobility. Made Simple. What we do
Appear IQ8 - Mobility. Made Simple. What we doAppear IQ8 - Mobility. Made Simple. What we do
Appear IQ8 - Mobility. Made Simple. What we do
Appear
 
Webinar 5 challenges of mobilization april 9 2014
Webinar   5 challenges of mobilization april 9 2014Webinar   5 challenges of mobilization april 9 2014
Webinar 5 challenges of mobilization april 9 2014
Appear
 
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-MitarbeiterMobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
Appear
 
Webinar: Learn how to migrate mobile workers to next generation mobility
Webinar: Learn how to migrate mobile workers to next generation mobilityWebinar: Learn how to migrate mobile workers to next generation mobility
Webinar: Learn how to migrate mobile workers to next generation mobility
Appear
 
Webinar: The Enterrpise Appstore - What is it and why you need it.
Webinar: The Enterrpise Appstore - What is it and why you need it.Webinar: The Enterrpise Appstore - What is it and why you need it.
Webinar: The Enterrpise Appstore - What is it and why you need it.
Appear
 
Integrating Mobile Technology in the Construction Industry
Integrating Mobile Technology in the Construction IndustryIntegrating Mobile Technology in the Construction Industry
Integrating Mobile Technology in the Construction Industry
Appear
 
Gartner Catalyst: MobiCloud presentation
Gartner Catalyst: MobiCloud presentationGartner Catalyst: MobiCloud presentation
Gartner Catalyst: MobiCloud presentation
Appear
 
MobiCloud Transport Webinar series June 2013 - Dutch
MobiCloud Transport Webinar series June 2013 - DutchMobiCloud Transport Webinar series June 2013 - Dutch
MobiCloud Transport Webinar series June 2013 - Dutch
Appear
 
MobiCloud Transport Webinar series June 2013 - English
MobiCloud Transport Webinar series June 2013 - English MobiCloud Transport Webinar series June 2013 - English
MobiCloud Transport Webinar series June 2013 - English
Appear
 
MobiCloud Transport Webinar series June 2013 - Swedish
MobiCloud Transport Webinar series June 2013 - SwedishMobiCloud Transport Webinar series June 2013 - Swedish
MobiCloud Transport Webinar series June 2013 - Swedish
Appear
 

More from Appear (13)

Improving the efficiency of aircraft turnaround
Improving the efficiency of aircraft turnaroundImproving the efficiency of aircraft turnaround
Improving the efficiency of aircraft turnaround
 
Appear IQ The Business Case for hybrid html5 mobile apps
Appear IQ The Business Case for hybrid html5 mobile appsAppear IQ The Business Case for hybrid html5 mobile apps
Appear IQ The Business Case for hybrid html5 mobile apps
 
White Paper - Securing Mobile Access to enterprise data
White Paper - Securing Mobile Access to enterprise dataWhite Paper - Securing Mobile Access to enterprise data
White Paper - Securing Mobile Access to enterprise data
 
Appear IQ8 - Mobility. Made Simple. What we do
Appear IQ8 - Mobility. Made Simple. What we doAppear IQ8 - Mobility. Made Simple. What we do
Appear IQ8 - Mobility. Made Simple. What we do
 
Webinar 5 challenges of mobilization april 9 2014
Webinar   5 challenges of mobilization april 9 2014Webinar   5 challenges of mobilization april 9 2014
Webinar 5 challenges of mobilization april 9 2014
 
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-MitarbeiterMobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
MobiCloud Transport Webinar Series - Die vernetzten ÖPNV-Mitarbeiter
 
Webinar: Learn how to migrate mobile workers to next generation mobility
Webinar: Learn how to migrate mobile workers to next generation mobilityWebinar: Learn how to migrate mobile workers to next generation mobility
Webinar: Learn how to migrate mobile workers to next generation mobility
 
Webinar: The Enterrpise Appstore - What is it and why you need it.
Webinar: The Enterrpise Appstore - What is it and why you need it.Webinar: The Enterrpise Appstore - What is it and why you need it.
Webinar: The Enterrpise Appstore - What is it and why you need it.
 
Integrating Mobile Technology in the Construction Industry
Integrating Mobile Technology in the Construction IndustryIntegrating Mobile Technology in the Construction Industry
Integrating Mobile Technology in the Construction Industry
 
Gartner Catalyst: MobiCloud presentation
Gartner Catalyst: MobiCloud presentationGartner Catalyst: MobiCloud presentation
Gartner Catalyst: MobiCloud presentation
 
MobiCloud Transport Webinar series June 2013 - Dutch
MobiCloud Transport Webinar series June 2013 - DutchMobiCloud Transport Webinar series June 2013 - Dutch
MobiCloud Transport Webinar series June 2013 - Dutch
 
MobiCloud Transport Webinar series June 2013 - English
MobiCloud Transport Webinar series June 2013 - English MobiCloud Transport Webinar series June 2013 - English
MobiCloud Transport Webinar series June 2013 - English
 
MobiCloud Transport Webinar series June 2013 - Swedish
MobiCloud Transport Webinar series June 2013 - SwedishMobiCloud Transport Webinar series June 2013 - Swedish
MobiCloud Transport Webinar series June 2013 - Swedish
 

Recently uploaded

Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 

Recently uploaded (20)

Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 

How to build integrated, professional enterprise-grade cross-platform mobile apps

  • 1. How to build integrated, professional enterprise-grade cross-platform mobile apps Build a simple enterprise mobility application with data sync using AngularJS, Backbone or Sencha Touch using our simple step by step tutorials. Our tutorials demonstrate how to develop a basic “train times” viewing application using the AppearIQ API. This includes generation of a boilerplate HTML5 hybrid cross-platform app (capable of running on either iOS or Android devices), introduction to data formats, application logic, how to synchronize data, testing in browsers and on devices. The tutorials assume that you already have basic knowledge of HTML and JavaScript. If you feel that you need to go through the basics, check out some excellent external tutorials like W3Schools HTML tutorials or W3Schools Javascript tutorials. Use of the AppearIQ cloud developer platform is free of charge. To access the tutorials click here (links to AppearIQ.com developer site). The tutorial examples provided here are shared with the Slideshare audience. Readers are encouraged to visit www.appeariq.com for access to the full AppearIQ documentation and to review more up to date tutorials (including any modifications to this one) as they become available. Develop Your First App Introduction In this tutorial, you will learn how to develop a basic single view AIQ application using the AIQ API. This application will display a simple read-only list of trains using the AIQ DataSync module. Remember to consult the API documentation in case you get lost or you are not sure what the API being used does. This tutorial assumes that you already have basic knowledge of HTML and JavaScript. If you feel that you need to go through the basics, don't hesitate to read external tutorials like this and this. If you need to see the final application source code at any point, it's available on Github in the Mobile samples repository. Just follow the Getting Started guide to deploy it to your device. Generate Boilerplate App Navigate to a folder in which you want to have your AIQ applications and execute the aiq generate command: $ aiq generate -n hello-world
  • 2. This will create a new folder called hello-world and will put the app content inside this folder. Your folder structure will look like this: Note: The API implementation stored in the aiq folder is only for testing purposes in order to use it in the local web browser and will be replaced by the proper implementation when your application is deployed to a device. Keeping this folder in your application structure is not obligatory, though we strongly encourage you to use it and test your applications in browser before publishing them to device. Note: In this tutorial we skip editing the stylesheet. If you want to know the details on how to apply css styles to the application, go to this page. Entry Point Just like the regular web browser, AIQ client launches the index.html file which comes with the application. This file takes responsibility of loading and initializing the AIQ API. This is how your Hello World's index file should look like: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="MobileOptimized" content="320"> <meta name="HandheldFriendly" content="True"> <title>Hello world</title> <script type="text/javascript" src="/aiq/aiq-api.js"></script> <script type="text/javascript" src="/js/app.js"></script> <link type="text/css" rel="stylesheet" href="/css/app.css">
  • 3. </head> <body> <h1>Hello world</h1> <div id="error"></div> <ul id="list"></ul> <script> document.addEventListener("aiq-ready", HW.aiqReady, false); </script> </body> </html> Let's go through the most important parts of it one by one. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="MobileOptimized" content="320"> <meta name="HandheldFriendly" content="True"> Web pages display differently on desktop and mobile browsers. In order to make sure that your application is recognized as mobile and display all graphical elements correctly, you should use the viewport property and set it to device width. Unfortunately not all devices recognize this property, therefore you must use dedicated fallbacks (MobileOptimized for Windows based devices and HandheldFriendly for other proprietary operating systems). <script type="text/javascript" src="/aiq/aiq-api.js"></script> This declaration imports and initializes the AIQ API. The path remains the same no matter if you run the application in the browser or in the AIQ client. After the AIQ APIs are initialized and ready to use, aiq-ready document event is generated. <div id="error"></div> This DIV tag is a placeholder for errors which might occur while retrieving the documents, like connectivity issues or unresponsive backend. It will be referred to by its id, which is safe in this case because it is the only element in the application with this identifier. <ul id="list"></ul> This UL tag is a placeholder for the list of trains. It will be referred to by its id, which is safe in this case because it is the only element in the application with this identifier. <script> document.addEventListener("aiq-ready", HW.aiqReady, false); </script> AIQ API initialization is not instantaneous because it takes a bit time to initialize all of its components. In order not to perform any operation before the API is ready, your must subscribe to aiq-ready event generated when everything is in place and safe to use. The aiqReady function is defined in HW namespace in the application logic and will be described in the next section of this tutorial. Note: Placing this SCRIPT tag right before the closing BODY tag will ensure that the contained code will be executed only after the DOM tree is parsed and ready to be worked on.
  • 4. At this point you have an empty view with a Hello World header on top. Data Format The next step is to define the data structure on which your application will base. Since this applicaiton will show a train list, so each document will represent a single train. Let's create adatasync.json file in mock-data folder as described here with the following contents: { "documents":[ { "_type": "TD.Train", "number": "9001" }, { "_type": "TD.Train", "number": "9002" }, { "_type": "TD.Train", "number": "9003" }, { "_type": "TD.Train", "number": "9004" }, { "_type": "TD.Train", "number": "9005" }, { "_type": "TD.Train", "number": "9006" }, { "_type": "TD.Train", "number": "9007" }, { "_type": "TD.Train", "number": "9008" } ] } The _type field is used throughout the whole AIQ system and specifies the type of the document. Document types are arbitrary but we encourage you to use prefixes implying an application to which these documents belong (the overall namespace in this example is HW. Note however that we're using TD in the data format, which stands for Train Damage. The reason for this is that the business data is shared between different sample applications). This reduces the possibility of naming conflicts. Application Logic After the AIQ API is ready to use, you can start populating the initially empty view with some data. This is the example app.js file which you will be using in this tutorial: /* global AIQ:false, HW:true */ var HW = HW || {}; (function() { "use strict";
  • 5. HW.aiqReady = function() { aiq.datasync.getDocuments("TD.Train", { success: function(docs) { if (docs.length === 0) { this.error({ message: "No documents to display" }); } else { var fragment = document.createDocumentFragment(); var list = document.getElementById("list"); docs.forEach(function(doc) { var entry = document.createElement("li"); entry.innerHTML = doc.number; fragment.appendChild(entry); }); list.appendChild(fragment); } }, error: function(arg) { var error = document.getElementById("error"); error.innerHTML = arg.message; } }); }; }()); Let's try to understand what's going on in this piece of code. Retrieving Documents In order to retrieve a list of our TD.Train documents, we use getDocuments method of theData Synchronization module. aiq.datasync.getDocuments("TD.Train", { success: function(docs) { ... }, error: function(arg) { ... } }); Handling Empty List To simplify things, we use the error handler to display an information when the document list is empty. if (docs.length === 0) { this.error({ message: "No documents to display" }); } else { ... } Note: Note that we can use "this" in this context because it will point to the object containing both "success" and "error" methods. Populating the List In this line, we retrieve the list element declared in the entry point. We can do this easily thanks to the id we assigned to it.
  • 6. var list = document.getElementById("list"); Then, we need to populate the list with the names of our trains. We know that all documents of TD.Train type have a field called number, so we go through the available documents, create a new LI element for every train number and append them to our list. docs.forEach(function(doc) { var entry = document.createElement("li"); entry.innerHTML = doc.number; fragment.appendChild(entry); }); Error Proofing While it is not obligatory, we advise to use code quality tools like JSHint to make sure that your very liberal by default JavaScript code doesn't contain common and easy to overlook mistakes, like using undeclared variables. The "global" section declares static objects used in the file (their boolean values tell whether they can be changed from within the file). For a comprehensive list of available options, visit this page). Note that there is no space after the opening comment. /*global AIQ:false, HW:true */ Using strict modeis is another way of making the code more error proof. Some browsers implement the strict mode which makes the JavaScript parser much less liberal and thus making it easy to spot mistakes. If a browser doesn't support this mode, this declaration is treated as a regular string, not causing any problems. "use strict"; Testing in Browser Now your application is ready for the initial testing. The simplest is to test it in Google Chrome to start with. After having setup your environment following those guidelines, you should see the following view:
  • 7. You can see that the list has been populated with eight trains included in the test data. Testing on Device Testing on a device is explained here. After uploading the application, launch the mobile client and click on the new Hello World application that appeared on the home screen. You should see the familiar view containing eight trains:
  • 8.
  • 9. This is it. Now you have a working example on how to create a simple application and integrate it with the AIQ API. Conclusion In this tutorial you have learned how to design the business data, create an AIQ enabled application and test it in both local browser and on a real device. If you want to learn about more advanced functions like editing documents, using camera or performing direct calls, visit our Development Home.