Android Virtual Device

62 views 8:42 am 0 Comments February 27, 2023

1.

Make sure you have an Android TV set up as an Android Virtual Device for testing in addition to the phone emulators used in previous labs.

2.

Add the following to your Android manifest to declare it as supporting TVs:

You will also need to add an intent filter for your main activity in the manifest, i.e.

3.

Update the layout for the MainActivity to look like the following

Error! Filename not specified.

The layout has a black background, an ImageView with height and width set to match parent, and a ProgressBar at the very bottom with the width also set to match parent.

4.

Inside values -> themes -> themes.xml, there will be a reference of an ActionBar theme. Update this to say “NoActionBar” so you don’t have the bar across the top of the TV. i.e.

becomes