Nexus series, Google’s own son

miui

Meizu flyme

HTC Sense

huawei

native

Fragmentation problem

Screen size: 2.6 inches 3.2, 3.0, 3.5, 3.7, 4.0, 4.3, 4.7, 5, 5.1

Screen breakdown: 320*480, 480*800, 720P, 1080K, 2K, 4K

Study: Mobile adaptation

The Android developers web site: developer.android.com/index.html

SDK: SoftwareDevelopment Kit

JDK:Java Developer’s Kit

ADT: AndroidDevelopment Tools

1.1 introduction of Android

The differences between Dalvik VM and JVM: 1. The differences between the bytecodes executed by Dalvik VM and JVM (bytecodes executed by Dalvik IN dex format and bytecodes executed by JVM in class format)

2. Different architectures based (Dalvik register-based, JVM stack-based: Register-based virtual machines take less time for larger programs to compile.)

New Virtual machine ART for Android

Dalvik: Every time an application is run, bytecode needs to be converted to machine code by the just-in-time compiler, which slows down the efficiency of the application

ART: When an application is first installed, bytecode is precompiled into machine code, making it a truly native application that can be launched and executed much faster

1.2 Setting up the development environment

1. JDK: JavaDevelopment Kit

AS requires JDK7 or above

Eclipse requires JDK6 or above

2, the IDE

There are two options: AS, Eclipse

If you choose Eclipse, you will need to install the ADT plug-in

ADT: AndroidDevelopment Tools, is a plug-in on Eclipse, through the installation of plug-ins can be implemented in Eclipse Android development

Steps to install ADT in Eclipse:

Help – > Install New Software…

PS: It is recommended to use adT-bundle provided by Android

3, SDK: SoftwareDevelopment Kit

Main contents in the folder:

Docs: indicates an offline document

Platforms: Development platform

Case of samples:

Sources: source code for the API

System-images: system images for the virtual machine (AVD) that comes with the SDK

Sdkmanager. exe: SDK manager tool

Recommended website: www.androiddevtools.cn

PS: If your computer is Intel chip, then you can install Intel hardware acceleration driver, such as the installation of this manager error, so long need to restart the computer, enter the BIOS Settings. Go to the BIOS, find the IntelVirtual Technology option, and set it to Enabled.

Bind the SDK in Eclipse: Window — >Preferences — > Android — > SDK Location

4. Run and debug

1) Real machine debugging (recommended)

You need to install the driver for the machine on your system (you can do this using your phone assistant), and you need a USB cable

2) Virtual machine with SDK

3) Use a third-party VM: Genymotion

Note: 1. Registration is required before use

2. The version of Vitual Box should not be too new. 4.3.12 is recommended

3. If problems occur during use, you can run in compatibility mode. Note that if Genymotion is running in compatibility mode, then Eclipse (we will install the Genymotion plug-in in Eclipse) and VitualBox must also run in the same compatibility mode

“Genymotion” : “http://plugins.genymotion.com/eclipse”

The DDMS can be used to manage and monitor connected devices. However, the devices may be disconnected or disconnected

1. If you use a built-in VM, the VM of a later version will be disconnected from the phone function

2. The device connection times out. In this case, we just need to adjust the timeout time to a longer one

Window — > Preferences — > Android — > DDMS — > ADB Connection Timeout (ms)

What if the device has been disconnected?

1. Restart the VM

2. Restart ADB

3. Restart the computer

1.3 The first Android app

The Android system identifies applications by package name

Activity: We can think of it as a class that describes an interface in an APP

Project Catalog Introduction:

1, SRC: source code

Bin: a compiled file

3. Libs: third-party JAR package

4, gen: automatically generated file, do not need to modify

5. Android5.0.1: Android core API (including JavaSE core API)

AndroidPrivate Libraries: third-party JAR packages associated with the current project

7. Assets: Asset directory

8, res: resources folder, where resources files are stored

9. AndroidManifest: Manifest file (Important)

The contents of the manifest file mainly store the relevant information of the current project, such as package name, version, supported minimum system version, application name, title, theme and so on

Proguard-project. TXT: code obfuscation file

Properties: configuration file used to configure the compiled version of the current project