안드로이드 플랫폼 개발

\

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

  

출처 : http://source.android.com/using-eclipse  
 

Using Eclipse

About this Document

This document will help you set up the Eclipse IDE for Android platform development.


Enter eclipse

Basic setup

First, it's important to make sure the regular Android development system is set up.
Important: You will still be using "make" to build the files you will actually run (in the emulator or on a device).
You will be using Eclipse to edit files and verify that they compile, but when you want to run something you will
need to make sure files are saved in Eclipse and run "make" in a shell. The Eclipse build is just for error checking.
Eclipse needs a list of directories to search for Java files. This is called the "Java Build Path" and can be set
with the .classpath file. We have a sample version to start you off.
Now edit that copy of .classpath, if necessary.
Increase Eclipse's Memory Settings
The Android project is large enough that Eclipse's Java VM sometimes runs out of memory while compiling it.
Avoid this problem by editing the the eclipse.ini file. On Apple OSX the eclipse.ini file is located at
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
Memory-related defaults (as of Eclipse 3.4)

Recommended settings for Android development
These settings set Eclipse's minimum Java heap size to 128MB, set the maximum Java heap size to 512MB,
and keep the maximum permanent generation size at the default of 256MB.
Now start Eclipse:
Now create a project for Android development:
  1. If Eclipse asks you for a workspace location, choose the default.
  2. If you have a "Welcome" screen, close it to reveal the Java perspective.
  3. File > New > Java Project
  4. Pick a project name, "android" or anything you like.
  5. Select "Create project from existing source", enter the path to your Android root directory, and click Finish.
  6. Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)
Once the project workspace is created, Eclipse should start building. In theory, it should build with no errors
and you should be set to go. If necessary, uncheck and re-check Project > Build Automatically to force a rebuild.
Note:   Eclipse sometimes likes to add an "import android.R" statement at the top of your files that use resources,
especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break.
Look out for these erroneous import statements and delete them.

When you sync

Every time you repo sync, or otherwise change files outside of Eclipse (especially the .classpath), you need to
refresh Eclipse's view of things:
  1. Window > Show View > Navigator
  2. In the "Navigator", right-click on the project ("android-java" or whatever you named it)
  3. Click Refresh in the context menu
여기까지의 내용을 활용하여, 안드로이드 Native Apk.들을 개발하기 위한 환경으로 활용하는 것은 의미가 있을 듯 하지만,
문제는 Apk의 UI를 실시간으로 에뮬레이터를 통해 테스트 할 수 없다는 한계가 분명히 존재하는 군요.
좀 더 좋은 방법을 찾아봐야할듯 하네요.
 
※ 이 아래의 영역은 제 생각으로는 특별히 유용하지 않을 듯 합니다.(들풀)


Adding apps to the build path

The default .classpath includes the source to the core system and a sample set of apps, but might not include
the particular app you may want to work on. To add an app, you must add the app's source directory.
To do this inside Eclipse:

  1. Project > Properties
  2. Select "Java Build Path" from the left-hand menu.
  3. Choose the "Source" tab.
  4. Click "Add Folder...".
  5. Add your app's "src" directory.
  6. Click OK.
When you're done, the "source folder" path in the list should look like android/packages/apps/YourAppName/src.
Depending on which app(s) you include, you may also need to include other src/main/java directories under
android/dalvik/libcore. Do this if you find you cannot build with the default set.

Eclipse setup to work on developer tools

To work on Java developer tools, the principle is the same, except you specify /path/to/tool when using the
option "Create project from existing source."
Once the project is created, you need to set up the Java Build Path:

  1. Select the project you just created.
  2. Project > Properties
  3. Select "Java Build Path" from the left-hand menu.
  4. Choose the "Source" tab.
  5. Expand the single toolname/src entry.
  6. Double click the "Excluded: (none)" item.
  7. Add to the excluded (bottom) list: "MakeFile" and "resources/".
  8. Close the dialog.
  9. Back in the "Source" tab, click "Add Folder...", and add toolname/src/resources.
  10. Click OK.

Eclipse setup to work on DDMS

For DDMS, you will need to make a project for
  1. development/tools/ddms/libs/ddmlib
  2. development/tools/ddms/libs/ddmuilib
  3. development/tools/ddms/app
Each project will need to reference the ones before it ("ddmuilib" references "ddmlib", and "app" references
both of those). To do this:

  1. Make sure you have all 3 projects defined.
  2. Right click on a project, "Build Path" > "Configure Build Path..."
  3. Choose the "Project" tab.
  4. Click "Add..." and check the required projects.

Eclipse formatting

You can use a preference file in Eclipse to automatically set the formatter to the Android style guide.  Import
the files android-formatting.xml and android.importorder, which live under development/ide/eclipse.

Debugging the emulator with Eclipse

You can also use eclipse to debug the emulator and step through code. First, start the emulator running:
In another shell, start DDMS (the Dalvik debug manager):
Now, in eclipse, you can attach to the emulator:
  1. Run > Open Debug Dialog...
  2. Right-click "Remote Java Application", select "New".
  3. Pick a name, "android-debug" or anything you like.
  4. Set the "Project" to your project ("android-java" or whatever).
  5. Keep the "Host" set to "localhost", but change "Port" to 8700.
  6. Click the "Debug" button and you should be all set.
Note that port 8700 is attached to whatever process is currently selected in the DDMS console, so you need
to sure that DDMS has selected the process you want to debug.
You may need to open the Debug perspective (next to the "Java" perspective icon in the upper-right, click the

small "Open Perspective" icon and select "Debug"). Once you do, you should see a list of threads; if you
select one and break it (by clicking the "pause" icon), it should show the stack trace, source file, and line
where execution is at. Breakpoints and whatnot should all work.

Bonus material

Replace Ctrl with the Apple key on Mac.


Useful Plugins

Eclipse has a plugin architecture that enables third parties to extend the IDE. Here are some plugins that
make Eclipse easier to use for writing Android software:


  • AnyEdit - automatically fix whitespace issues when saving files. Can convert tabs to spaces, strip
    blanks at end-of-line, and ensure the last line of the file has an end-of-line character.

"Eclipse is not working correctly, what should I do?"

Make sure:
  • You followed the instructions on this page precisely.
  • Your Problems view doesn't show any errors.
  • Your application respects the package/directory structure.
If you're still having problems, please contact one of the Android mailing lists or IRC channels
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수

등록된 글이 없습니다.

대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED