in your manifest Storage behavior for when your app runs on Q / 10 if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && Environment.isExternalStorageLegacy())
MediaStore to index it - using MediaScannerConnection Now - use insert() on ContentResolver - returns Uri ContentValues that you wish to add DISPLAY_NAME and MIME_TYPE Android Q / 10 also offers RELATIVE_PATH - controlling where the media goes on the device.
up with three basic options in terms of granting rights to your app: • Unfettered access to location • “Only while the app is in use”, which translates to “only while the app has UI in the foreground” • No access at all
Orientation > Geotagged - EXIF Tags > MediaStore - Acc to Documentation - Your app needs to hold the ACCESS_MEDIA_LOCATION permission (which is dangerous and needs to go through runtime permissions) - Your app needs to call MediaStore.setRequireOriginal(), supplying the Uri for which you would like the location — this method then returns a decorated Uri that can be used with openInputStream()
are Banned - Foreground service cannot startActivity() - Pending Intent tied to a Notification can startActivity() Alternative > High importance - high priority Notification > setFullScreenIntent(pi, true) > You need to request the USE_FULL_SCREEN_INTENT permission.
Class.forName(), getConstructor(), getField() - StrictMode > SYSTEM_ALERT_WINDOW Restrictions > Background Clipboard Access Banned, unless - They are the default input method editor, or - They are “the app that currently has focus”
DownloadManager Deprecations - addCompletedDownload() - allowScanningByMediaScanner() on DownloadManager.Request - setVisibleInDownloadsUi() on DownloadManager.Request > More Densities - 140, 180, 200, 220 - Only care if DENSITY_ constants on DisplayMetrics
EditTextPreference, ListPreference) > ACTION_SEND Previews - Add EXTRA_TITLE to the ACTION_SEND Intent, with some text to appear as the title of the preview - Add a ClipData to the ACTION_SEND Intent, via setClipData(), that represents the image to show as part of the preview
You need to have stuff in the manifest to be eligible for it - You need to have code to detect if you have the role — and if not, to ask the user to grant you the role - The user can grant or revoke roles at any point (e.g., via the Settings app) - The role helps determine what your app can do - Only a single app can have it
- <intent-filter> - <category android:name="android.intent.category.DEFAULT" />, to declare your wish to be the default app for the role - A second <category> element tied to the specific role - isRoleAvailable() - isRoleHeld() - createRequestRoleIntent()