building mobile cross-platform geospatial apps, nick landry

34
Building Mobile Cross-Platform Geospatial Apps with C# By Nick Landry, MVP Senior Product Manager – Infragistics [email protected] @ActiveNick – www.ActiveNick.net

Upload: xamarin

Post on 10-May-2015

1.431 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Building Mobile Cross-Platform Geospatial Apps with C# By Nick Landry, MVP Senior Product Manager – Infragistics [email protected] @ActiveNick – www.ActiveNick.net

Page 2: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Who is ActiveNick? •  Senior  Product  Manager,  Mobile  &  Data  Visualiza8on  Developer  Tools  –  

Infragis8cs  •  Microso?  MVP:  Windows  Phone  Development  

–  Mobile  Publisher  –  Big  Bald  Apps:  h"p://bit.ly/bbawp  •  Speaker.  Blogger.  Author.  Tweeter.  Gamer  •  20+  Years  of  Professional  Experience  •  Special8es:  

–  Mobile  Development  –  Loca8on  Intelligence  &  Geospa8al  Systems  –  Data  Visualiza8on,  HPC,  Cloud  –  Mobile  Game  Development  

•  Blog:  www.Ac1veNick.net  •  TwiTer:  @Ac1veNick    

Page 3: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Disclaimers & Assumptions •  You  know  the  basics  of  Xamarin  development  •  You’re  a  .NET  developer:  C#  (or  VB.NET),  Visual  Studio,  XAML  •  You  know  some  basics  of  Microso?  device  development:  Windows  8/RT  

or  Windows  Phone  •  You  know  some  basics  about  calling  REST  services  •  You  know  liTle  to  nothing  about  GIS  development  •  You  have  access  to  a  Mac,  and  preferably  an  iPad  or  iPhone  too  •  You  want  to  learn  cross-­‐pla_orm  techniques  &  best  prac8ces  for  mobile  

development  on  iOS,  Android,  Windows  Phone  /  Windows  8  –  I  am  NOT  covering  general  mobile  design  considera8ons  –  I  am  NOT  covering  Hybrid  HTML5  App  Development  (i.e.  PhoneGap)  

Page 4: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Agenda •  Overview  of  the  GIS  World  •  Why  GIS  +  Mobile?  •  Mapping  Imagery  Providers  Across  Pla_orms  •  Geospa8al  Services  •  Cross-­‐Pla_orm  Demo:  MyGIS  •  Geocoding  Services  Demo  •  Q&A  

Page 5: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Mobile Platform Options

Page 6: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

More  than  Maps  &  GPS…  

Overview of the GIS World

Page 7: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

What is GIS? Maps  

(Raster  /  Vector)  

Aerial  /  Satellite  Imagery  

Data  Processing  Geocoding  

Rou8ng  &  Direc8ons  

Spa8al  Data  (Capture,  Storage,  

Search)  

Spa8al  Storage  &  Search  

Repor8ng  &  Analy8cs  

Loca8on  Services  

Page 8: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Maps help you visualize critical business data

Business Intelligence Supply Chain Customer Locations

70-80% of business data has a geospatial component

Why GIS?

Page 9: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Why GIS + Mobile? •  Every  company  that  has  a  web  site  needs  a  map  of  where  their  loca8on  is  •  BeTer  Imagery  and  New  Perspec8ves    •  Personalizing  the  Mapping  Experience  •  Going  Mobile  

–  Mobile  devices  are  loca8on  aware,  generally  smarter  and  more  powerful  –  Mobile  devices  will  overtake  the  PC  –  The  boundary  between  Personal  Naviga8on  Devices  and  Smartphones  is  

blurring  –  Loca8on  Based  Adver8sement  is  becoming  a  reality  

•  New  Emerging  Technologies  and  Techniques  –  Geofencing,  Background  Loca8on-­‐Tracking,  etc.  

Page 10: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Geospatial Services for Developers

Page 11: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Key GIS Players

Microso?  Google  Maps   Nokia  Maps  

TomTom  

Esri  

MapQuest  Apple  Maps   OpenStreetMap  

Page 12: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

About ESRI ArcGIS •  ESRI  ArcGIS  is  a  broad  name  given  to  a  suite  of  GIS  tools  created  by  ESRI  •  Many  of  these  tools  are  designed  to  perform  complex  GIS  opera8ons  

–  ESRI  develops  GIS  so?ware  that  is  used  by  more  than  300,000  organiza8ons  worldwide  

•  Different  flavors  of  ArcGIS  include:  –  Desktop,  Mobile,  Server,  and  Online  

•  ESRI  &  Microso?  have  been  partners  since  1986  •  ArcGIS  built  using  Microso?  Technology  •  Solid  Developer  Support  

–  Map  Controls  on  virtually  every  pla_orm  –  REST  API  for  backend  /  cloud  GIS  services  –  No  Xamarin  bindings  yet…  sadly  

Page 13: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Which Mobile Map Control? Control/Pla<orm   iOS   Android   Windows  8   Windows  Phone  

Google  Maps   SDKXB   YesXB   (Yes,  WinJS)  

Bing  Maps   (Yes,  Old)   (OSS,  JS,  Old)   Yes   Yes  

Esri  ArcGIS   Yes   Yes   Beta   Yes  

Nokia  Maps   Yes,  WP8  

Apple  Maps   YesXB  

OpenStreet   (via  MQ  SDK)   (via  MQ  SDK)   (Yes,  IG,  WinJS)  

MapQuest   SDK   SDK  

XB:  Denotes  the  availability  of  Xamarin.iOS  bindings  

Denotes  a  “na8ve”  mapping  provider  for  this  pla_orm  

Page 14: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

SDK Wars: Apple Maps vs. Google Maps Go

ogle  M

aps   • Data:  Google  

• BeTer  Hybrid  &  Satellite  imagery  • 3D  Buildings  • Semi-­‐transparent  roads  in  hybrid  view  (Apple  Maps  app  too!)  • Rotate  &  Tilt  map  +  Camera  System  • No  8le  overlays  • Performance  capped  at  30fps  • Geocoding,  Direc8ons,  Places  API  • Consistent  across  iOS  &  Android  • App  bundle  increase  by  2-­‐6MB  • Limited  Quotas,  can  be  expensive  • Fast  SDK  updates  &  releases  possible   Ap

ple  Maps   • Data:  TomTom  &  others  

• Opaque  roads  in  hybrid  view  • Supports  gradient  polylines  • Supports  8le  overlays  • Animated  “pin  drop”  (markers)  • Can  automa8cally  move  to  follow  the  user's  loca8on  • Loca8on  Search  API  • BeTer  performance,  smoother  feel  • Proprietary  iOS  experience  • Built-­‐in  SDK,  no  app  size  increase  • Free,  no  quotas!  • Mature  API  (since  iOS  v1.0!)  • More  community  resources  

Comparison  Reference:  hTp://bit.ly/GMapsvsAMaps  

Page 15: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Cross-Platform Solution Design

Client  Pla_orms  

GIS  Providers  

Loca8on  Data   Loca8on  Data  

Google  Maps  

iOS   Android  

Nokia  &  Bing  Maps  

Windows  Phone  

Page 16: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Demo

Overview  of  MyGIS  for  iOS,  Android,  and  Windows  Phone  8  

Page 17: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Google Maps SDK for iOS •  Available  for  free  in  the  Xamarin  Component  Store  

–  Official  iOS  Product  Page:  developers.google.com/maps/documenta8on/ios  •  Google  Maps  imagery  control  

–  Views:  Normal/Road,  Satellite,  Hybrid,  Terrain/Topographic  –  Scroll/Pan,  Zoom,  Rotate  &  Tilt  gestures  –  Programma8cally  control  the  map  camera  –  Supports  Markers,  Info  window,  Polylines,  Overlays  (images)  –  Map  Events:  Camera  change,  Market  Tap,  etc.  

•  Requires  an  API  Key  –  Obtain  at  hTps://code.google.com/apis/console  –  Request  a  key  for  iOS  apps  based  on  bundle  iden8fiers  

Page 18: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Creating a Bing Maps Account 1.  Go  to  hTp://bingmapsportal.com  2.  Select  the  Create  buTon  3.  Sign  in  using  a  Windows  Live  ID  4.  Fill  in  the  form  and  Save  

Page 19: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Creating a Bing Maps Key 1.  Log  into  the  Bing  Maps  Portal  2.  Select  “Create  of  view  keys”  3.  Provide  an  applica8on  name  4.  Select  the  proper  Key  Type  5.  Select  the  proper  Applica8on  Type  6.  Fill  in  the  CAPTCHA  7.  Press  submit  8.  Your  key  will  be  generated  and  displayed  below  

the  form  

Page 20: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Available Geospatial Services

Nomina8m   Geocoding  API:  2,500/day  quota  Places  Search  API:  100K/day  quota  

50K  transac8ons  /  day  for  mobile  5  x  50  batch  

geocoding  /  day  10K/30-­‐days  for  

evalua8on  No  turn-­‐by-­‐turn  

naviga8on  allowed  

All  paid  services  

Page 21: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Demo

Calling  Geocoding  Services  in  C#  Display  Results  on  Google  Maps  

Page 22: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Libraries Referenced in the Demo •  JSON.Net  (iOS,  Android,  Windows  Phone  8)  

–  REST  calls  to  Google  Maps  Geocoder  •  Mapping  Controls  

–  Google  Maps  SDK  for  iOS  –  Google  Maps  Android  API  v2  (part  of  Google  Play  Services  –  Default  Nokia  Maps  Control  (Windows  Phone  8)  

•  Xamarin.Mobile  •  Infragis8cs  NucliOS  IGGridView  (iOS)  

Page 23: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

NucliOS Native iOS Controls

www.infragis8cs.com/ios  

Page 24: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Infragistics NucliOS 13.1 •  Na8ve  Controls  for  iOS  Developers:  Objec8ve  C  or  C#  •  Second  Release  in  April  2013  •  Data  Charts  +  New  Pie  Chart  Control  

–  40  data  chart  types,  composite  charts,  full  data-­‐binding  support  –  13  trend  lines,  10  built-­‐in  data  markers,  legends,  34  financial  indicators  –  Iner8al  zooming  &  panning  in  real  8me  using  mul8-­‐touch  gestures,  with  charts  

showing  over  a  million  data  points  –  Mo8on  Framework  support  for  animated  transi8ons  –  Styling,  themes,  gradients,  gorgeous  charts!  

•  Grid:  Data  or  Layout  –  Can  be  styled  &  templated  to  look  like  almost  anything  –  Grouping,  sor8ng,  insert/remove,  filter,  reorder,  etc.  

•  Radial  Gauges  •  Rich-­‐Text  Label  

Page 25: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

NucliOS Samples Browser •  Available  for  iPad  &  iPhone  today  

–  hTp://bit.ly/igiossb  

Page 26: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Infragistics NucliOS – Grid •  Context  Menu  (Tap  &  Hold)  •  Data  Binding  &  Data  Source  Helper  •  Row  Inser8on  and  Dele8on  •  Column  Inser8on  &  Dele8on  •  Filtering  •  Grouping  &  Sec8on  Headers  •  Pull-­‐down  to  refresh  

•  Column,  Row  &  Cell  Re-­‐ordering  •  Fixed  /  Frozen  Columns  •  Scrolling  Shortcut  •  Infinite  Scrolling  •  Selec8on  •  Shortcut  Bar  •  Star  (  *  )  Sizing  on  Columns  •  Sor8ng  •  Styling  •  Slide  Row  Op8ons  •  Full  Xamarin.iOS  Bindings  

Page 27: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Infragistics NucliOS – Grid

Page 28: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Infragistics NucliOS – Chart Category & Scatter Series Category  Series  •  Area    •  SplineArea    •  Bar    •  Column    •  Line    •  Spline    •  StepArea  •  StepLine    •  Waterfall  •  Point  Range  Category  Series  •  RangeArea    •  RangeColumn  Sca"er  Series  •  ScaTer    •  Bubble      

Financial  Series  •  FinancialPriceSeries  –  Candles8ck  •  FinancialPriceSeries  –  OHLC  Financial  Indicators  •  TypicalPriceIndicator    •  AbsoluteVolumeOscillatorIndicator    •  AverageTrueRangeIndicator    •  Accumula8onDistribu8onIndicator    •  AverageDirec8onalIndexIndicator    Polar  •  PolarLine    •  PolarArea    •  PolarScaTer    Radial  •  RadialColumn    •  RadialLine    •  RadialPie      

13  types  of  trend  lines  built-­‐in  10+  types  of  markers  Animated  data  transi1ons  with  the  Infragis1cs  Mo1on  Framework    More  Features  Coming  in  13.1  (April)  •  Radial  Gauge  Control  •  Pie  Chart  Control  •  Rich-­‐Text  Label  Control  •  17  New  Data  Chart  Series  •  29  New  Financial  Indicators  •  New  Grid  Features  •  MonoTouch  Support  for  All  Controls  •  Japanese  Language  Support  •  New  Samples  Browser  •  New  Samples  

Financial & Scientific Series More Chart Features

28  

Page 29: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Infragistics NucliOS – Chart

Page 30: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Summary and Next Steps…

Get Ready to Become a Cross-Platform Mobile Developer Register  for  a  free  account  at  www.Xamarin.com  Download  Xamarin  Studio,  along  with  Xamarin.iOS  &  Xamarin.Android  Geospatial Development Resources Google  Maps  Developer  Resources:  developers.google.com/maps  Esri  ArcGIS  Developer  Resources:  developers.arcgis.com  Don’t forget Windows Phone & Bing Maps Windows  Phone  Dev  Center:  dev.windowsphone.com  Bing  Maps  Portal:  www.BingMapsPortal.com    Download Additional Resources & Become an Expert Download  NucliOS:  www.infragis1cs.com/ios  NetAdvantage  for  Windows  Phone:  www.Infragis1cs.com/mobile  

30  

1

2

3

4

Page 31: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

More Maps & Location at EVOLVE •  Wednesday  –  1:30PM  

“Mapping  on  iOS  and  Android”  By  Wally  McClure,  in  Crick  Salon  (Level  6)  –  iOS:  Apple  Maps  &  MapKit  API  –  Android:  Google  Maps  for  Android  –  Loca8on  Services  –  Maps,  placing  pins  on  maps  –  Responding  to  events  

Page 32: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

References Links •  Generate  JSON  Parsing  Classes  in  C#:  hTp://json2csharp.com  •  Google  Maps  

–  Google  Maps  Developer  Resources:  developers.google.com/maps  –  Google  APIs  Console:  code.google.com/apis/console  –  Google  Maps  SDK  for  iOS:  developers.google.com/maps/documenta8on/ios  –  Google  Maps  Android  API  v2:    –  Geocoding  API:  developers.google.com/maps/documenta8on/geocoding  

•  OpenStreetMap  (OSM)  –  Nomina8m  Geocoding  Service:    

•  Bing  Maps  –  Management  Portal:  www.bingmapsportal.com  

•  Esri  ArcGIS  –  Esri  ArcGIS  Developer  Center:  developers.arcgis.com  

Page 33: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Recommended GIS Learning References

Page 34: Building Mobile Cross-Platform Geospatial Apps, Nick Landry

Thank You! Slides  and  demos  will  be  posted  on  my  blog  at  www.Ac1veNick.net.    Please  fill-­‐out  an  evalua8on.  Your  feedback  is  important  and  appreciated.    

Facebook: www.facebook.com/infragis8cs  

Blog: www.Ac8veNick.net    Twitter: @Ac8veNick    

Mobile Apps: bit.ly/bbawp  LinkedIn: www.linkedin.com/in/ac8venick  Website: www.infragis8cs.com  

Infragistics Twitter: @infragis8cs  

Email: [email protected]