strategies for building mobile apps using arcgis api for ... · agenda mobile web has differences 5...

91
Strategies for Building Mobile Apps Using ArcGIS API for JavaScript Andy Gup, Lloyd Heberlie

Upload: others

Post on 17-Jun-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Strategies for Building Mobile Apps Using ArcGIS API for

JavaScript

Andy Gup, Lloyd Heberlie

Page 2: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

AgendaMobile web has differences5 Steps for building awesome mobile appsBootstrapjQuery MobileGeolocationOffline

Page 3: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation
Page 4: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Default Behavior

Page 5: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Default Behavior

Page 6: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Default Behavior

Page 7: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Apps specifically built for mobile

Page 8: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Apps specifically built for mobileField data collectionDeploy to App Store, Google PlayCitizen 411Finder appsOffline maps

Page 9: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Demo

Page 10: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Touch-aware map

Page 11: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

esri/dijit/PopupMobile

Page 12: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Custom basemap switcher

Page 13: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Geolocation

Page 14: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Mobile devices are different

Physical device

Screen size

Button sizes

Page 15: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

User interactions are different

TouchOrientationOnscreen keyboardVoice

Page 16: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Design pattern are different

Fits smaller screensScreen orientation can rotateMobile popups and overlaysTouch-based navigation

Page 17: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Think mobile first!

320px

Page 18: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Mobile in 5 Steps

Page 19: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

STEP 1

Get your data in order

Page 20: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

STEP 2

Sketch, mockup, UI design

Page 21: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

STEP 3

Choose web, hybrid or native

Page 22: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

STEP 4

Choose a UX frameworkSingle page, multiple page?

Page 23: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

STEP 5

Iterate/CollaborateBuild > Test > Repeat

Page 24: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Step #1Get your data in order

Page 25: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Get your data in order

Develop a schemaDesign tables and relationshipsClean the dataTest, test, test

Page 26: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Mobile ready data?

Test query payload sizeSimplify polygons!Remove unneeded attributesGzip-enabled web server

Page 27: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Step #2Sketch, mockup, design

Page 28: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Sketch, mockup, UI design

Page 29: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Sketch, mockup, UI design

Think mobile firstSimplified menusSmaller mapMap primary or secondary?

Page 30: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Step #3Web, hybrid or native?

Page 31: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Web, hybrid or native?

Native = Objective C, Java or C#

Compiled to run on device OSAccesses device directly via native API

Page 32: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Web

JavaScript, CSS skillsCross-browser, cross-deviceNo special access needed to sensorsNo special storage needs

Page 33: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Web

Web = Browser-based onlyHTML, CSS, JavaScript

Access device via browser APIs

Page 34: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Hybrid

Hybrid = Native Chrome-less browser plusHTML, CSS, JavaScriptExample: PhoneGap/Cordova

Compiled as a native applicationAccesses device via browser APIs & plug-ins

Page 35: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Hybrid

JavaScript, CSS skillsCross-browser, cross-deviceSome special access needed to sensorsSome special storage needsApp Store and/or Google Play

Page 36: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Native

Native = Objective C, Java or C#

Compiled to run on device OSAccesses device directly via native API

Page 37: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Native

Objective C, Java and/or C# skillsHigh-performance requirementsSpecial access needed to sensorsSpecial storage needsOffline related tables, domains and subtypes

Page 38: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Native

Better memory managementControl over battery lifeApp Store and/or Google Play

Page 39: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Step #4Choose a UI framework

Page 40: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Choose a UI framework

Single view• Responsive design pattern

Multiple views• Fixed layout design pattern

Page 41: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Responsive Design• Single web app that works well across a

variety of devices/screen sizes

• Re-use content and software

• Considers– Device limitations– User’s behavior

Page 42: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

1. Fluid Grid System2. CSS Media Queries3. HTML5, CSS & JavaScript

Responsive Design

Page 43: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Fluid Grid System

• Layout adapts to different screen sizes

• Based on percentages• 12 column / 960px

Page 45: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

CSS Media Queries• Detect device screen size and orientation• Apply CSS at specific break points• Typical: 480px, 768px, 1024px, 1280px

Page 46: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

CSS Media Queries

Page 47: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

http://getbootstrap.com/css/

Page 48: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Bootstrap Fluid Grid CSS

<div class="col-xs-12 col-sm-8>

Define Column

Device Size

Number of Columns

Page 49: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Responsive Grid Layouts

Page 50: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Large: 3 Rows - 3 Columns

>= 1280px

Page 51: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Medium: 2 Columns

1024 - 1280px

Page 52: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Small: Single Column

768 - 1024px

Page 53: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Extra Small: 1 Column, Minimized

=< 768px

Page 54: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Responsive Application

Page 55: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

How-toBuild a responsive app

Page 56: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Get bootstrap-map-js

github.com/Esri/bootstrap-map-js

Page 57: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Hello World

Page 58: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add package path

Page 59: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add jQuery & bootstrap.js

Page 60: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add JS API and BootstrapMap

Page 61: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation
Page 62: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

How-toBuild a Multiple-view app

Page 63: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Multiple-View Design• Framework for single page apps with

multiple views• Similar to native look, feel and

behavior• Cross-browser

Page 64: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Desktop vs. Device

Page 65: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Desktop vs. Device

Page 66: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

VIEW 1 VIEW 2

Page 67: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

<html>

<div data-role=“page” id=“page1”>

</div>

<div data-role=“page” id=“page2”>

</div>

</html>

One HTML page

Multiple Views

Page 68: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation
Page 69: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation
Page 70: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Get jquery-mobile-map-js

https://github.com/Esri/jquery-mobile-map-js

Page 71: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add Some CSS

Page 72: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add a little more CSS

Page 73: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add 2 pages

Page 74: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add jQuery & bootstrap.js

Page 75: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add jQuery & ArcGIS JS API

Page 76: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Add the map

Page 77: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

VIEW 1 VIEW 2

Page 78: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Step #5Build > test > repeat

Page 79: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Build > test > repeat

Optimize CSSConcatenate JS filesUse ArcGIS Web OptimizerMinify & gzip

Page 80: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Geolocation

Page 81: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

GeolocationWorks online and offlineApproximate location Always requires user opt-in

Page 82: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Offline JS

Page 83: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Offline JSIntermittent or no internet

Ability to reload or restart app offline

Lightweight cross-browser functionality

Github.com/esri/Offline-editor-js

Page 84: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Offline JSOffline tiled maps for small areas

Offline editing and basic attachments

Offline TPKs (Tile Packages)

Github.com/esri/Offline-editor-js

Page 85: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Offline JSNeed a full features, robust offline solution?• ArcGIS Runtime SDKs• Integrated offline support for editing and sync• Support for related tables, domains, subtypes

and more.

Page 86: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Wrap-upMobile web has differences5 Steps for building awesome mobile appsBootstrapjQuery MobileGeolocationOffline

Page 87: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Resourcesgithub.com/lheberlie/mobile-webapps-js/blob/develop/Resources.mdgithub.com/lheberlie/phonegap-jquerym-js

Page 88: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Related SessionsOptimizing your JavaScript App for PerformanceDemo Theater 7Wed. 4:30pm

Page 90: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation

Thank you…

• Please fill out the session survey in your mobile app• Select Strategies for Building Mobile Apps Using ArcGIS

API for JavaScript in the Mobile App- Use the Search Feature to quickly find this title

• Click “Technical Workshop Survey”• Answer a few short questions and enter any comments

Page 91: Strategies for Building Mobile Apps Using ArcGIS API for ... · Agenda Mobile web has differences 5 Steps for building awesome mobile apps. Bootstrap. jQuery Mobile. Geolocation