Development Android


Windows

Android SDK for Android 7.0 (version 24) and Android Studio are installed on Windows.

Notes

Because of incompatibility of the Android SDK, emulator must be run from disk P:

Because of incompatibility of the Android Studio, application project must be located on disk P:

Project preparation

It is best to keep project in Git repository. It is possible to create a local repository in home directory (as a subfolder of disk J:) or on faculty's server.

After cloning repository onto disk P:\ create project in it using Android Studio and commit all changes.

Emulator preparation

Every time after logging in to a computer user must execute a command wmi_mkandroid from command prompt (cmd.exe). This will create emulator and AVD device compatible with our infrastructure. It's files are located in P:\android_[login] and will be removed on system's shutdown.

Project launching

After opening a project in Android Studio, first start an emulator by going to Tools -> Android -> AVD Manager and selecting green "play" button. After emulator displays home screen, it is possible to start a project in it.

Full procedure

Issues

Waiting for target device to come online

If after launching a project Android Studio shows message Waiting for target device to come online regardless of running emulator, one should:

  • close an emulator
  • restart emulator by Tools -> Android -> AVD Manager and choosing "play"
  • wait for home screen
  • launch project again on a correct device (listed under Connected devices)

If that doesn't help, close emulator and Android Studio and again execute a command wmi_mkandroid in cmd.exe.

Other

First step in troubleshooting issues with Android Studio and SDK not described in this article should be deleting:

j:.android
j:.AndroidStudio2.3
c:\users\[login].android
c:\users\[login].emulator_console_auth_token

Linux

Android SDK for Android 7.1.1 (version 25), Android 8.0 (version 26) and Android Studio are installed on Linux.

Notes

Because of incompatibility of Android SDK, emulator must be run from local disk (/media/poligon)

Emulator preparation

Every time after logging in to a computer user must launch Android Studio from system menu or execute a command wmi_mkandroid from terminal in case of different method of Android Studio launching. This will create emulator and AVD device compatible with our infrastructure. It's files are located in /media/poligon/android_[login] and will be removed on system's shutdown.

Issues

In case of issues one should:

  • close emulator
  • shut down Android Studio
  • remove AVD by executing in terminal command /opt/nfs/android-sdk/tools/bin/avdmanager delete avd --name Nexus_5X
  • remove directories /home/students/LOGIN/.android and /home/students/LOGIN/.AndroidStudio2.3