There are other features you can use in Android O to improve your apps. I'll describe Fonts in XML; TextView autosizing; pinnable launcher icons; and the implementation of Wi-Fi Aware, a standard that lets devices communicate with each other without needing a router in the middle.
- There are many other new features that you can put to work when you create your apps for Android O. You can now imbed fonts as resources. You place in a font directory under the resources directory and you create an XML file that will be used as a font family name. You define the font family an XML that looks like this. The font attribute in the font element refers to a font file. Then in your components that display text you can refer to that font as a resource using the font family attribute.
TextView components now have a feature called Autosizing. You define an amount of space you want to fill and then there are a couple of different strategies you can use to cause the TextView to select a font that's appropriate for that size. One of these is called the Granularity strategy. In this strategy you set a minimum and a maximum font and you also set a step. Now the TextView will choose the appropriate font size to fit the available space and that's because the Autosize text attribute is set to a value of uniform.
The other strategy is with Preset font sizes. In this strategy you create an array of strings as a resource and then you can refer to that array using the Autosize Preset sizes attribute. Once again you set the Autosize text to uniform. There's another useful new feature call Pinnable Launcher Shortcuts. On the pixel devices which were introduced with Android seven the use could touch and hold on a launcher icon and if a developer had created them shortcuts would appear.
Now with Android O, the user can click and drag those shortcuts to create shortcut icons and there's a new feature base on a standard called Wi-Fi Aware. It's also sometimes called Neighborhood Awareness Networking or NAN. Devices that support Wi-Fi Aware can communicate with eachother on a peer to peer basis and this is without the use of a Wi-Fi router. There are many ways that this feature can be put to work. So again Android O may not look like a massive change to the framework or the operating system but these are some of the many new features that are available to you as an Android developer.
- Installing Android Studio 2.4 Preview
- Targeting Android O in a new project
- Setting up Android O testing devices
- Exploring the new features for users
- Using display notifications in channels
- Using Autofill EditText components
- Displaying video as picture-in-picture
- Exploring other new features for developers