SlideShare a Scribd company logo
1 of 19
Android Development with ArcGIS Server Esri Dev Meet Up Charlotte, NC October 19th, 2010 Jim Tochterman, VP - Research & Development www.bcs-gis.com www.facebook.com/bcsgis www.twitter.com/bcsgis
What is Android? Software stack for mobile devices, formally introduced in 2008 Unlike other mobile devices, not a proprietary OS iOS Palm OS Blackberry OS Combination of three (3) components Free, open source OS for mobile devices Free, open source development environment for creating mobile applications Devices that run the Android OS and the applications created for it http://developer.android.com/guide/basics/what-is-android.html
Why choose Android over iPhone? Customers: iPhone cost was prohibitive for widespread deployment No Objective-C / Cocoa developers on staff No Mac hardware available Technical Limitations / General Annoyances: GSM coverage is not good in the Southeast (even in Urban Areas)  iPhone did not support ā€œbackgroundingā€ (at the time) Deployment Hurdles (App Store, Code Signing, etc.) Xcode is quite possibly the worst IDE ever! Comfort Level: If you do Flex or Java development already the tools are very similar!
Why develop with Android? Background Services Event driven model that works silently while other applications are being used. Shared Data & Inter-Process Communication Applications can exchanges messages, perform processing, and share data. Widgets & Live Folders Allows you to create windows into your applications from your deviceā€™s home screen. Application Equality No differentiation between native applications and those developed by third parties.
Pros & Cons with Android Development Pros: Good Development Tools and Samples No App Store / Market Requirement! Build and Deploy with Dropbox if you feel like it Cons: Terminology!  What in the hell is an Activity and a Intent!? (The names can seem strange, but based upon what they do) More work to make a ā€œPrettyā€ app
Where Do I Get Started? Download Eclipse (or my preference MotoDev Studio) http://www.eclipse.org/downloads http://developer.motorola.com/docstools/motodevstudio/download Download Android ADT and SDK http://developer.android.com/sdk/index.html Start Playing!
Design Considerations For Mobile Devices Low Processing Speed Optimize code to run quick and efficiently Limited storage & memory Minimize application size Reuse and share data (using databases & saved files) Limited bandwidth & high latency Allow for slow, intermittent network connections Limited Battery Life Avoid expensive operations where/when possible Limit sensor access when not being used
How do I use ArcGIS Server with Android? ArcGIS API for Android is coming!  Finally!! http://resources.arcgis.com/content/arcgis-android/api
How do I use ArcGIS Server with Android now!? Sign up for the Early Adopter Program ā€“ OR - arcgis4android@esri.com Use ArcGIS Server REST API & Web Services! WMS Service provides Map Tiles for Overlays Feature Service provides ability to retrieve and/or edit data
Demoā€¦ Integrating ArcGIS Server Data & Services with Google Maps API (via REST API)
Creating Map Overlay (MainActivity.java) public class MainActivity extends MapActivity implements OnSharedPreferenceChangeListener { 	private final static String TAG = "MainActivity"; MyMapViewmyMapView; MapControllermapController; LocationManagerlocationManager;   MyCustomLocationOverlaymyLocationOverlay; WMSOverlayAtlanticStormsOverlay; 	ā€¦ AtlanticStormsOverlay = new WMSOverlay("http://aws.bcs-gis.com/arcgis/services/Storms/Atlantic/MapServer/WMSServer?", layerIds, myMapView); overlays.add(AtlanticStormsOverlay ); 	ā€¦ }
Creating Map Overlay (WMSOverlay.java) public class WMSOverlay extends Overlay { 	private final static String TAG = ā€WMSOverlay"; WMSLoaderwmsClient; 	ā€¦ 	public WMSOverlay(Stringurl, String layers, MapViewmapView) 	{ 		ā€¦ wmsClient = new WMSLoader(url, layers); intleftLongitude = mapView.getMapCenter().getLongitudeE6() - mapView.getLongitudeSpan()/2; intrightLongitude = mapView.getMapCenter().getLongitudeE6()+ mapView.getLongitudeSpan()/2; intupperLatitude = mapView.getMapCenter().getLatitudeE6() + mapView.getLatitudeSpan()/2; intlowerLatitude = mapView.getMapCenter().getLatitudeE6() - mapView.getLatitudeSpan()/2; GeoPointupperLeft = new GeoPoint(upperLatitude,leftLongitude); GeoPointlowerRight = new GeoPoint(lowerLatitude,rightLongitude); image = wmsClient.loadMap(mapView.getWidth(), mapView.getHeight(), upperLeft, lowerRight); 	} }
Creating Map Overlay (WMSLoader.java) public class WMSLoader { 	public static String TAG = "WMSLoader"; 	public String serverUrl; 	public String layerIds; 	ā€¦ public Bitmap loadMap(int width, int height, GeoPointul, GeoPointlr) { 	URL url = null; 	try { url = new URL(String.format(serverUrl + 		"LAYERS=" + layerIds + "&TRANSPARENT=true&FORMAT=image/	png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/	vnd.ogc.se_inimage&SRS=EPSG:4326" + "" + 		"&BBOX=%f,%f,%f,%f&WIDTH=%d&HEIGHT=%d", ul.getLongitudeE6()/1E6, lr.getLatitudeE6()/1E6, 	lr.getLongitudeE6	()/1E6, 	ul.getLatitudeE6()/1E6, width, height)); 		ā€¦ 		Bitmap image = BitmapFactory.decodeStream(input); 		return image; } }
Creating Data via REST API (MainActivity.java) public class MainActivity extends MapActivity implements OnSharedPreferenceChangeListener { ā€¦ 	@Override 	public booleanonCreateOptionsMenu(Menu menu)  	{ boolean result = super.onCreateOptionsMenu(menu);   		ā€¦ menu.add(0, 996, Menu.NONE, "SITREP Notes").setIcon(android.R.drawable.ic_menu_myplaces); ā€¦ 	} 	@Override 	public booleanonOptionsItemSelected(MenuItem item)  	{ super.onOptionsItemSelected(item); Intent mapIntent = new Intent(Intent.ACTION_VIEW);    		 switch (item.getItemId()) 		{ 			ā€¦ case (996) : 			Intent dca = new Intent(this, DataCollectionActivity.class); startActivityForResult(dca, 996);    			return true; 			ā€¦    		 }     		// Return false if you have not handled the menu item.     		return false;  	}  }
Creating Data via REST API (DataCollectionActivity.java) public class DataCollectionActivity extends Activity  { 	static final String TAG = "DataCollectionActivity";  	ā€¦ pointButton.setOnClickListener(newOnClickListener() {       		public void onClick(Viewv) {       			//Ask the user if they want to post report        			new AlertDialog.Builder(DataCollectionActivity.this)      			.setIcon(android.R.drawable.ic_dialog_alert)        			.setTitle("Post Note")        			.setMessage("Are you sure you want to post this note?")        			.setPositiveButton("Yes", new DialogInterface.OnClickListener() {   			        public void onClick(DialogInterface dialog, int which) {         				Bundle bundle = new Bundle(); bundle.putString("type", pointSpinner.getSelectedItem().toString()); bundle.putString("reportdatetime", deviceData.getReportDateTime()); bundle.putString("comments", commentsEditText.getText().toString()); Intent intent = new Intent(Intent.ACTION_VIEW);  intent.putExtras(bundle); intent.setClassName("com.bcs.android.sitrep", "com.bcs.android.sitrep.NoteCreateActivity"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  startActivity(intent);                    			        }        		 })       	.setNegativeButton("No", null)       	 .show();             	ā€¦ }
Creating Data via REST API (NoteCreateActivity.java) public class NoteCreateActivity extends Activity { 	static final String TAG = "NoteCreateActivity";  private String serverUrl = "http://devweb.bcs-gis.com/arcgis/rest/services/SITREP_Notes2/FeatureServer/0/addFeatures"; 	ā€¦ String attrString = ",'attributes':{"; attrString = attrString + "'TYPE':'" + type + "'," + "'RPTDATETIME':'" + reportdatetime + "', " + "'SUMMARY':'" + comments + "'"; attrString = attrString + "}";  	String coordString = "[{'geometry':{"; coordString = coordString + "'x':" + loc.getLongitude() + ",'y':" + loc.getLatitude(); coordString = coordString + "}" + attrString + "}]"; HttpClienthttpclient = new DefaultHttpClient(); HttpPosthttppost = new HttpPost(serverUrl);    	try {        		// Add your data        		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1); nameValuePairs.add(newBasicNameValuePair("features", coordString)); httppost.setEntity(newUrlEncodedFormEntity(nameValuePairs));        		// Execute HTTP Post Request httpResponse = httpclient.execute(httppost); ā€¦ }
Demoā€¦ Sneak Peek ofApp Built w/ ArcGIS for Android API
Questions?
Want More Information? http://developer.android.com http://resources.arcgis.com/content/arcgis-android/about WROX Book: Professional Android 2 Application Development (Meier) ISBN#: 978-0-470-56552-0 jtoch@bcs-gis.com twitter.com/jtochterman

More Related Content

What's hot

An Introduction to WebVR ā€“ or How to make your user sick in 60 seconds
An Introduction to WebVR ā€“ or How to make your user sick in 60 secondsAn Introduction to WebVR ā€“ or How to make your user sick in 60 seconds
An Introduction to WebVR ā€“ or How to make your user sick in 60 secondsGeilDanke
Ā 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)Nicholas Zakas
Ā 
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
Goodbye, Flatland! An introduction to React VR  and what it means for web dev...Goodbye, Flatland! An introduction to React VR  and what it means for web dev...
Goodbye, Flatland! An introduction to React VR and what it means for web dev...GeilDanke
Ā 
What's new in Android at I/O'16
What's new in Android at I/O'16What's new in Android at I/O'16
What's new in Android at I/O'16Elif Boncuk
Ā 
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!FITC
Ā 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android WorkshopElif Boncuk
Ā 

What's hot (6)

An Introduction to WebVR ā€“ or How to make your user sick in 60 seconds
An Introduction to WebVR ā€“ or How to make your user sick in 60 secondsAn Introduction to WebVR ā€“ or How to make your user sick in 60 seconds
An Introduction to WebVR ā€“ or How to make your user sick in 60 seconds
Ā 
High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)High Performance JavaScript (CapitolJS 2011)
High Performance JavaScript (CapitolJS 2011)
Ā 
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
Goodbye, Flatland! An introduction to React VR  and what it means for web dev...Goodbye, Flatland! An introduction to React VR  and what it means for web dev...
Goodbye, Flatland! An introduction to React VR and what it means for web dev...
Ā 
What's new in Android at I/O'16
What's new in Android at I/O'16What's new in Android at I/O'16
What's new in Android at I/O'16
Ā 
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!
Bringing Virtual Reality to the Web: VR, WebGL and CSS ā€“ Together At Last!
Ā 
Hack'n Break Android Workshop
Hack'n Break Android WorkshopHack'n Break Android Workshop
Hack'n Break Android Workshop
Ā 

Viewers also liked

Cartographier le monde avec des outils libres
Cartographier le monde avec des outils libresCartographier le monde avec des outils libres
Cartographier le monde avec des outils libresarno974
Ā 
Du code Ć  la carte
Du code Ć  la carteDu code Ć  la carte
Du code Ć  la cartearno974
Ā 
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...Gestion municipale intelligente, moderne et accessible: Conception d'une plat...
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...ACSG - Section MontrƩal
Ā 
Formation E-tourisme Cartographique numerique et mobilite
Formation E-tourisme Cartographique numerique et mobiliteFormation E-tourisme Cartographique numerique et mobilite
Formation E-tourisme Cartographique numerique et mobiliteSimaWay Simaway
Ā 
ArcGIS Runtime For Android
ArcGIS Runtime For AndroidArcGIS Runtime For Android
ArcGIS Runtime For AndroidGabriel Moreira
Ā 
Futur des Maps lafrenchmobile Octobre 2013
Futur des Maps  lafrenchmobile Octobre 2013Futur des Maps  lafrenchmobile Octobre 2013
Futur des Maps lafrenchmobile Octobre 2013servicesmobiles.fr
Ā 
Cartographie mobile implantƩe au service de police de la ville de QuƩbec
Cartographie mobile implantƩe au service de police de la ville de QuƩbecCartographie mobile implantƩe au service de police de la ville de QuƩbec
Cartographie mobile implantƩe au service de police de la ville de QuƩbecACSG Section MontrƩal
Ā 
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016AppStudio for ArcGIS: The Basics - Esri FedGIS 2016
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016Blue Raster
Ā 
Android Studio, premier contact
Android Studio, premier contactAndroid Studio, premier contact
Android Studio, premier contactJasmine Conseil
Ā 
GƩolocalisation de donnƩes et conception de cartes interactives
GƩolocalisation de donnƩes et conception de cartes interactivesGƩolocalisation de donnƩes et conception de cartes interactives
GƩolocalisation de donnƩes et conception de cartes interactivesPhilippe Gambette
Ā 
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...ECAM Brussels Engineering School
Ā 
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanetDĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet Slim Namouchi
Ā 
Initiation arcgis10 v3-libre
Initiation arcgis10 v3-libreInitiation arcgis10 v3-libre
Initiation arcgis10 v3-libreSouhila Benkaci
Ā 
Formation ArcGis
Formation ArcGisFormation ArcGis
Formation ArcGisMohamed Rahim
Ā 
Tout savoir sur les SIG mobiles
Tout savoir sur les SIG mobilesTout savoir sur les SIG mobiles
Tout savoir sur les SIG mobilesEric Lacoursiere
Ā 

Viewers also liked (18)

Cartographier le monde avec des outils libres
Cartographier le monde avec des outils libresCartographier le monde avec des outils libres
Cartographier le monde avec des outils libres
Ā 
Enp dƩcembre 2016
Enp  dƩcembre 2016Enp  dƩcembre 2016
Enp dƩcembre 2016
Ā 
Du code Ć  la carte
Du code Ć  la carteDu code Ć  la carte
Du code Ć  la carte
Ā 
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...Gestion municipale intelligente, moderne et accessible: Conception d'une plat...
Gestion municipale intelligente, moderne et accessible: Conception d'une plat...
Ā 
Formation E-tourisme Cartographique numerique et mobilite
Formation E-tourisme Cartographique numerique et mobiliteFormation E-tourisme Cartographique numerique et mobilite
Formation E-tourisme Cartographique numerique et mobilite
Ā 
ArcGIS Runtime For Android
ArcGIS Runtime For AndroidArcGIS Runtime For Android
ArcGIS Runtime For Android
Ā 
Futur des Maps lafrenchmobile Octobre 2013
Futur des Maps  lafrenchmobile Octobre 2013Futur des Maps  lafrenchmobile Octobre 2013
Futur des Maps lafrenchmobile Octobre 2013
Ā 
Cartographie mobile implantƩe au service de police de la ville de QuƩbec
Cartographie mobile implantƩe au service de police de la ville de QuƩbecCartographie mobile implantƩe au service de police de la ville de QuƩbec
Cartographie mobile implantƩe au service de police de la ville de QuƩbec
Ā 
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016AppStudio for ArcGIS: The Basics - Esri FedGIS 2016
AppStudio for ArcGIS: The Basics - Esri FedGIS 2016
Ā 
Arc Gis
Arc GisArc Gis
Arc Gis
Ā 
Android Studio, premier contact
Android Studio, premier contactAndroid Studio, premier contact
Android Studio, premier contact
Ā 
GƩolocalisation de donnƩes et conception de cartes interactives
GƩolocalisation de donnƩes et conception de cartes interactivesGƩolocalisation de donnƩes et conception de cartes interactives
GƩolocalisation de donnƩes et conception de cartes interactives
Ā 
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...
DĆ©veloppement informatique : Gestion de projet, versioning, debugging, testin...
Ā 
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanetDĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet
DĆ©veloppement dā€™une Application Mobile Android StreetArtPlanet
Ā 
Outils de gestion de projets
Outils de gestion de projetsOutils de gestion de projets
Outils de gestion de projets
Ā 
Initiation arcgis10 v3-libre
Initiation arcgis10 v3-libreInitiation arcgis10 v3-libre
Initiation arcgis10 v3-libre
Ā 
Formation ArcGis
Formation ArcGisFormation ArcGis
Formation ArcGis
Ā 
Tout savoir sur les SIG mobiles
Tout savoir sur les SIG mobilesTout savoir sur les SIG mobiles
Tout savoir sur les SIG mobiles
Ā 

Similar to Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC

Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Fafadia Tech
Ā 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
Ā 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming Enguest9bcef2f
Ā 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesOry Segal
Ā 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android ProgrammingPeter van der Linden
Ā 
Naive application development
Naive application developmentNaive application development
Naive application developmentShaka Huang
Ā 
android level 3
android level 3android level 3
android level 3DevMix
Ā 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android JetpackAhmad Arif Faizin
Ā 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better PerformanceElif Boncuk
Ā 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Massimo Oliviero
Ā 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updatedGhanaGTUG
Ā 
Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication developmentGanesh Gembali
Ā 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Esri Nederland
Ā 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009Christopher Judd
Ā 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Chris Griffith
Ā 

Similar to Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC (20)

Geekcamp Android
Geekcamp AndroidGeekcamp Android
Geekcamp Android
Ā 
Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)
Ā 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
Ā 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
Ā 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
Ā 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
Ā 
Naive application development
Naive application developmentNaive application development
Naive application development
Ā 
android level 3
android level 3android level 3
android level 3
Ā 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android Jetpack
Ā 
Developing in android
Developing in androidDeveloping in android
Developing in android
Ā 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
Ā 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
Ā 
21 android2 updated
21 android2 updated21 android2 updated
21 android2 updated
Ā 
Android TCJUG
Android TCJUGAndroid TCJUG
Android TCJUG
Ā 
Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication development
Ā 
Android Intro
Android IntroAndroid Intro
Android Intro
Ā 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Ā 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
Ā 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
Ā 
Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5Developing AIR for Mobile with Flash Professional CS5.5
Developing AIR for Mobile with Flash Professional CS5.5
Ā 

More from Jim Tochterman

Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August Meeting
Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August MeetingTop 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August Meeting
Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August MeetingJim Tochterman
Ā 
What IT Professionals Should Know About Getting Started With & Supporting GIS
What IT Professionals Should Know About Getting Started With & Supporting GISWhat IT Professionals Should Know About Getting Started With & Supporting GIS
What IT Professionals Should Know About Getting Started With & Supporting GISJim Tochterman
Ā 
What's Coming At ArcGIS 10.1 - CSRA GIS User Group Meeting
What's Coming At ArcGIS 10.1 - CSRA GIS User Group MeetingWhat's Coming At ArcGIS 10.1 - CSRA GIS User Group Meeting
What's Coming At ArcGIS 10.1 - CSRA GIS User Group MeetingJim Tochterman
Ā 
GIS Technology & Mobile Applications - MTASC 2011 Conference
GIS Technology & Mobile Applications - MTASC 2011 ConferenceGIS Technology & Mobile Applications - MTASC 2011 Conference
GIS Technology & Mobile Applications - MTASC 2011 ConferenceJim Tochterman
Ā 
iOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group MeetingiOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group MeetingJim Tochterman
Ā 
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SC
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SCGIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SC
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SCJim Tochterman
Ā 

More from Jim Tochterman (6)

Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August Meeting
Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August MeetingTop 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August Meeting
Top 10 Things at Esri UC & ArcGIS Pro - Pee Dee User Group - August Meeting
Ā 
What IT Professionals Should Know About Getting Started With & Supporting GIS
What IT Professionals Should Know About Getting Started With & Supporting GISWhat IT Professionals Should Know About Getting Started With & Supporting GIS
What IT Professionals Should Know About Getting Started With & Supporting GIS
Ā 
What's Coming At ArcGIS 10.1 - CSRA GIS User Group Meeting
What's Coming At ArcGIS 10.1 - CSRA GIS User Group MeetingWhat's Coming At ArcGIS 10.1 - CSRA GIS User Group Meeting
What's Coming At ArcGIS 10.1 - CSRA GIS User Group Meeting
Ā 
GIS Technology & Mobile Applications - MTASC 2011 Conference
GIS Technology & Mobile Applications - MTASC 2011 ConferenceGIS Technology & Mobile Applications - MTASC 2011 Conference
GIS Technology & Mobile Applications - MTASC 2011 Conference
Ā 
iOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group MeetingiOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group Meeting
Ā 
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SC
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SCGIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SC
GIS & Cloud Computing - GAASC 2010 Fall Summit - Florence, SC
Ā 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
Ā 
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
Ā 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
Ā 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
Ā 
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
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
Ā 
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
Ā 
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
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Ā 
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
Ā 
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
Ā 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Ā 
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
Ā 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Ā 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
Ā 
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
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Ā 
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?
Ā 
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
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Ā 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Ā 
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
Ā 
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
Ā 

Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC

  • 1. Android Development with ArcGIS Server Esri Dev Meet Up Charlotte, NC October 19th, 2010 Jim Tochterman, VP - Research & Development www.bcs-gis.com www.facebook.com/bcsgis www.twitter.com/bcsgis
  • 2. What is Android? Software stack for mobile devices, formally introduced in 2008 Unlike other mobile devices, not a proprietary OS iOS Palm OS Blackberry OS Combination of three (3) components Free, open source OS for mobile devices Free, open source development environment for creating mobile applications Devices that run the Android OS and the applications created for it http://developer.android.com/guide/basics/what-is-android.html
  • 3. Why choose Android over iPhone? Customers: iPhone cost was prohibitive for widespread deployment No Objective-C / Cocoa developers on staff No Mac hardware available Technical Limitations / General Annoyances: GSM coverage is not good in the Southeast (even in Urban Areas) iPhone did not support ā€œbackgroundingā€ (at the time) Deployment Hurdles (App Store, Code Signing, etc.) Xcode is quite possibly the worst IDE ever! Comfort Level: If you do Flex or Java development already the tools are very similar!
  • 4. Why develop with Android? Background Services Event driven model that works silently while other applications are being used. Shared Data & Inter-Process Communication Applications can exchanges messages, perform processing, and share data. Widgets & Live Folders Allows you to create windows into your applications from your deviceā€™s home screen. Application Equality No differentiation between native applications and those developed by third parties.
  • 5. Pros & Cons with Android Development Pros: Good Development Tools and Samples No App Store / Market Requirement! Build and Deploy with Dropbox if you feel like it Cons: Terminology! What in the hell is an Activity and a Intent!? (The names can seem strange, but based upon what they do) More work to make a ā€œPrettyā€ app
  • 6. Where Do I Get Started? Download Eclipse (or my preference MotoDev Studio) http://www.eclipse.org/downloads http://developer.motorola.com/docstools/motodevstudio/download Download Android ADT and SDK http://developer.android.com/sdk/index.html Start Playing!
  • 7. Design Considerations For Mobile Devices Low Processing Speed Optimize code to run quick and efficiently Limited storage & memory Minimize application size Reuse and share data (using databases & saved files) Limited bandwidth & high latency Allow for slow, intermittent network connections Limited Battery Life Avoid expensive operations where/when possible Limit sensor access when not being used
  • 8. How do I use ArcGIS Server with Android? ArcGIS API for Android is coming! Finally!! http://resources.arcgis.com/content/arcgis-android/api
  • 9. How do I use ArcGIS Server with Android now!? Sign up for the Early Adopter Program ā€“ OR - arcgis4android@esri.com Use ArcGIS Server REST API & Web Services! WMS Service provides Map Tiles for Overlays Feature Service provides ability to retrieve and/or edit data
  • 10. Demoā€¦ Integrating ArcGIS Server Data & Services with Google Maps API (via REST API)
  • 11. Creating Map Overlay (MainActivity.java) public class MainActivity extends MapActivity implements OnSharedPreferenceChangeListener { private final static String TAG = "MainActivity"; MyMapViewmyMapView; MapControllermapController; LocationManagerlocationManager; MyCustomLocationOverlaymyLocationOverlay; WMSOverlayAtlanticStormsOverlay; ā€¦ AtlanticStormsOverlay = new WMSOverlay("http://aws.bcs-gis.com/arcgis/services/Storms/Atlantic/MapServer/WMSServer?", layerIds, myMapView); overlays.add(AtlanticStormsOverlay ); ā€¦ }
  • 12. Creating Map Overlay (WMSOverlay.java) public class WMSOverlay extends Overlay { private final static String TAG = ā€WMSOverlay"; WMSLoaderwmsClient; ā€¦ public WMSOverlay(Stringurl, String layers, MapViewmapView) { ā€¦ wmsClient = new WMSLoader(url, layers); intleftLongitude = mapView.getMapCenter().getLongitudeE6() - mapView.getLongitudeSpan()/2; intrightLongitude = mapView.getMapCenter().getLongitudeE6()+ mapView.getLongitudeSpan()/2; intupperLatitude = mapView.getMapCenter().getLatitudeE6() + mapView.getLatitudeSpan()/2; intlowerLatitude = mapView.getMapCenter().getLatitudeE6() - mapView.getLatitudeSpan()/2; GeoPointupperLeft = new GeoPoint(upperLatitude,leftLongitude); GeoPointlowerRight = new GeoPoint(lowerLatitude,rightLongitude); image = wmsClient.loadMap(mapView.getWidth(), mapView.getHeight(), upperLeft, lowerRight); } }
  • 13. Creating Map Overlay (WMSLoader.java) public class WMSLoader { public static String TAG = "WMSLoader"; public String serverUrl; public String layerIds; ā€¦ public Bitmap loadMap(int width, int height, GeoPointul, GeoPointlr) { URL url = null; try { url = new URL(String.format(serverUrl + "LAYERS=" + layerIds + "&TRANSPARENT=true&FORMAT=image/ png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/ vnd.ogc.se_inimage&SRS=EPSG:4326" + "" + "&BBOX=%f,%f,%f,%f&WIDTH=%d&HEIGHT=%d", ul.getLongitudeE6()/1E6, lr.getLatitudeE6()/1E6, lr.getLongitudeE6 ()/1E6, ul.getLatitudeE6()/1E6, width, height)); ā€¦ Bitmap image = BitmapFactory.decodeStream(input); return image; } }
  • 14. Creating Data via REST API (MainActivity.java) public class MainActivity extends MapActivity implements OnSharedPreferenceChangeListener { ā€¦ @Override public booleanonCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu); ā€¦ menu.add(0, 996, Menu.NONE, "SITREP Notes").setIcon(android.R.drawable.ic_menu_myplaces); ā€¦ } @Override public booleanonOptionsItemSelected(MenuItem item) { super.onOptionsItemSelected(item); Intent mapIntent = new Intent(Intent.ACTION_VIEW); switch (item.getItemId()) { ā€¦ case (996) : Intent dca = new Intent(this, DataCollectionActivity.class); startActivityForResult(dca, 996); return true; ā€¦ } // Return false if you have not handled the menu item. return false; } }
  • 15. Creating Data via REST API (DataCollectionActivity.java) public class DataCollectionActivity extends Activity { static final String TAG = "DataCollectionActivity"; ā€¦ pointButton.setOnClickListener(newOnClickListener() { public void onClick(Viewv) { //Ask the user if they want to post report new AlertDialog.Builder(DataCollectionActivity.this) .setIcon(android.R.drawable.ic_dialog_alert) .setTitle("Post Note") .setMessage("Are you sure you want to post this note?") .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Bundle bundle = new Bundle(); bundle.putString("type", pointSpinner.getSelectedItem().toString()); bundle.putString("reportdatetime", deviceData.getReportDateTime()); bundle.putString("comments", commentsEditText.getText().toString()); Intent intent = new Intent(Intent.ACTION_VIEW); intent.putExtras(bundle); intent.setClassName("com.bcs.android.sitrep", "com.bcs.android.sitrep.NoteCreateActivity"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } }) .setNegativeButton("No", null) .show(); ā€¦ }
  • 16. Creating Data via REST API (NoteCreateActivity.java) public class NoteCreateActivity extends Activity { static final String TAG = "NoteCreateActivity"; private String serverUrl = "http://devweb.bcs-gis.com/arcgis/rest/services/SITREP_Notes2/FeatureServer/0/addFeatures"; ā€¦ String attrString = ",'attributes':{"; attrString = attrString + "'TYPE':'" + type + "'," + "'RPTDATETIME':'" + reportdatetime + "', " + "'SUMMARY':'" + comments + "'"; attrString = attrString + "}"; String coordString = "[{'geometry':{"; coordString = coordString + "'x':" + loc.getLongitude() + ",'y':" + loc.getLatitude(); coordString = coordString + "}" + attrString + "}]"; HttpClienthttpclient = new DefaultHttpClient(); HttpPosthttppost = new HttpPost(serverUrl); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1); nameValuePairs.add(newBasicNameValuePair("features", coordString)); httppost.setEntity(newUrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request httpResponse = httpclient.execute(httppost); ā€¦ }
  • 17. Demoā€¦ Sneak Peek ofApp Built w/ ArcGIS for Android API
  • 19. Want More Information? http://developer.android.com http://resources.arcgis.com/content/arcgis-android/about WROX Book: Professional Android 2 Application Development (Meier) ISBN#: 978-0-470-56552-0 jtoch@bcs-gis.com twitter.com/jtochterman