Skip to content

jsphlacombe/quickstart-map-phonegap

 
 

Repository files navigation

quickstart-map-phonegap

A set of simple samples that show how to get started with the ArcGIS API for JavaScript and PhoneGap/Cordova. These samples provide best practices for using PhoneGap and Cordova across different device operating systems and within the PhoneGap/Cordova application lifecycle.

Features

This repo contains four sample applications.

  • index_basicmap.html - a basic mapping application configuration.
  • index_basicwebmap.html - uses a simple web map.
  • index_basicgps.html - uses the GPS to acquire current location and center the map.
  • index_jquerymobilegps.html - demonstrates how to use jQuery mobile with PhoneGap and the ArcGIS API for JavaScript.
  • index_jquerymobilegps_localarcgis.html - demonstrates a local version of the ArcGIS API for JavaScript that was created using http://jso.arcgis.com/.

The jQuery sample also makes use of the jquery-mobile-map-js repository's jQueryHelper library.

Instructions

Install the Cordova command line interface (CLI), then:

  1. Fork and then clone this repo or download the .zip file.

  2. Download Cordova.

  3. Follow the Cordova platform installation instructions for installation and configuration instructions.

  4. Follow the Cordova guidelines for creating an app. Example

     $ cordova create hello com.example.hello HelloWorld
    
  5. Add additional platforms. Example

     $ cordova platform add android
    
  6. Copy the contents from this repo into any newly created /www directories

  7. Set which sample you want the application to launch in the config.xml <content> tag.

     <content src="index_jquerymobilegps.html" />
    
  8. To take advantage of GPS and Geolocation capabilities you may need to install the Geolocation plugin.

  9. Build the app and launch!

Testing

These applications will not work as stand-alone web applications because there are coded specifically for PhoneGap/Cordova.

For the most definitive approach, build and run application directly on a device. Use console.log statements for troubleshooting. With the latest versions of Chrome and Safari you can remotely debug the device as long as it's attached to your laptop via a USB cabable. This is super-convienent and very easy to set up.

For rapid tweaking/testing cycles you should also check out the PhoneGap Desktop App.

Minimum Requirements

  • One actual working device for each mobile platform you want to deploy to. Simply testing on an emulator isn't good enough for production use. Test on as many devices as possible.
  • AndroidStudio and XCode (iOS)
  • Android SDK - if you are deploying to Android
  • Node.js - if you want to use the very easy PhoneGap/Cordova CLI command-line interface. Highly recommended!

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Anyone and everyone is welcome to contribute.

Licensing

Copyright 2015 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

[](Esri Tags: ArcGIS PhoneGap Cordova QuickStart) [](Esri Language: JavaScript)

About

ArcGIS JavaScript samples for use with PhoneGap/Cordova

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 40.7%
  • CSS 28.6%
  • XSLT 24.5%
  • HTML 6.2%