Getting started with Android and App Engine

From Gridkaschool

Preparations

Since downloading and installing all the required software for the course might take some time, we would please you to do this already before Thursday. Just follow these installation instructions to install (and see if its working alright).

In case you have any troubles with installation please contact us at tim.roes <at> inovex.de and daniel.baelz <at> inovex.de so we might be able to help you troubleshoot the problems before Thursday.

All the software we are going to use works well on Linux, Mac OS X or Windows. So feel free use whatever system you feel comfortable with.

  1. Install JDK 7
  2. Install Android Studio & Android SDK
  3. Download an Android SDK platform
  4. Get a Google account

And depending on whether you want to develop on a real device or just inside an emulator read either:

  • Setup real device
  • Setup Android emulator

Installation JDK 7

Please download and install the Oracle Java Development Kit in Version 7 (even if you already have Version 6 or 8 installed) from the following page:

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html (Topmost table Java SE Development Kit 7u67)

Install Android Studio & Android SDK

Download and install Android Studio (which comes bundled with the Android SDK) from:

https://developer.android.com/sdk/installing/studio.html

The beta version is the correct version.

Download an Android SDK platform

If you start the freshly installed Android Studio you should see the following welcome screen:

Android-installation-1.png

Click on Configure->SDK Manager to start the SDK Manager.

In the Android SDK Manager, install the following packages (if not installed already):

  • Tools
    • Android SDK Tools
    • Android SDK Platform-tools
    • Android SDK Build-tools (20)
  • Android 4.4.2 (API 19)
    • SDK Platform
    • Google APIs (ARM System Image)
  • Extras
    • Google USB Driver - Only if you own a Nexus device (Nexus 4, Nexus 5, Nexus 7, ...) and develop on Windows

Check these entries and hit the install (this might take some time).

Get a Google account

For using the Google App Engine APIs you will need an registered Google Account.

If you don't have one yet or don't want to use yours for the matter of this course, please register a new one at:

https://accounts.google.com/SignUp

Running Android Apps

During the course we will develop an Android app, that you will need to run. If you have an Android device, you can use your device for development. If you don't have an Android device you can use the emulator to run your app. Running on a real device is a lot faster and therefore we recommend using a real device for the course if possible.

If you have a rather old device (before Android 4 - Ice Cream Sandwich) you might also consider using the emulator. We will target development mainly for Android 4 and above, though most of what we will use also works on older versions, but there might be stuff, that doesn't work exactly like we will explain it.

Setup real device

If you want to develop on your real devices, you will need an USB cable to connect your device to your notebook. Basically this is the cable, that you also use to load your phone. We will try to have a small supply of such cables with us, but we please you to bring your own, if possible.

To setup the device for developing, please follow the instructions page in the Android documentation on "Using Hardware Devices":

https://developer.android.com/tools/device.html

Installation directory: If you haven't changed anything during the installation it will install Android Studio only for your user. In this case the installation directory (referred to in the next paragraphs) will be: \Users\<username>\AppData\Local\Android\android-studio\

Make sure to do all steps required for your operating system. To check if everything is running correctly run the command `adb devices` in a command shell (cmd, bash, etc.). You can find the adb(.exe) under the installation directory of Android Studio in the subfolder sdk/platform-tools/. The output should list a device id for your device. If nothing shows up or only questionmarks show up, something in the setup hasn't worked.

If you don't feel comfortable with command lines, start the monitor(.bat) from sdk/tools/ in your Android Studio installation directory. You should see your device listed with a name in the device section:

Android-installation-3.png

Again, in case of open questions and trouble, please contact us via mail.

Setup Android emulator

To setup an emulator to run your android apps on, go to the SDK Manager and hit Tools (the menu not the package) -> Manage AVDs...

In the following dialog hit the Create button on the side to create a new emulator image. Enter data, so the dialog looks like the following screenshot:

Android-installation-4.png

Hit OK and your emulator should have been created. You can now start it (but be aware this might take some time, that's why we recommend using a hardware device).

For a more detailed explanation (in case something went wrong), see the official documentation: https://developer.android.com/tools/devices/index.html

Workshop materials