Top Banner
Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie
36

Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Jan 18, 2016

Download

Documents

Emory Perry
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery

Andy Gup, Lloyd Heberlie

Page 2: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Agenda

Page 3: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Why PhoneGap?

Page 4: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Lloyd Heberlie

Basic PhoneGap app

Page 5: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

What is PhoneGap?

• Application container technology

• Core engine is 100% open source

• Web view container, plus JS API

• HTML5, CSS3, JS = Native App

PhoneGap

Page 6: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

PhoneGap architecture

PhoneGapPlugins

PhoneGap ApplicationCode

NativeApp

Page 7: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Setup a developer machine

Source Control

Code quality and verification

web server

Page 8: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Lloyd Heberlie

PhoneGap Quickstart

Page 9: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Debugging

Page 10: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Putting it all togetherPhoneGap, jQuery and ArcGIS API for

JavaScript

Andy Gup

Page 11: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Single Page view

Set up page structure

Apply CSS, roles and themes

https://github.com/Esri/quickstart-map-phonegap

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

Page 12: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Single Page Map - HTML

Page 13: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Single Page Map - HTML

Page 14: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Single Page Map - HTML

Page 15: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Single Page Map - CSS

Page 16: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Andy Gup

Single page app

Page 17: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Auto-recenter after orientation change

Page 18: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

jQuery Helper library

Recentering on device rotation

Multiple view mapping apps

var helper = new jQueryHelper(map);

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

Page 19: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Auto-recenter after orientation change

Page 20: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

A quick look:Android native build environment

Page 21: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

assets/www/

Page 22: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Host JS libs locally(if possible)

Page 23: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Set PhoneGap config.xml

Page 24: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Native wrapper

Page 25: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Andy Gup

Putting it all together

Page 26: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

GPS Best Practices - Android

Page 27: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

GPS Best Practices - Android

Page 28: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

GPS Best Practices - iOS

Page 29: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

GPS Best Practices – Windows Phone

Page 30: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Geolocation API – same as always!

Page 31: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Requirements for offline?

App usage in areas of intermittent or no internet

Ability to reload or restart app in areas of intermittent

or no connectivity

Lightweight cross-browser functionality

Github.com/esri/Offline-editor-js

Page 32: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Offline JS Use Cases

• Viewing simple maps

• Lighweight data collection- VGI- Simple editing

• Devices- laptop- smartphone / tablet

Page 33: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Need a full featured, robust offline solution?

ArcGIS Runtimes for iOS, Android, Qt and .NET!

Includes integrated support for offline editing and synchronization.

Also fully supports related tables, sub-types, domains and much more.

Page 34: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Offline Demo – trailyelper

Page 35: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.

Questions?

Andy GupDeveloper Evangelist [email protected]@agup

Lloyd HeberlieJavaScript API [email protected]@lheberlie

Page 36: Building Native Apps with ArcGIS API for JavaScript Using PhoneGap and jQuery Andy Gup, Lloyd Heberlie.