[Android Series-] 1. Android development environment built with Hello World

Source: Internet
Author: User

Preface

Before you start, familiarize yourself with a few nouns:

SDK--Software development kit, software Development Kit. The word is no stranger, JDK, is Jave development Kit, the same for Android also has the Android SDK.

The Android SDK provides an API library and developer tools to build, test, and debug Android apps.

Adt-android Developer Tools, Android Developer tool, in fact, this is the plugin that Eclipse uses for Android development.



construction of high-speed development environment

Before you build your Android development environment, install the JDK first, and then download an ADT Bundle.

ADT Bundle is a download package provided for high-speed development

This download package includes:

1, Eclipse and ADT Plugins

2. Android SDK Tools

3. Android Platform-tools

4. The latest Android platform

5. The latest Android system image for the emulator


1. Download and install the JDK

The latest version of the JDK is now in the 1.8 version.

In terms of the current ADT requirements, version 1.6 will be available.

This is used: jdk1.6.0_24 version number.

The JDK's historical version number can be downloaded to:

Http://www.oracle.com/technetwork/java/javase/archive-139210.html

After the download, click on Execute, always next will be able to.

After the installation is complete, configure the following java_home.

This is configured as: C:\Program files\java\jdk1.6.0_24


2. Download and install ADT Bundle

The ADT Bundle is actually downloaded to extract it.

: http://developer.android.com/sdk/index.html

Click on the button in the diagram to be able to:


The latest file number is: Adt-bundle-windows-x86-20140321.zip

After the download has been extracted to the folder you need, here decompression to C:\mysoftware, the folder structure after decompression:

At this point, the environment is basically finished.


can also be downloaded to such as the following address:

https://onedrive.live.com/redir?resid=5b4edbcd9ef1ab6b!195&authkey=! Ab78zyhxox5kums&ithint=file%2c.zip


Eclipse cannot start

Theoretically, clicking on the Eclipse folder at this point Eclipse.exe should be able to start.

However, after the eclipse was started, it was gone.

An hs_err_pidxxxx.log error file is generated under the Eclipse folder.

The contents of the error are as follows:

# A fatal error have been detected by the Java Runtime environment:## exception_access_violation (0xc0000005) at pc=0x575 cf75b, pid=5912, tid=5832## JRE Version:java (TM) SE Runtime Environment (7.0_55-B13) (Build 1.7.0_55-b13) # Java Vm:java HotSpot (TM) Client VM (24.55-b03 mixed mode windows-x86) # problematic frame:# C [gdiplus.dll+0xf75b]## Failed to write C Ore dump. Minidumps is not enabled by default on client versions of windows## If you would like to submit a bug report, please Visi t:# http://bugreport.sun.com/bugreport/crash.jsp# The crash happened outside the Java Virtual machine in native code.# S EE problematic frame for where to report the bug.#---------------T H R E A D---------------Current thread (0x00df9800) : Javathread "Main" [_thread_in_native, id=5832, Stack (0x00030000,0x00130000)]siginfo:exceptioncode=0xc0000005, Reading address 0xa74c9eb4registers:eax=0x1008090b, ebx=0x57975790, ecx=0x00000002, edx=0x00000010esp=0x0012e41c, ebp=0x0012e430, ESI=0XA74C9EB4, edi=0xa74c9eb4eip=0x575cf75b, Eflags=0x00010297top of Stack: (sp=0x0012e41c) 0x0012e41c:57782d78 57782db0 00000001 A7 4C9EB40X0012E42C:A74C9EB4 0012e44c 575cf3a3 000000020x0012e43c:57975790 a74c9eb4 57782d60 000003ad0x0012e44c:0012 E4A4 5769aaa2 a74c9eb4 579757900x0012e45c:00000002 000003ad 0000004f 000000000x0012e46c:57949d48 57782d60 a742b000 5 7782d600x0012e47c:a742b000 00000004 00000000 000000000x0012e48c:00000002 00000000 00000004 00000000 Instructions: (P C=0X575CF75B) 0x575cf73b:57 8b 8b D0 C1 ea, fa xx 740x575cf74b:45 bayi FA ff, XX, 0f, 3c F6 F F FF 0f 6e e00x575cf75b:8b 0f 6e c0 0f C7 bayi F2 ff (xx) 0f 6e0x575cf76b:d2 0f D2 0f + d2 0f d5 C2 0f f  D c3 0f 6f D0 Register to Memory mapping:eax=0x1008090b is a unallocated location in the heapebx=0x57975790 are an unknown Valueecx=0x00000002 is a unknown valueedx=0x00000010 is a unknown valueesp=0x0012e41c is pointing to the stack for th read:0x00df9800ebp=0x0012e430 is pointing to the stack for THREAD:0X00DF9800ESI=0XA74C9EB4 are an unknown valueedi=0xa74c9eb4 are an unknown valu Estack: [0x00030000,0x00130000], sp=0x0012e41c, free space=1017knative frames: (j=compiled Java Code, j=interpreted, Vv= VM Code, c=native code) C [Gdiplus.dll+0xf75b]c [Gdiplus.dll+0xf3a3]c [Gdiplus.dll+0xdaaa2]c] [gdiplus.dll+0xdac57]c [g diplus.dll+0x79c24]c [Gdiplus.dll+0x16d7b]c [Gdiplus.dll+0xf2c0]c [Gdiplus.dll+0x4efe2]c] [Gdiplus.dll+0x6d257]C [ gdiplus.dll+0x6d208]c [Gdiplus.dll+0x6d55e]c [Gdiplus.dll+0x9fbbc]c [Gdiplus.dll+0x9fcc8]c] [  Swt-gdip-win32-4236.dll+0x532b]j org.eclipse.swt.internal.gdip.Gdip.Graphics_DrawLines (II[II) i+0j  Org.eclipse.swt.graphics.GC.drawPolyline ([I) v+72j Org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher.paint (lorg/eclipse/swt/events/ paintevent;) v+116j Org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.perspectiveswitcher$5.paintcontrol ( lorg/eclipse/swt/events/paintevent;) v+5j Org.eclipse.Swt.widgets.TypedListener.handleEvent (lorg/eclipse/swt/widgets/event;) v+1036j  Org.eclipse.swt.widgets.EventTable.sendEvent (lorg/eclipse/swt/widgets/event;) Vj Org.eclipse.swt.widgets.Widget.sendEvent (ilorg/eclipse/swt/widgets/event;  Z) v+73j org.eclipse.swt.widgets.Widget.sendEvent (ilorg/eclipse/swt/widgets/event;) v+4j  Org.eclipse.swt.widgets.Composite.WM_PAINT (II) lorg/eclipse/swt/internal/win32/lresult;+1429j Org.eclipse.swt.widgets.Control.windowProc (IIII) IV [jvm.dll+0x13f25a]v [Jvm.dll+0x202c1e]v] [JVM.DLL+0X13F2DD]V [ jvm.dll+0xc9b22]v [Jvm.dll+0xcc0d3]c [Swt-win32-4236.dll+0x122f]c 0x56d80018c [User32.dll+0x8734]c] [USER32.dll+ 0x8816]c [User32.dll+0x1a013]c [user32.dll+0x1a039]

From the above error, it is very difficult to see what caused the cause, just probably know that the memory can not read.

Here the solution is given directly:

Change the configuration of Eclipse.ini-xmx from 768 to 600


Save after change, restart Eclipse, everything is OK.

Sure enough it was the memory problem that caused it.

This problem should also be solved by configuring Java_ops.


Hello World

Here, the environment is not a problem to build.

Next, create an Android Hello world.

1. Join? An Android virtual device

Click the virtual Device Management icon directly or window-->android virtual Appliance Manager


Click "New" to join?


2. Build an Android app


3. Do nothing, direct execution


4. Implementation results


5. Click on the application page to develop and install the first Android app.



6. Click Myfirstapp





Failed to install *.apk on device ...

Under normal conditions, when you click Execute, the console should appear




Under some machines, the console may appear

Failed to install *.apk on device error.


The workaround is to:

Open SDK Manager and tickhttps




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.