Professional Documents
Culture Documents
吴以凡 Yifan Wu
School of Computer Science and Technology
yfwu@hdu.edu.cn
Installation
Installation
◼ JDK
◼ IDE
❑ Eclipse + Android ADT
* http://developer.android.com
Installation - JDK
◼ JDK includes JRE(Java Runtime Environment)、Java command line
utilities and Java library
◼ Sun JDK SE 8
❑ OS 32bit/64bit
◼ Check version
❑ java -version
* http://www.oracle.com/technetwork/java/javase/downloads/index.html
Install IDE - Android Studio
◼ IDE (Integrated Development Environment)
◼ C:\Users\Administrator\AppData\Local\Android\sdk\SDK
Manager.exe
❑ Proxy
◼ mirrors.neusoft.edu.cn
C Java
#include <stdio.h> public class Example{
int main(void) public static void main(String[] args) {
{ System.out.println("Hello, world!");
printf(“Hello, world!\n"); }
} }
Android:Hello, world!
◼ New Android Project
❑ File > New > New Project…Open New Project Dialog
Android:Hello, world!
◼ New Android Project
❑ Choose which platform and which SDK version
Android:Hello, world!
◼ New Android Project
❑ Choose default UI
Android:Hello, world!
◼ New Android Project
❑ Set Activity name, and click Finish
Android:Hello, world!
◼ Add virtual device
❑ Click AVD Mangaer
button to run
AVD Manager.exe to
crearte AVD (Android
Virtual Device)
Android:Hello, world!
◼ Add virtual device
❑ Install HAXM (Emulator Accelerator)
Android:Hello, world!
◼ Add virtual device
❑ Click run in Android Studio to run your project on the virtual
device
Project structure
◼ Folder structure
❑ libs: third-party JAR package
❑ build: auto-generated source file,
e.g., R.Java
❑ src: Java source code
❑ res: resource files
◼ drawable: pictures
◼ layout: layout files
◼ values: resource files in XML
❑ strings.xml
❑ colors.xml