Emulating in Android Studio
  • 19 Dec 2023
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Emulating in Android Studio

  • Dark
    Light

Article Summary

To simplify development it is recommended that you set up Android Studio with with a device profile for the M400 and M4000. This setup takes only a few minutes and dramatically increases your efficiency to create screen layouts. You may also use the emulator within Android Studio to do a significant amount of your testing.


Creating a Device Profile

The M400 and M4000 have a unique screen size. Creating a device profile allows Android Studio to accurately present the layout in the editor as it will be seen on the device.

  1. Save a copy of the device profiles configuration files downloaded specifically for M400 and M4000.

  2. Launch Android Studio

  3. Open Device Manager under the Tools menu and choose "Create Device."

Choose the Import Hardware Profiles. Select the previously downloaded file and click OK.

Search for "M400" or "M4000" and see if the new Device M400 or M4000 is added under the Phone Tab.

Later you can see the device properties as they were specified in the Device Profile file.

Congratulations! You now have the Vuzix device on your Hardware Profile.

Close the dialog and go back to Android Studio.

You can now use the new Hardware profile in your Layout/Interface Designer to have the proper dimension of the UI real estate.

From the device selector pull-down, select Generic Phones and Tablets then select either the M400 or M4000.


Emulating the M400 or M4000

The built-in system images allow emulation of the majority of the features of the Vuzix M400 and M4000 creating a valuable tool for developers. Please note, they do not allow testing of the Vuzix Speech SDK and Vuzix Barcode SDK. All other features of the device can be accurately emulated once it is configured using this procedure.

  1. Open AVD Manager under Tools

  2. Choose "Create Virtual Device"

  3. Search for and choose the previously added M400 or M4000 Device Profile and click "Next"

Choose Android 9 (Pie) for the system image and download if necessary.

Click Next.

Ensure the device's startup orientation is set to landscape.

Click Finish.

Congratulations! You can now choose to test your application using an M400 or M4000 sized emulator.


Advanced - Removing Navigation Buttons

If you would like to remove the stock Android navigation buttons, you can modify the config.ini file of the newly created emulator to hide them.

  1. Open AVD Manager under Tools

  2. Choose the drop-down arrow under actions next to the emulator you want to edit

  3. Choose "Show on Disk"

Right click on the config.ini file and select Edit.

Find hw.mainKeys and change it from "no" to "yes".

You will need to restart your emulator if it is running for the changes to take effect.

Congratulations! You have successfully removed the stock Android navigation buttons.


Was this article helpful?

What's Next