MyLocationOverlaymyLocationOverlay = new MyLocationOverlay(this,map);myLocationOverlay.runOnFirstFix(Runnable r)myLocationOverlay.enableMyLocation()myLocationOverlay.disableMyLocation()
CustomLocationOverlayextend MyLocationOverlay for custom POI icon
POIs on MapViewMyPOIOverlay extends ItemizedOverlay<OverlayItem>similar to ArrayAdapteroverride protected OverlayItem createItem(int i) public int size()boundCenterBottom(Drawable)keep local copy of data in overlay in case you need to showsome info for POI
PermissionsFirst you’ll need permissions INTERNET ACCESS_FINE_LOCATION ACCESS_COARSE_LOCATIONSometimes users complain about FINE_LOCATION.Use only if you really need it.
LocationManagerContext.getSystemService(Context.LOCATION_SERVICE)GPS_PROVIDERNETWORK_PROVIDER (cell tower and Wi-Fi basedlocation)locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, time, distance,locationListener);
GPS more infohttp://developer.android.com/guide/topics/location/obtaining-user-location.htmlhttp://stackoverﬂow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a/3145655#3145655we use this in most of our applications
Camera via Intent Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //extra to save full-image somewhere intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(destination)); destination = new File(Environment.getExternalFilesDir(null),"image.jpg");
Camera via SurfaceHolderfor creating camera applications etc...in 99% cases you don’t need thishttp://developer.android.com/reference/android/hardware/Camera.html
SD card<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />Include an empty ﬁle named .nomedia in your externalﬁles directory (note the dot preﬁx in the ﬁlename). Thiswill prevent Androids media scanner from reading yourmedia ﬁles and including them in apps like Gallery orMusic.
SD cardCheck for presence and availability before using SD String state = Environment.getExternalStorageState(); MEDIA_MOUNTED MEDIA_MOUNTED_READ_ONLY
External folders File getExternalStoragePublicDirectory (String type) DIRECTORY_MUSIC, DIRECTORY_PODCASTS, DIRECTORY_RINGTONES, DIRECTORY_ALARMS, DIRECTORY_NOTIFICATIONS, DIRECTORY_PICTURES, or DIRECTORY_MOVIES gets scanned by media scanner ﬁles aren’t deletes on app uninstall File getExternalFilesDir (String type) doesn’t get scanned by media scanner ﬁles are deleted on app uninstall