I didn’t like any of the android tutorials I found online, so I’m making my own. At the moment the actual programming part still hasn’t been tested, so I can’t suggest you quit school and use this instead, but if you would like to be the first guinea pig please have at.
- Install Android Studio. If you do not already have JDK (the Java Development Kit, a set of tools necessary for working in Java, which you’ll be doing) installed, it will prompt you to do so. Pay careful attention to the tiny type telling you which version of the JDK to install.
- Import the project. If you know how to import from github, you can find the most up to date code here. If you don’t know what that means, download the zip from dropbox. You will be given a lot of choices, just use the defaults. If you succeed it will look like.
- Create an emulator. This will create an image of an android device on your pc for easy testing. Technically you could just transfer the file to your phone every time, but I assure you you don’t want to.
- Click into the android virtual device manager (Tools/android/AVD Manager).
- Click “Create new device”
- select “nexus 6”, click next
- select “lollipop, x86”, click next
- click “show advanced settings”, scroll to the bottom, unclick “enable keyboard input”. This will force the image to simulate a software keyboard, rather than use your physical keyboard
-
click finish
-
Launch app on emulator
- Launch App on emulator
- click play button in button bar or select Run/Run App
- Wait a bit.
- Faux phone screen appears on your PC. Unlock and it’s running your app
- Run your first tests
- in the tree on the left, click into app/java/com.acesounderglass.testdriventutorial(androidTest)/ActivityTest
- Right click on the file and select [Run ‘ActivityTest’]. The tests should run and pass.
- Open up the file. You’ll see several functions starting with testX, some of which are commented out. Only the uncommented ones are currently running
- Uncomment the first commented out test, code only, not the description (you can tell because the // starts at col 1, not 5). Run tests again, the new test will fail.
-
The goal is for you to figure out how to get that test (and the subsequent ones) passing without further instruction from me.