IntroductieArcGIS API for Android<br />Marco Wagemakers – Esri Nederland<br />
Inhoud<br />Introductie<br />Android achtergrond informatie<br />ArcGIS forAndroid Development<br />Road ahead<br />
ArcGIS for Android:<br />Public  Beta Feb 2011<br />Final Q2 2011<br />cloud<br />Web<br /><ul><li>visualiseren
maken
beheren
samenwerken
analyseren
ontdekken</li></ul>enterprise<br />Mobile<br />lokaal<br />Desktop<br />Positionering<br />Vollediggeïntegreerd<br />Deskt...
Android?<br />
Functioneeloverzicht<br />Mapping <br />Layers: Map, Tile, Graphic, Feature<br />Callout<br />Functionaliteit (Tasks)<br /...
Ontwikkelenvoor Android<br />Android device<br />Eclipse<br />Dalvik VM<br />Write Java<br />Android SDK<br />Run<br />app...
Layout<br />Android Componenten<br />Activity<br />Activity<br />App<br />View<br />View<br />View<br />View<br />Service<...
Watheeft u nodig?<br />Eclipse – 3.5 or 3.6<br />Android SDK – 2.1, 2.2, 2.3<br />ArcGIS for Android SDK<br />API<br />Ecl...
Een Android project<br />/src<br />Your code<br />/gen<br />Built classes<br />/res<br />Your resources<br />Images<br />S...
Kaartopenen<br />Layout<br />Grootte en positie<br />Tonen attributes (afhankelijk van container)<br />Standaardfunctional...
Hoe voegt u kaartlagen toe in xml<br /><com.esri.android.map.MapView<br />xmlns:android="http://schemas.android.com/apk/re...
Hoe voegt u kaartlagen toe in de code<br />Dynamic map layer<br />	ArcGISDynamicMapServiceLayer sanFranFireInfo = new<br /...
Toevoegen data en kaarten demo<br />
Upcoming SlideShare
Loading in …5
×

Introductie ArcGIS for Android

2,746 views

Published on

Binnenkort is ArcGIS ook beschikbaar voor telefoons met Android. ArcGIS for Android breidt de mogelijkheden van het ArcGIS-platform uit naar de Android. Het bestaat uit een ArcGIS-applicatie, die gratis te downloaden is via de Android Market. Met deze applicatie kan de gebruiker kaarten van de ArcGIS Server of ArcGIS.com bekijken en bewerken. Door gebruik te maken van de API, kunnen ontwikkelaars zelf geogebaseerde applicaties ontwikkelen. The API bevat een plugin op het Eclipse Integrated Development Enviroment, zodat ontwikkelaars snel aan de slag kunnen met ArcGIS voor Android. De presentatie geeft een overzicht van de mogelijkheden van de standaard ArcGIS for Android applicatie en de API. Tijdens de presentatie wordt stap voor stap een case uitgewerkt.
Hiermee wordt duidelijk hoe met de ontwikkel
tools en API gewerkt kan worden. Daarnaast wordt
uitgelegd hoe de ontwikkelaar gebruik kan maken
van de mapping, geocoding en geoprocessing mogelijkheden van ArcGIS Server of ArcGIS Online.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,746
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Sits with other mobile apisDemand for a platform solution from customersSimilar in scope to web apisOff cycle – own release cycle benefits?Beta in febFinal – soon!
  • Software stack for mobiles includes os, middleware and key appsHas an SDK – program in Java…Current release in gingerbreadBeta release is Honeycomb lots of work for tablet market
  • To help understand components of android and how it worksDiagram of the development workflow
  • App consists of one or more services AND/OR one or more activitiesService is long running application without GUIActivity provides a screen for users to interact with, multiple activities live in a stack… Has lifecycle to hook into for adding contentAn activity consists of one or more Views. Basic UI units – extended by widgets Button, text, image, date picker Receives eventsVia handlers or listeners- in view and activityData provided to view via data or content providers
  • SDK demo API docs - MapView class, FEatureLayer class Samples doc Other docEclipse demo New application Sample application Add a map layer
  • Samples use a fill parent
  • Map viewInit extentTiled layerDynamic layerGraphics layerFeature layer – includes mode
  • SDK demo API docs - MapView class, FEatureLayer class Samples doc Other docEclipse demo New application – called test New Sample application Add a map layer using right click
  • UX is the majority of the code ( input and output)Esri task code not muchTasksEquate to tasks in the other apis
  • MapView events – interactive People expect to be able to touch the map and it do something
  • First way is to get data from layers in the mapOncalljback – convert data into information!
  • No server callsNo attribute queriesOnce you have the graphic get attributes and show to the user
  • Second way to get data ….Asynchronous – can run in many waysThreading…Query – single layer – attribute and spatialIdentify multiple layersLocatorsgeocode and reverse geocodeGP anything! Models soes etc…
  • Async task shown todayUI thread anything which modifies the view must be run in UI thread, exceptionOthers options for refMore in advanced session
  • Implement AsyncTaskParameterised using generics - Inputs, progress, resultDo in background runs in background
  • Convert the data into informationGet out paramsCheck nullGet GP param name
  • Get callout from the mapjSet style using xml, attributeset valur pairSet anchor floating or explicitly (left right top etc…)Show at pointCan move and set point
  • Attributes – optional don’t need for adding a symbol to the mapGeometry – need this!Symbol – needIn this example geometry comes from a gprecordset layer
  • Introductie ArcGIS for Android

    1. 1. IntroductieArcGIS API for Android<br />Marco Wagemakers – Esri Nederland<br />
    2. 2. Inhoud<br />Introductie<br />Android achtergrond informatie<br />ArcGIS forAndroid Development<br />Road ahead<br />
    3. 3. ArcGIS for Android:<br />Public Beta Feb 2011<br />Final Q2 2011<br />cloud<br />Web<br /><ul><li>visualiseren
    4. 4. maken
    5. 5. beheren
    6. 6. samenwerken
    7. 7. analyseren
    8. 8. ontdekken</li></ul>enterprise<br />Mobile<br />lokaal<br />Desktop<br />Positionering<br />Vollediggeïntegreerd<br />Desktop, web, mobiel<br />ArcGIS Mobile<br />Microsoft Windows<br />Applicatie / SDK <br />ArcGIS for SmartPhone<br />ArcGIS for iOS<br />ArcGIS for Windows phone<br />ArcGIS for Android<br />Applicatie<br />API<br />
    9. 9. Android?<br />
    10. 10. Functioneeloverzicht<br />Mapping <br />Layers: Map, Tile, Graphic, Feature<br />Callout<br />Functionaliteit (Tasks)<br />Identify, Query, Locator, Geoprocessor<br />Editing<br />Template-based, vergelijkbaar met andere web APIs<br />Connected via feature layer<br />
    11. 11. Ontwikkelenvoor Android<br />Android device<br />Eclipse<br />Dalvik VM<br />Write Java<br />Android SDK<br />Run<br />app<br />Compile to <br />Dalvik classes<br />Launch as <br />Android app<br />Android app <br />framework<br />Deploy to<br />device/emulator<br />Debug/log<br />app<br />
    12. 12. Layout<br />Android Componenten<br />Activity<br />Activity<br />App<br />View<br />View<br />View<br />View<br />Service<br />Service<br />Event <br />Listeners / <br />Handlers<br />Data / <br />Content <br />Providers<br />Event <br />Listeners / <br />Handlers<br />Event <br />Listeners / <br />Handlers<br />
    13. 13. Watheeft u nodig?<br />Eclipse – 3.5 or 3.6<br />Android SDK – 2.1, 2.2, 2.3<br />ArcGIS for Android SDK<br />API<br />Eclipse plugin<br />Samples<br />Doc<br />
    14. 14. Een Android project<br />/src<br />Your code<br />/gen<br />Built classes<br />/res<br />Your resources<br />Images<br />Styles xml<br />Layout xml<br />AndroidManifest.xml<br />Application configuration<br />
    15. 15. Kaartopenen<br />Layout<br />Grootte en positie<br />Tonen attributes (afhankelijk van container)<br />Standaardfunctionaliteit<br />Touch events – in/uitzoomen, schuiven<br />Maatwerkfunctionaliteit<br />Toevoegen van event listeners en handlers<br />Initialisatie<br />Controle of de kaart is geladen<br />Meer later…<br />
    16. 16. Hoe voegt u kaartlagen toe in xml<br /><com.esri.android.map.MapView<br />xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map”android:layout_width="fill_parent" android:layout_height="fill_parent”<br />initExtent="-13631799.97888788 4545982.2729670685 13630011.658698952<br /> 4547213.547551089"><br /><com.esri.android.map.ags.ArcGISTiledMapServiceLayer<br />url="http://services.arcgisonline.com/ArcGIS/rest/services/ World_Topo_Map/MapServer" /><br /><com.esri.android.map.ags.ArcGISDynamicMapServiceLayer<br />url="http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/ services/SanFranFireInfo/MapServer" /><br /><com.esri.android.map.GraphicsLayer<br />android:id="@+id/graphics" /><br /><com.esri.android.map.ags.ArcGISFeatureLayer<br />url="http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/ services/HaightAshburyHydrantsFs/FeatureServer"<br />mode="snapshot" /><br />
    17. 17. Hoe voegt u kaartlagen toe in de code<br />Dynamic map layer<br /> ArcGISDynamicMapServiceLayer sanFranFireInfo = new<br /> ArcGISDynamicMapServiceLayer(this, <br />"http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/services/ SanFranFireInfo/MapServer");<br />map.addLayer(sanFranFireInfo);<br />FeatureLayer<br />ArcGISFeatureLayer.OptionssanFranHydrantsOptions = new<br />ArcGISFeatureLayer.Options();<br />sanFranHydrantsOptions.mode = ArcGISFeatureLayer.MODE.SNAPSHOT;<br />ArcGISFeatureLayersanFranHydrants = newArcGISFeatureLayer(this, <br />"http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/services/ HaightAshburyHydrantsFs/FeatureServer", sanFranHydrantsOptions);<br />map.addLayer(sanFranHydrants);<br />
    18. 18. Toevoegen data en kaarten demo<br />
    19. 19. Informatiegeen Data<br />Data omzettennaarInformatie<br />Gebruikerservaringen<br />Verzamelgegevens<br />Uitvoeren van de functionaliteit<br />Toont de uiteindelijkeinformatie en NIET alleen data<br />Taken<br />Query, Identify, Locators, Geoprocessor<br />
    20. 20. Verzamelengegevens<br />MapView click event listeners<br />setOnExtentChangedListener()<br />setOnSingleTapListener()<br />… (zoom, pinch, pan, longPress)<br /> Android View event listeners<br />onClick, onTouch (caution!)<br />Buttons<br />Search<br />Android default action<br />picture<br />
    21. 21. Verkrijgen van data uit de lagen in de kaart<br />All asynchronous methods<br />Denkna over de processen…<br />Feature layer queries<br />selectFeatures()<br />queryFeatures()<br />GebruikCallbackListener<FeatureSet>() <br /> Query query = new Query();<br />query.setWhere(whereClause);<br />sanFranHydrants.selectFeatures(query, SELECTION_METHOD.NEW, newCallbackListener<FeatureSet>() {<br />publicvoidonCallback(FeatureSetqueryResults) {<br /> ...<br />
    22. 22. Queries op grafischelagen<br />Nietasync<br />Feature layer is a graphics layer!<br /> Graphic[] graphics = sanFranHydrants.getGraphics(x, y, 30);<br />
    23. 23. OverigeFuncties<br />Type Functies<br />QueryTask<br />Werkt op een layer<br />IdentifyTask<br />Werkt in eenkaart<br />Locators<br />ArcGIS Server<br />Bing<br />Geoprocessor (GP)<br />ArcGIS Server services<br />
    24. 24. Optiesvooractievefunctionaliteiten<br />VergelijkbaaralseenAsyncTask<br />Continuproces<br />In eenafzonderlijk/anderandereproces<br />Resultaatgetoond in de UI<br />TaskListener<br />Alleen Tasks (niet in locators/GP)<br />ExecutorService<br />Alleen Tasks (aanroepbaar<V>)<br />Android service<br />Processen<br />
    25. 25. EenAsync GP Task – doInBackground()<br /> classHydrantQueryextends<br />AsyncTask<ArrayList<GPParameter>, Void, GPParameter[]> {<br />GPParameter[] outParams = null;<br />@Override<br />protectedGPParameter[] doInBackground(<br />ArrayList<GPParameter>... params1) {<br />gp = newGeoProcessor(getString(R.string.geocodeService1));<br />gp.setOutSR(map.getSpatialReference().getID());<br />try {<br />GPResultResourcegprr = gp.execute(params1[0]);<br />outParams = gprr.getOutputParameters();<br /> } catch (Exception e) {<br />e.printStackTrace();<br /> }<br />returnoutParams;<br /> }<br />
    26. 26. EenAsync GP Task – onPostExecute()<br />Toont het resultaat…<br /> @Override<br />protectedvoidonPostExecute(GPParameter[] result) {<br />if (outParams == null) {<br />uiHandler.sendEmptyMessage(CANCEL_LOADING_WINDOW);<br />return;<br /> } else {<br />for (inti = 0; i < outParams.length; i++) {<br />if (outParams[i] instanceofGPFeatureRecordSetLayer) {<br />GPFeatureRecordSetLayerfsl = <br /> (GPFeatureRecordSetLayer) outParams[i];<br />if (fsl.getParamName().equals("Routes")) {<br /> ...<br />
    27. 27. Tonen resultaten in eenkaart callout<br />Eén callout per kaart<br />Bepalentekststijl<br />Bepaleninhoud<br />Text of Android View/ViewGroup<br />TextViewmsg = newTextView(this);<br />msg.setBackgroundColor(Color.BLACK);<br />msg.setText(address);<br />msg.setTextSize(12);<br />msg.setTextColor(Color.WHITE);<br />Callout callout = map.getCallout();<br />callout.setAnchor(Callout.ANCHOR_POSITION_FLOATING);<br />callout.setStyle(R.xml.calloutstyle);<br />callout.refresh();<br />callout.show(addressPoint, msg);<br />
    28. 28. Toevoegen Graphics<br />Attributes (optioneel)<br />Geometrie<br />Symbologie<br /> Graphic g = new Graphic();<br /> Graphic nearestRoute = fsl.getGraphics().get(0);<br />g.setGeometry(nearestRoute.getGeometry());<br />SimpleLineSymbolsymb = newSimpleLineSymbol(<br /> Color.DKGRAY, 2);<br /> symb.setAlpha(170);<br /> symb.setAntiAlias(true);<br /> g.setSymbol(symb);<br />graphicsLayer.addGraphic(g);<br />
    29. 29. Road ahead<br />ArcGIS for Smartphone dezelfdefunctionaliteit<br />Volgende release<br />Q2 2011<br />Includes<br />Meer layer types (bing/image server)<br />Secure services<br />En daarna<br />VolgtWebmap support….<br />Disconnected workflows<br />
    30. 30. Vragen & Aanvullendeinformatie<br />http://betacommunity.esri.com<br />http://resources.arcgis.com/content/arcgis-android/api<br />Marco Wagemakers – mwagemakers@esri.nl<br />

    ×