To test apps running on Android O, you need a device with the new version of the operating system installed. You can use either virtual or physical devices to test most features, although there is one feature in particular—displaying videos with the new Picture-in-Picture mode—that requires a physical device.
- [Instructor] To test apps running on Android O, you need a device with the new version of the operating system installed. You can use either virtual or physical devices. To use a physical device, go to this webpage at developer.android.com/preview/download.html. You'll see a list of all the currently supported devices under Downloads, including the Nexus 5X, 6P, and Player, and the Pixel C, the Pixel, and the Pixel XL.
Older devices, such as the Nexus 9 or Nexus 7, are no longer supported. In order to use these system images, you must be comfortable with manually flashing a device. You'll find instructions at this link at developers.google.com. You'll need to have unlocked the device's bootloader before following the installation instructions, and you should definitely be using a device you don't use for your own personal work. Again, this is early preview software. There will be bugs.
If you don't have a suitable physical device or just aren't comfortable with this sort of installation, you can instead use the Android Emulator and create virtual devices. To do that, go back to Android Studio after creating or opening a project. Then, go to the menu and select Android, AVD Manager. Click Create a Virtual Device. Choose a device you want to emulate. I'll choose the Pixel XL. Then, click Next.
If you see O listed under the Recommended tab, you can select it. If you see a Download link, you can click it, and that'll download the system image right here. Or if you don't see it here, look over here, under x86 Images. I'll choose the system image for Android O, and click Next, and click Finish. And then, I'll be ready to use my new virtual device. With either a virtual or a physical device, it's important to know where the developer options are.
This is a Google Pixel that I'm projecting to the screen. I'll swipe down a couple of times and then touch the gear icon to open the Settings application. Notice at the bottom, that you don't see the About information at the bottom of the screen anymore. It's been moved. From here, I'll go into System. If you don't see Developer options, touch About phone, and go down to the bottom, and then touch Build number seven times. I've already done this, so I see the message No need, you're already a developer.
I'll go back, and then I'll touch Developer options again. And typically, I turn on these features. I turn on Stay awake, and that'll keep the phone alive while it's charging. And then, I'll find the USB debugging tool, which is here under Debugging. I'll turn it off for a moment, and then I'll turn it back on. And when prompted, I'll touch OK. And as before, if you see a prompt to validate the device for USB debugging on this computer, accept it.
Then, at the top of the screen, you should see a couple of notifications indicating that USB debugging is connected, and you're ready to test Android O with your physical device.
- 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