LAB 2
Building your Android APK
Objective: Let students know how to build an Android application using SDK provided by Google
Lab material: Tablet(TF9300) x 1
USB cable(Type-A male to mini-USB male)
PC with Windows OS
Students or TAs might need prepare the USB cable by themselves. And please notify students to fully charge the tablet before LAB started.
Lesson 1: Install Android Studio and JDK
-
http://developer.android.com/sdk/index.html
-
Click “Download Android Studio for Windows” button
-
Check “I have read and agree with the above terms and conditions”
-
Click “Download Android Studio for Windows” button
-
Execute the file “android-studio-bundle-141.1890965-windows.exe”
-
While installing the Android Studio, if the JDK can’t be detect during install process, install JDK 7 as well.
Lesson 1 might take long time and will have lots of troubles for students. Suggest that TA help to finish this lesson before the LAB
Lesson 2: Install the necessary platform and sample codes
-
Start the “Android Studio” application.
-
In the “Select UI Theme” screen, click “Next” button and wait for the update process to finish
-
In the “Welcome to Android Studio” screen, select “Configure”, then select “SDK Manager”
-
Unchecked all 5 items under Android 5.1.1(API 22). Checked “SDK Platform” and “Samples for SDK” 2 items under Android 4.3.1(API 18). Please see Fig.1
Fig. 1
-
Click “Install 4 packages”
-
Select “Accept License”, then click “Install” button and wait for install process to finish
-
Close the Android SDK Manager and go back to “Welcome to Android Studio” screen
-
Click “<=” icon to go back to “Quick Start” menu
Lesson 3: Connect PC to tablet
-
Start the tablet, Click Application -> Settings -> About tablet
-
Click “Build number” a couple of times until a message pops out and says that “You are now a developer”
-
Go to Settings -> Developer options, check USB debugging.
-
Connect PC to tablet using USB cable, you should be able to see an “Jelly Bean” icon pops out in the upper notification bar.
Lesson 4: Run API demos APK on tablet
-
In the “Welcome to Android Studio” screen, select “Open an existing Android Studio project”
-
Choose the path C:\Users\\AppData\Local\Android\sdk\samples\android-18\legacy\ApiDemos
-
Select “Run -> Run”, then click “Edit Configurations”
-
Select “Default -> Android Application”, check “USB device”, then click “Run” button. You should be able to see the “API demos” APK run on the tablet.
Install Android studio step
JDK install -> android studio
Download Java SE Development Kit(JDK) 7
安裝完後可以自動偵測JDK的位子,只要循序安裝即可
要注意是否使用的JDK是1.7.0_80
不是的話請到163.25.101.192下載3
並且設定環境變數為jdk1.7.0_80
.
可以接下去上面老師所說的操作
Share with your friends: |