Android

Páginas: 16 (3878 palabras) Publicado: 9 de enero de 2013
Android 4.2 APIs
API Level: 17 Android 4.2 (JELLY_BEAN_MR1 (/reference/android /os/Build.VERSION_CODES.html#JELLY_BEAN_MR1)) is an update to the Jelly Bean release that offers new features for users and app developers. This document provides an introduction to the most notable and useful new APIs for developers. As an app developer, you should download the Android 4.2 system image and SDKplatform from the SDK Manager (/tools/help/sdk-manager.html) as soon as possible. If you don’t have a device running Android 4.2 on which to test your app, use the Android 4.2 system image to test your app on the Android emulator (/tools/devices/emulator.html). Then build your apps against the Android 4.2 platform to begin using the latest APIs.
IN THIS DOCUMENT Important Behavior Changes DaydreamSecondary Displays Lockscreen Widgets Multiple Users RTL Layout Support Nested Fragments Renderscript

SEE ALSO API Differences Report »

Important Behavior Changes
If you have previously published an app for Android, be aware of the following changes that might affect your app’s behavior: Content providers are no longer exported by default. That is, the default value for the android:exported attributeis now “false". If it’s important that other apps be able to access your content provider, you must now explicitly set android:exported="true". This change takes effect only if you set either android:targetSdkVersion (/guide/topics/manifest/usessdk-element.html#target) or android:minSdkVersion (/guide/topics/manifest /uses-sdk-element.html#min) to 17 or higher. Otherwise, the default value isstill “true" even when running on Android 4.2 and higher. Compared to previous versions of Android, user location results may be less accurate if your app requests the ACCESS_COARSE_LOCATION permission but does not request the ACCESS_FINE_LOCATION permission. To meet the privacy expectations of users when your app requests permission for coarse location (and not fine location), the system will notprovide a user location estimate that’s more accurate than a city block. Some device settings defined by Settings.System are now read-only. If your app attempts to write changes to settings defined in Settings.System that have moved to Settings.Global, the write operation will silently fail when running on Android 4.2 and higher.
Declare your app API Level To better optimize your app for devicesrunning Android 4.2, you should set your targetSdkVersion
(/guide/topics/manifest/usessdk-element.html#target) to "17", install it on an Android 4.2 system image, test it, then publish an update with this change.

You can use APIs in Android 4.2 while also supporting older versions by adding conditions to your code that check for the system API level before executing APIs not supported by yourminSdkVersion (/guide/topics/manifest /uses-sdk-element.html#min). To learn more about maintaining backwardcompatibility, read Creating Backward-Compatible UIs (/training /backward-compatible-ui/index.html). More information about how API levels work is available in What is API Level? (/guide/topics/manifest/usessdk-element.html#ApiLevels)

Even if your value for android:targetSdkVersion(/guide/topics/manifest/uses-sdk-element.html#target) and android:minSdkVersion (/guide/topics/manifest/uses-sdk-element.html#min) is lower than 17, your app is not able to modify the settings that have moved to Settings.Global (/reference/android/provider/Settings.Global.html) when running on Android 4.2 and higher.

Daydream
Daydream is a new interactive screensaver mode for Android devices. It activatesautomatically when the device is inserted into a dock or when the device is left idle while plugged in to a charger (instead of turning the screen off). Daydream displays one dream at a time, which may be a purely visual, passive display that dismisses upon touch, or may be interactive and responsive to the full suite of input events. Your dreams run in your app’s process and have full access to the...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • android
  • Andro
  • android
  • Android
  • Android
  • Android
  • Android
  • Android

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS