From 196871da73ea6a987168367d23524d4bf1207edd Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 20 Sep 2016 18:14:25 -0400 Subject: [PATCH 1/2] moved account manager to each example --- .../java/com/mapbox/mapboxandroiddemo/MainActivity.java | 3 --- .../examples/annotations/AnimatedCircleMarkerActivity.java | 7 +++++++ .../examples/annotations/AnimatedMarkerActivity.java | 7 +++++++ .../examples/annotations/BasicMarkerViewActivity.java | 7 +++++++ .../examples/annotations/CustomInfoWindowActivity.java | 7 +++++++ .../examples/annotations/DrawCustomMarkerActivity.java | 7 +++++++ .../examples/annotations/DrawGeojsonLineActivity.java | 7 +++++++ .../examples/annotations/DrawMarkerActivity.java | 7 +++++++ .../examples/annotations/DrawPolygonActivity.java | 7 +++++++ .../examples/basics/MapboxMapOptionActivity.java | 6 ++++++ .../examples/basics/SimpleMapViewActivity.java | 7 +++++++ .../examples/basics/SupportMapFragmentActivity.java | 5 +++++ .../examples/camera/AnimateMapCameraActivity.java | 7 +++++++ .../examples/camera/BoundingBoxCameraActivity.java | 7 +++++++ .../examples/location/AnimatedLocationIconActivity.java | 7 +++++++ .../examples/location/BasicUserLocation.java | 7 +++++++ .../examples/location/CustomizeUserLocationActivity.java | 7 +++++++ .../examples/location/LocationTrackingActivity.java | 7 +++++++ .../mapboxandroiddemo/examples/mas/DirectionsActivity.java | 6 ++++++ .../mapboxandroiddemo/examples/mas/GeocodingActivity.java | 6 ++++++ .../examples/mas/MapMatchingActivity.java | 6 ++++++ .../examples/mas/SimplifyPolylineActivity.java | 7 +++++++ .../examples/mas/StaticImageActivity.java | 6 ++++++ .../examples/offline/OfflineManagerActivity.java | 7 +++++++ .../examples/offline/SimpleOfflineMapActivity.java | 7 +++++++ .../examples/query/FeatureCountActivity.java | 7 +++++++ .../examples/query/QueryFeatureActivity.java | 7 +++++++ .../examples/query/SelectBuildingActivity.java | 7 +++++++ .../examples/styles/AddWmsSourceActivity.java | 7 +++++++ .../examples/styles/AdjustLayerOpacityActivity.java | 7 +++++++ .../examples/styles/ColorSwitcherActivity.java | 7 +++++++ .../examples/styles/CreateHeatmapPointsActivity.java | 7 +++++++ .../examples/styles/CustomRasterStyleActivity.java | 7 +++++++ .../examples/styles/DefaultStyleActivity.java | 7 +++++++ .../examples/styles/GeojsonLayerInStackActivity.java | 7 +++++++ .../examples/styles/LanguageSwitchActivity.java | 7 +++++++ .../examples/styles/LineLayerActivity.java | 7 +++++++ .../examples/styles/MapboxStudioStyleActivity.java | 7 +++++++ .../examples/styles/SatelliteStyleActivity.java | 7 +++++++ .../examples/styles/ShowHideLayersActivity.java | 7 +++++++ .../examples/styles/VectorSourceActivity.java | 7 +++++++ .../examples/styles/ZoomDependentFillColorActivity.java | 7 +++++++ .../mapboxandroiddemo/labs/LandUseStylingActivity.java | 7 +++++++ .../mapboxandroiddemo/labs/LocationPickerActivity.java | 7 +++++++ .../labs/MarkerFollowingRouteActivity.java | 7 +++++++ .../mapbox/mapboxandroiddemo/labs/OffRouteActivity.java | 6 ++++++ .../labs/SpaceStationLocationActivity.java | 7 +++++++ 47 files changed, 314 insertions(+), 3 deletions(-) diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java index 3408bd18a..b5549c3fd 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java @@ -87,9 +87,6 @@ protected void onCreate(Bundle savedInstanceState) { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); - // Mapbox access token is configured here. - MapboxAccountManager.start(this, getString(R.string.access_token)); - exampleItemModel = new ArrayList<>(); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedCircleMarkerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedCircleMarkerActivity.java index 56a9b727c..133b63f2a 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedCircleMarkerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedCircleMarkerActivity.java @@ -10,6 +10,7 @@ import android.view.View; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.MarkerView; @@ -27,6 +28,12 @@ public class AnimatedCircleMarkerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_animated_circle_marker); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedMarkerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedMarkerActivity.java index 6c5f75c54..4bfb7d782 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedMarkerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/AnimatedMarkerActivity.java @@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -22,6 +23,12 @@ public class AnimatedMarkerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_animated_marker); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/BasicMarkerViewActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/BasicMarkerViewActivity.java index 38aedf1ae..be2d8a40d 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/BasicMarkerViewActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/BasicMarkerViewActivity.java @@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; @@ -21,6 +22,12 @@ public class BasicMarkerViewActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_basic_marker_view); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/CustomInfoWindowActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/CustomInfoWindowActivity.java index bb60c0397..f737aece1 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/CustomInfoWindowActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/CustomInfoWindowActivity.java @@ -11,6 +11,7 @@ import android.widget.LinearLayout; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -25,6 +26,12 @@ public class CustomInfoWindowActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_custom_info_window); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawCustomMarkerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawCustomMarkerActivity.java index 360d3a92c..5bac82c8c 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawCustomMarkerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawCustomMarkerActivity.java @@ -6,6 +6,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.MarkerOptions; @@ -21,6 +22,12 @@ public class DrawCustomMarkerActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_custom_marker); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java index c8798e9b1..2d204c015 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawGeojsonLineActivity.java @@ -8,6 +8,7 @@ import android.util.Log; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.PolylineOptions; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -34,6 +35,12 @@ public class DrawGeojsonLineActivity extends AppCompatActivity implements OnMapR @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_geojson_line); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawMarkerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawMarkerActivity.java index 710917f10..f9f075eea 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawMarkerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawMarkerActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.MarkerOptions; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -17,6 +18,12 @@ public class DrawMarkerActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_marker); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawPolygonActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawPolygonActivity.java index d6996903e..0309b8e90 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawPolygonActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/annotations/DrawPolygonActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.PolygonOptions; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -21,6 +22,12 @@ public class DrawPolygonActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_annotation_polygon); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/MapboxMapOptionActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/MapboxMapOptionActivity.java index 1026fa6c3..b43da6b2b 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/MapboxMapOptionActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/MapboxMapOptionActivity.java @@ -3,6 +3,8 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; +import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -19,6 +21,10 @@ public class MapboxMapOptionActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + MapboxMapOptions options = new MapboxMapOptions() .styleUrl(Style.OUTDOORS) .camera(new CameraPosition.Builder() diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SimpleMapViewActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SimpleMapViewActivity.java index f32387c34..aba949ce6 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SimpleMapViewActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SimpleMapViewActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -15,6 +16,12 @@ public class SimpleMapViewActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_basic_simple_mapview); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SupportMapFragmentActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SupportMapFragmentActivity.java index ca77fc430..cbf714e3c 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SupportMapFragmentActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/basics/SupportMapFragmentActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.constants.Style; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -20,6 +21,10 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_basic_support_map_frag); + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + // Create supportMapFragment SupportMapFragment mapFragment; if (savedInstanceState == null) { diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/AnimateMapCameraActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/AnimateMapCameraActivity.java index ff083f2da..0338ae720 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/AnimateMapCameraActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/AnimateMapCameraActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -19,6 +20,12 @@ public class AnimateMapCameraActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_camera_animate); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/BoundingBoxCameraActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/BoundingBoxCameraActivity.java index 5872b75ab..75bdfb404 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/BoundingBoxCameraActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/camera/BoundingBoxCameraActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; @@ -19,6 +20,12 @@ public class BoundingBoxCameraActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_camera_bounding_box); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/AnimatedLocationIconActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/AnimatedLocationIconActivity.java index fafc11c33..56b1f06fc 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/AnimatedLocationIconActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/AnimatedLocationIconActivity.java @@ -21,6 +21,7 @@ import com.mapbox.mapboxandroiddemo.R; import com.mapbox.mapboxandroiddemo.model.PulseMarkerView; import com.mapbox.mapboxandroiddemo.model.PulseMarkerViewOptions; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.MarkerView; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -56,6 +57,12 @@ public class AnimatedLocationIconActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_location_animated_icon); locationServices = LocationServices.getLocationServices(AnimatedLocationIconActivity.this); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/BasicUserLocation.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/BasicUserLocation.java index fb59f188b..f7b172daf 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/BasicUserLocation.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/BasicUserLocation.java @@ -11,6 +11,7 @@ import android.view.View; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.location.LocationListener; @@ -32,6 +33,12 @@ public class BasicUserLocation extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_location_basic); locationServices = LocationServices.getLocationServices(BasicUserLocation.this); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/CustomizeUserLocationActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/CustomizeUserLocationActivity.java index 74f43aeea..542780ae3 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/CustomizeUserLocationActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/CustomizeUserLocationActivity.java @@ -10,6 +10,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -30,6 +31,12 @@ public class CustomizeUserLocationActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_location_customize_user); locationServices = LocationServices.getLocationServices(CustomizeUserLocationActivity.this); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/LocationTrackingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/LocationTrackingActivity.java index 6495b0bbb..cdb632119 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/LocationTrackingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/location/LocationTrackingActivity.java @@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.constants.MyBearingTracking; import com.mapbox.mapboxsdk.constants.MyLocationTracking; import com.mapbox.mapboxsdk.location.LocationServices; @@ -26,6 +27,12 @@ public class LocationTrackingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_location_tracking); locationServices = LocationServices.getLocationServices(LocationTrackingActivity.this); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java index 7dfa3f259..96498bf7c 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/DirectionsActivity.java @@ -40,6 +40,12 @@ public class DirectionsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_mas_directions); // Alhambra landmark in Granada, Spain. diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/GeocodingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/GeocodingActivity.java index a8e74d81f..4d50ae0fd 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/GeocodingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/GeocodingActivity.java @@ -25,6 +25,12 @@ public class GeocodingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_mas_geocoding); // Set up the MapView diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java index 068a36917..ccd671869 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/MapMatchingActivity.java @@ -45,6 +45,12 @@ public class MapMatchingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_mas_map_matching); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/SimplifyPolylineActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/SimplifyPolylineActivity.java index c7dc04a06..f18e016a2 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/SimplifyPolylineActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/SimplifyPolylineActivity.java @@ -8,6 +8,7 @@ import android.util.Log; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.PolylineOptions; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -36,6 +37,12 @@ public class SimplifyPolylineActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_simplify_polyline); mapView = (MapView) findViewById(R.id.mapview); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/StaticImageActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/StaticImageActivity.java index ba3c09fb6..3a87a2bd6 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/StaticImageActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/mas/StaticImageActivity.java @@ -27,6 +27,12 @@ public class StaticImageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_mas_static_image); ImageView imageView = (ImageView) findViewById(R.id.mapImage); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/OfflineManagerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/OfflineManagerActivity.java index 1af624c08..e007f8fc9 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/OfflineManagerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/OfflineManagerActivity.java @@ -12,6 +12,7 @@ import android.widget.Toast; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraPosition; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLngBounds; @@ -54,6 +55,12 @@ public class OfflineManagerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_offline_manager); // Set up the MapView diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/SimpleOfflineMapActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/SimpleOfflineMapActivity.java index e8ddd2751..7614e9709 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/SimpleOfflineMapActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/offline/SimpleOfflineMapActivity.java @@ -8,6 +8,7 @@ import android.widget.Toast; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.geometry.LatLngBounds; import com.mapbox.mapboxsdk.maps.MapView; @@ -37,6 +38,12 @@ public class SimpleOfflineMapActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_offline_simple); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/FeatureCountActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/FeatureCountActivity.java index 8db6fe888..1657dd709 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/FeatureCountActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/FeatureCountActivity.java @@ -8,6 +8,7 @@ import android.view.View; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -27,6 +28,12 @@ public class FeatureCountActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_query_feature_count); // Define our views, ones the center box and the others our view container used for the diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/QueryFeatureActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/QueryFeatureActivity.java index c33399620..4da9da47d 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/QueryFeatureActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/QueryFeatureActivity.java @@ -7,6 +7,7 @@ import com.google.gson.JsonElement; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Marker; import com.mapbox.mapboxsdk.annotations.MarkerViewOptions; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -26,6 +27,12 @@ public class QueryFeatureActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_query_feature); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/SelectBuildingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/SelectBuildingActivity.java index 88bedc2ef..e3b2ada60 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/SelectBuildingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/query/SelectBuildingActivity.java @@ -8,6 +8,7 @@ import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.PolygonOptions; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -28,6 +29,12 @@ public class SelectBuildingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_query_select_building); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AddWmsSourceActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AddWmsSourceActivity.java index 0da7d734c..27ff4dcaa 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AddWmsSourceActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AddWmsSourceActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -19,6 +20,12 @@ public class AddWmsSourceActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_add_wms_source); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AdjustLayerOpacityActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AdjustLayerOpacityActivity.java index 162a71ad8..dd859e29a 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AdjustLayerOpacityActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/AdjustLayerOpacityActivity.java @@ -6,6 +6,7 @@ import android.widget.TextView; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -24,6 +25,12 @@ public class AdjustLayerOpacityActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_adjust_layer_opacity); final SeekBar opacitySeekBar = (SeekBar) findViewById(R.id.seek_bar_layer_opacity); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ColorSwitcherActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ColorSwitcherActivity.java index 3e0db9897..7062c9218 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ColorSwitcherActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ColorSwitcherActivity.java @@ -9,6 +9,7 @@ import android.widget.Spinner; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -26,6 +27,12 @@ public class ColorSwitcherActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_color_switcher); final SeekBar redSeekBar = (SeekBar) findViewById(R.id.red_seek_bar); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CreateHeatmapPointsActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CreateHeatmapPointsActivity.java index b381e0999..dcc4f3283 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CreateHeatmapPointsActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CreateHeatmapPointsActivity.java @@ -6,6 +6,7 @@ import android.util.Log; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -30,6 +31,12 @@ public class CreateHeatmapPointsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_create_heatmap_points); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CustomRasterStyleActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CustomRasterStyleActivity.java index 3bc68526a..da1d1a94e 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CustomRasterStyleActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/CustomRasterStyleActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -15,6 +16,12 @@ public class CustomRasterStyleActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_raster); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/DefaultStyleActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/DefaultStyleActivity.java index 75071498f..63c010666 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/DefaultStyleActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/DefaultStyleActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -15,6 +16,12 @@ public class DefaultStyleActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_default); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/GeojsonLayerInStackActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/GeojsonLayerInStackActivity.java index 5e027e17e..a83faba71 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/GeojsonLayerInStackActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/GeojsonLayerInStackActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -24,6 +25,12 @@ public class GeojsonLayerInStackActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_geojson_layer_in_stack); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LanguageSwitchActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LanguageSwitchActivity.java index 6813b6e74..58d039935 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LanguageSwitchActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LanguageSwitchActivity.java @@ -6,6 +6,7 @@ import android.view.MenuItem; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -21,6 +22,12 @@ public class LanguageSwitchActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_language_switch); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LineLayerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LineLayerActivity.java index 261ebe861..bdc039ada 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LineLayerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/LineLayerActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -29,6 +30,12 @@ public class LineLayerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_line_layer); // Create a list to store our line coordinates. diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/MapboxStudioStyleActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/MapboxStudioStyleActivity.java index 00770b6e2..149f80e17 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/MapboxStudioStyleActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/MapboxStudioStyleActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -15,6 +16,12 @@ public class MapboxStudioStyleActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_mapbox_studio); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteStyleActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteStyleActivity.java index c8acca239..a796f5d4a 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteStyleActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/SatelliteStyleActivity.java @@ -4,6 +4,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -15,6 +16,12 @@ public class SatelliteStyleActivity extends AppCompatActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_satellite); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ShowHideLayersActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ShowHideLayersActivity.java index 85f249d55..5e60c8ca4 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ShowHideLayersActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ShowHideLayersActivity.java @@ -7,6 +7,7 @@ import android.view.View; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -29,6 +30,12 @@ public class ShowHideLayersActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_show_hide_layers); floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_layer_toggle); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/VectorSourceActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/VectorSourceActivity.java index 295a2a870..4bc56b1cb 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/VectorSourceActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/VectorSourceActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -24,6 +25,12 @@ public class VectorSourceActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_vector_style); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ZoomDependentFillColorActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ZoomDependentFillColorActivity.java index 0d6046331..41324f521 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ZoomDependentFillColorActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/styles/ZoomDependentFillColorActivity.java @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; @@ -23,6 +24,12 @@ public class ZoomDependentFillColorActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_style_zoom_dependent_fill_color); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LandUseStylingActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LandUseStylingActivity.java index 08b7d3d4f..ce8022ef7 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LandUseStylingActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LandUseStylingActivity.java @@ -9,6 +9,7 @@ import com.getbase.floatingactionbutton.FloatingActionButton; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; @@ -25,6 +26,12 @@ public class LandUseStylingActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_lab_land_use_styling); mapView = (MapView) findViewById(R.id.mapView); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LocationPickerActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LocationPickerActivity.java index a41040737..a1b983c75 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LocationPickerActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/LocationPickerActivity.java @@ -19,6 +19,7 @@ import android.widget.ImageView; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.Marker; @@ -61,6 +62,12 @@ public class LocationPickerActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_navigation_location_picker); // Get the location services object for later use. diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/MarkerFollowingRouteActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/MarkerFollowingRouteActivity.java index 5355ba016..2f07b2afe 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/MarkerFollowingRouteActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/MarkerFollowingRouteActivity.java @@ -15,6 +15,7 @@ import android.view.animation.LinearInterpolator; import com.mapbox.mapboxandroiddemo.R; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.Marker; @@ -50,6 +51,12 @@ public class MarkerFollowingRouteActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_lab_marker_following_route); // Initialize the map view diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/OffRouteActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/OffRouteActivity.java index 44ea93a67..2925f1d7b 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/OffRouteActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/OffRouteActivity.java @@ -74,6 +74,12 @@ public class OffRouteActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_lab_off_route); mapView = (MapView) findViewById(R.id.mapview); diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/SpaceStationLocationActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/SpaceStationLocationActivity.java index 5e5f657e1..8b7798490 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/SpaceStationLocationActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/labs/SpaceStationLocationActivity.java @@ -13,6 +13,7 @@ import com.mapbox.mapboxandroiddemo.R; import com.mapbox.mapboxandroiddemo.model.IssModel; +import com.mapbox.mapboxsdk.MapboxAccountManager; import com.mapbox.mapboxsdk.annotations.Icon; import com.mapbox.mapboxsdk.annotations.IconFactory; import com.mapbox.mapboxsdk.annotations.MarkerView; @@ -53,6 +54,12 @@ public class SpaceStationLocationActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + // Mapbox access token is configured here. This needs to be called either in your application + // object or in the same activity which contains the mapview. + MapboxAccountManager.start(this, getString(R.string.access_token)); + + // This contains the MapView in XML and needs to be called after the account manager setContentView(R.layout.activity_lab_space_station_location); // Initialize the map view From a838d1bcbfc2bacdc4056ee022a9967ba3c9b70f Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 21 Sep 2016 10:16:12 -0400 Subject: [PATCH 2/2] fixed checkstyle issue --- .../main/java/com/mapbox/mapboxandroiddemo/MainActivity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java index b5549c3fd..1f5544261 100644 --- a/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java +++ b/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/MainActivity.java @@ -68,7 +68,6 @@ import com.mapbox.mapboxandroiddemo.labs.SpaceStationLocationActivity; import com.mapbox.mapboxandroiddemo.model.ExampleItemModel; import com.mapbox.mapboxandroiddemo.utils.ItemClickSupport; -import com.mapbox.mapboxsdk.MapboxAccountManager; import java.util.ArrayList; @@ -148,7 +147,7 @@ public void onBackPressed() { } @Override - public boolean onNavigationItemSelected(MenuItem item) { + public boolean onNavigationItemSelected(@NonNull MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId();