The latest release of Android is here! Android 9 Pie — For The Developers.. (Part 2)
In first part we talked and see API informations about Indoore positioning with WiFI RTT, Notifications now Lets see about How we can enhanced our app with Animations, Multi camera support API and everyonce attactions Nueral network..!
Animation
https://developer.android.com/training/animation/videos/layout-transition.gif
Android 9 has implemented a “AnimatedImageDrawable” class for drawing and displaying GIF and WebP animated images.
It can be decoded using instance of Imagedecoder has several methods allowing you to further modify images.
This example prior to start(), first frame will display
@Throws(IOException::class)
private fun decodeImage() {
val decodedAnimation = ImageDecoder.decodeDrawable(
ImageDecoder.createSource(resources, R.drawable.my_drawable))
(decodedAnimation as? AnimatedImageDrawable)?.start()
}
Multi-camera support
Android P include a myriad of smaller tweaks like new neural network API and autofill improvement and multi-camera API. The Api are still far from final so developers shouldn’t get too comfortable with how thing’s work right now.
You can access streams simultaneously from two or more physical cameras. Using API implementation you can call a logical or fused camera stream that automatically switches between two or more cameras.
Neural Networks API 1.1
The Neural Networks API was introduced in Android 8.1 (API level 27) to accelerate on-device machine learning on Android. Android 9 expands and improves the API, adding support for nine new operations:
- Element-wise mathematical operations:
ANEURALNETWORKS_DIV
ANEURALNETWORKS_SUB
- Array operations:
ANEURALNETWORKS_BATCH_TO_SPACE_ND
ANEURALNETWORKS_SPACE_TO_BATCH_ND
ANEURALNETWORKS_SQUEEZE
ANEURALNETWORKS_STRIDED_SLICE
ANEURALNETWORKS_TRANSPOSE
ANEURALNETWORKS_PAD
ANEURALNETWORKS_MEAN
If you have to feel practical experience of Android P today. How you can get it? It’s possible 💥— It’s available as a free download.
However it’s run only on selected phone — First or second generation pixel phone 📲📲 . Hope you have get a good read 📚 and much more interest to go in deep and see how this API’s work and what more you can do with this. 💻
If you have found this useful, then please consider recommending and sharing it with your friends and other developers. Click the 💚 below to show your support and share it with other fellow Medium users.