Jetpack
Kotlin
Docs
News
Platform
Android Studio
Google Play
Jetpack
Kotlin
Docs
News
Platform
Android Studio
Google Play
Jetpack
Kotlin
Docs
News
More
Android Developers Blog
The latest Android and Google Play news for app and game developers.
API 23 SDK now available for Android Wear
18 November 2015
Posted by
Wayne Piekarski
, Developer Advocate
The new
LG Watch Urbane 2nd Edition LTE
is the first watch to run Android 6.0 Marshmallow (
API 23
) for Android Wear. Currently, all other Android Wear watches implement API 22, and in the coming months, these will receive an OTA update for API 23 as well.
So what does this mean for you as an Android Wear developer? You will need to ensure that your apps are compatible with both API 23 and API 22 watches. While you can start implementing the new features in this post, you still need to maintain backwards compatibility until all watches are upgraded.
New permissions model and samples
API 23
introduces
a new runtime permissions model for both phones and watches. The new permissions model allows users to pick and choose which permissions to grant apps at the time of use. In addition, new permissions settings allow users to turn on and off app permissions at any time.
To use the new permissions model on Wear, read
Permissions on Android Wear
. This training guide provides an in-depth discussion of Wear-specific scenarios, such as when your Wear app relies on a phone-side permission. In addition, all of the Android Wear
samples
have been updated to use the new permissions model, and a new
RuntimePermissionsWear
sample shows how to handle permission requests across devices.
When you are ready, you can update your application on both the phone and watch side to use
compileSdkVersion
23 and
targetSdkVersion
23. Make sure that you check and
request
the permissions needed by your app at runtime, on both the phone and the watch. It is important that you do not change targetSdkVersion to 23 until you have implemented the permission checks properly, since it changes how the system installs and runs the app. For example, an API call that might have previously returned a result could now fail, causing the app to behave in unexpected ways.
-round and -notround resource qualifiers
API 23 makes it easier to build apps for both round and square Android Wear watches. We listened to your feedback and added new resource qualifiers for -round and -notround, so you can use the resource system to load the appropriate images, layouts, and strings based on the type of watch you are working with. You can also combine this with existing resource qualifiers -hdpi, -tvdpi, -280dpi, and -360dpi for the various Android Wear watches that are currently available. All of the existing classes in the
wearable UI library
, such as
WatchViewStub
,
BoxInsetLayout
, and
WearableFrameLayout
will continue to work as well, so you do not need to change your code. The -round and -notround resource qualifiers will not work on API 22 devices, so you cannot assume they will be available until all devices are on API 23.
Watches with speakers
The
LG Watch Urbane 2nd Edition LTE
is the first watch to include speaker support, so you can now add sounds to your Wear app. You can play audio files using the same APIs that are available on Android phones, such as
AudioTrack
,
MediaPlayer
, and
ExoPlayer
. Check out the
sample
and
documentation
to learn how to detect when the speaker is available on a Wear device and play sounds through it.
Intel x86 support
The new
TAG Heuer Connected
, along with other upcoming Android Wear watches, is based on Intel x86 processors. If you are working only with Java code, your apps will automatically work on any architecture. However, if you’re using the NDK, you’ll need to provide both armeabi-v7a and x86 shared libraries in your wearable APK. Since only one wearable app can be bundled in a phone app, it is not possible to deliver different APKs to different watches based on architecture. If your wearable APK is missing an x86 library, it will fail to install on x86 watches with INSTALL_FAILED_NO_MATCHING_ABIS and code -113.
If you are using Android Studio, you will need to adjust your build.gradle file to include:
ndk { abiFilters = ['armeabi-v7a','x86'] }
If you are using the NDK directly, you will need to modify your Application.mk file to use:
APP_ABI := armeabi-v7a x86
These changes should only be made for the wearable APK, and you can continue to support other ABIs on the phone side. You can test your application by checking if it works on the x86 emulator provided by the SDK Manager.
Updated emulator
New Android Wear emulator images for API 23 and x86 watches are available to download from the SDK Manager in Android Studio. We have also added profiles that represent every available Android Wear watch, so you can easily test on any device you want. It is also important that you understand and test all the combinations of phones (API <= 22, API = 23) and wearables (API 22, API 23), so that your app works for all users.
Updates to existing watches
The new emulator images allow you to get started immediately with testing and deploying updated apps for users with API 23 watches. The schedule for updating existing Android Wear watches via OTA updates has not been announced yet. We will announce the update schedule on the
Android Wear Developers Google+ community
. We’ll also let you know when the rollout is complete, and API 22 support for Android Wear is no longer needed.
Labels
Android O
Android Studio
Design
Develop
Google Play
Archive
March 2021
(5)
February 2021
(11)
January 2021
(3)
December 2020
(7)
November 2020
(7)
October 2020
(7)
September 2020
(9)
August 2020
(18)
July 2020
(18)
June 2020
(18)
May 2020
(4)
April 2020
(7)
March 2020
(9)
February 2020
(9)
January 2020
(3)
December 2019
(8)
November 2019
(12)
October 2019
(11)
September 2019
(5)
August 2019
(9)
July 2019
(8)
June 2019
(6)
May 2019
(15)
April 2019
(10)
March 2019
(11)
February 2019
(5)
January 2019
(6)
December 2018
(11)
November 2018
(9)
October 2018
(13)
September 2018
(5)
August 2018
(13)
July 2018
(9)
June 2018
(16)
May 2018
(16)
April 2018
(8)
March 2018
(8)
February 2018
(7)
January 2018
(9)
December 2017
(9)
November 2017
(13)
October 2017
(14)
September 2017
(11)
August 2017
(19)
July 2017
(11)
June 2017
(13)
May 2017
(21)
April 2017
(12)
March 2017
(14)
February 2017
(11)
January 2017
(12)
December 2016
(17)
November 2016
(16)
October 2016
(9)
September 2016
(6)
August 2016
(7)
July 2016
(12)
June 2016
(14)
May 2016
(16)
April 2016
(14)
March 2016
(8)
February 2016
(8)
January 2016
(9)
December 2015
(9)
November 2015
(13)
October 2015
(19)
September 2015
(15)
August 2015
(13)
July 2015
(9)
June 2015
(8)
May 2015
(10)
April 2015
(10)
March 2015
(12)
February 2015
(8)
January 2015
(3)
December 2014
(9)
November 2014
(13)
October 2014
(11)
September 2014
(6)
August 2014
(2)
July 2014
(9)
June 2014
(10)
May 2014
(4)
March 2014
(4)
February 2014
(3)
January 2014
(2)
December 2013
(3)
November 2013
(2)
October 2013
(7)
September 2013
(2)
August 2013
(5)
July 2013
(5)
June 2013
(4)
May 2013
(9)
April 2013
(3)
March 2013
(2)
February 2013
(3)
January 2013
(3)
December 2012
(5)
November 2012
(3)
October 2012
(3)
September 2012
(1)
August 2012
(1)
July 2012
(2)
June 2012
(5)
May 2012
(1)
April 2012
(5)
March 2012
(5)
February 2012
(5)
January 2012
(5)
December 2011
(7)
November 2011
(7)
October 2011
(5)
September 2011
(5)
August 2011
(3)
July 2011
(7)
June 2011
(2)
May 2011
(5)
April 2011
(6)
March 2011
(8)
February 2011
(8)
January 2011
(4)
December 2010
(8)
November 2010
(3)
October 2010
(4)
September 2010
(7)
August 2010
(6)
July 2010
(10)
June 2010
(11)
May 2010
(11)
April 2010
(2)
March 2010
(3)
February 2010
(2)
January 2010
(5)
December 2009
(7)
November 2009
(5)
October 2009
(5)
September 2009
(8)
August 2009
(2)
July 2009
(1)
June 2009
(2)
May 2009
(5)
April 2009
(12)
March 2009
(5)
February 2009
(8)
January 2009
(3)
December 2008
(3)
November 2008
(1)
October 2008
(4)
September 2008
(6)
August 2008
(4)
June 2008
(1)
May 2008
(5)
April 2008
(4)
March 2008
(5)
February 2008
(2)
January 2008
(5)
December 2007
(3)
November 2007
(5)
Feed
Newsletter
Android Developers
Google Play