Android/App개발2009. 4. 23. 11:21
http://www.kandroid.org/board/board.php?board=androidsource&command=body&no=17

안드로이드 소스코드내의 아래의 위치에 존재하는 문서를 참고하시면 안드로이드 Native 라이브러리 및 
해당 라이브러리를 static, 또는 dynamic하게 linking하는 Native 애플리케이션을 제작하는 법에 대한 설명이
존재합니다. 
 
~/mydroid/development/pdk/ndk/README
 
위의 문서를 참조하여, 아래와 같은 절차를 거치시면 다양한 native lib. 및 application을 제작 테스트 해 볼 수
있습니다.

 
1. 가장 먼저 해야할 일은 다음과 아래의 URL에 있는 문서에서의 다음의 두 절차, 
    즉 6번까지의 작업과 8번의 goldfish 부분에 대한 build를 마무리 해야 함.
 
   http://www.kandroid.org/board/board.php?board=androidsource&command=body&no=4
 
  
중략...
 
   6. 안드로이드 빌드 하기
       $ make 
 
   8. Kernel 별도로 빌드하기
        - goldfish
 
        $ cd ~/mydroid/kernel
        $ make goldfish_defconfig ARCH=arm
        $ make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- 


 
2. ~mydroid/development/pdk/ndk/config/config.mk 를 다음과 같이 수정한다.
 
<android_full_src_path> 는 각자의 host pc에 설치된 android full source의 root directory 를 지정하면 됩니다.
 
CC         := ~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-gcc
AR         := ~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-ar
INC        := -I<android_full_src_path>/bionic/libc/arch-arm/include 
-I<android_full_src_path>/bionic/libc/include 
-I<android_full_src_path>/kernel/include 
-I<android_full_src_path>/bionic/libm/include 
-I<android_full_src_path>/bionic/libm/include/arm 
-I<android_full_src_path>/bionic/libstdc++/include
LINK       := -nostdlib -Bdynamic 
     -Wl,-T,<android_full_src_path>/build/core/armelf.x 
     -Wl,-dynamic-linker,/system/bin/linker 
     -Wl,-z,nocopyreloc 
     -L<android_full_src_path>/out/target/product/generic/obj/lib 
     -Wl,-rpath-link=<android_full_src_path>/out/target/product/generic/obj/lib 
     <android_full_src_path>/out/target/product/generic/obj/lib/crtbegin_dynamic.o
POSTLINK := <android_full_src_path>/out/target/product/generic/obj/lib/crtend_android.o
%.o: %.cpp
        $(CC) $(CFLAGS) -fno-exceptions -fno-rtti $(INC) -o $@ -c $<
%.o: %.c
        $(CC) $(CFLAGS) $(INC) -o $@ -c $<

 
 
3. ~mydroid/development/pdk/ndk/sample/Makefile.lib 를 다음과 같이 수정한다.
 

NDK_BASE   := ..
include $(NDK_BASE)/config/config.mk
SOURCES    := hellolibrary.c
OBJECTS    := $(SOURCES:.c=.o)
LIBS       := -lc -lm
ALIB       := <android_full_src_path>/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a
all: sharedlib staticlib
# Using shared and static suffixes as these are going in the same directory;
# typically you would not do this as you would make only one version,
# but if we don't we'll screw up the linking because of linker defaults.
staticlib: $(OBJECTS)
        $(AR) -cr libhello-static.a $(OBJECTS)
sharedlib: hellolibrary-shared.o
        $(CC) -nostdlib -Wl,-soname,libhello-shared.so -Wl,-shared,-Bsymbolic -L<android_full_src_path>/out/target/product/generic/obj/lib $^ $(LIBS) -o libhello-shared.so -Wl,--no-undefined $(ALIB)
hellolibrary-shared.o: hellolibrary.c
        $(CC) -c -fpic $(INC) -o $@ $^
clean:
        rm -rf *.o libhello-static.a libhello-shared.so

 
4. native library 및 application 제작 및 테스트
 
먼저 ~/mydroid/development/pdk/ndk/로 cd 하신후 부터 아래의 절차를 수행하면 됩니다.
하지만, 아래의 과정을 수행하는 과정에서 shared library를 테스트 하기 위해서는
아래의 예제에 있는 libhello-shared.so 가 반드시 /system/lib 아래에 설치되어야 합니다.
하지만, 현재의 emulator는 /system partition이 ro 모드로 되어 있기 때문에 설치가 불가능합니다.
/system partition을 rw 모드로 바꾸는 작업이 필요한데..번거로울까봐 이곳에서는 가장 간단한 방법
(아래의 0번)
제시하도록 하겠습니다.
 
0번) emulator의 /system partition을 ro -> rw 로 바꾸는 방법. (필수)
 
    - 아래의 새로운 ramdisk.img 를 다운로드 한다.
       
 ramdisk.img(136.2KB)
   
    - 에뮬레이터에 존재하는 ramdisk.img를 backup한다.
      예) android-sdk-windows-1.0_r2 oolslibimages  아래 존재하는 
           ramdisk.img 를 ramdisk.img.orig 로 rename 한다.
    
    - 위에서 다운받은 새로운 ramdisk.img 를 위의 위치로 복사한다.
 
    - emulator를 실행한다.
        
 
1) 간단한 hello world 샘플 애플리케이션 제작
 
  cd ../sample
  make clean
  make
 
  adb push hello system/app
  adb shell
  # cd system/app
  # chmod 755 hello
  # ./hello
  Hello from the NDK; no user libraries.
  # exit
 
2) c++ binary hello_cpp.cpp 애플리케이션 제작 
 
  make -f Makefile.hello_cpp clean
  make -f Makefile.hello_cpp hello_cpp
 
  adb push hello_cpp system/app
  adb shell
  # cd system/app
  # chmod 755 hello_cpp
  # ./hello_cpp
  C++ example printing message: Hello world!
  # exit
 
4) shared library 제작 및 해당 library를 제작하는 사용하는 애플리케이션 제작
 
  make -f Makefile.lib clean
  make -f Makefile.lib sharedlib
  make -f Makefile.uselib clean
  make -f Makefile.uselib use_hellolibrary-so
 
  adb push libhello-shared.so system/lib
  adb push use_hellolibrary-so /system/app
  adb shell
  # cd system/app
  # chmod 755 use_hellolibrary-so
  # ./use_hellolibrary-so
  Library printing message: Hello from the NDK.
  # exit
 
5) static library 제작 및 해당 library를 static으로 링크한 애플리케이션 제작
 
  make -f Makefile.lib clean
  make -f Makefile.lib staticlib
  make -f Makefile.uselib clean
  make -f Makefile.uselib use_hellolibrary-a
 
  adb push use_hellolibrary-a system/app
  adb shell
  # cd system/app
  # chmod 755 use_hellolibrary-a
  # ./use_hellolibrary-a
  Library printing message: Hello from the NDK.
  # exit
Posted by 삼스
Android/App개발2009. 4. 22. 16:44
http://www.mobileplace.co.kr/android_dev_info/2389

구글폰 안드로이드 개발을 시작하시는 분들에게 기본 문서에서 제공하는 노트패드 튜터리얼도 있지만 시작하기 먼가 좀 애매해서 설치부터 완전 기초 부분 까지를 정리 해보았습니다. 처음 개발하시는 분은 아래 강좌보시고, Hello View로 넘어가세요. 그리고 노트패드 튜터리얼로 넘어가는게 좀더 쉽게 시작할 수 있을듯 합니다. 

안드로이드 강좌 1 - 어플리케이션 개발 시작하기. SDK 설치 및 실행
안드로이드 강좌 2 - 이클립스 개발환경 사용법 및 프로젝트 생성
안드로이드 강좌 3 - 프로젝트 실행과 디버깅 그리고 단말 세팅
안드로이드 강좌 4 - 액티비티(Activity), 뷰(View), 레이아웃(Layout)
안드로이드 강좌 5 - XML에서의 TextView, ImageView, LinearLayout
안드로이드 강좌 6 - Java 코드(Code)에서 뷰(View)  다루기

이제서요(2009년 2월) 구글이 튜터리얼도 업데이트해서 이제 좀 웹으로도 공부할만해졌네요. :)

안드로이드 공식 홈페이지 링크

공식    : 
http://www.android.com
마켓    : 
http://market.android.com
개발자 : 
http://developer.android.com

Posted by 삼스
Android/App개발2009. 4. 22. 10:18

http://link.allblog.net/18042236/http://androidhuman.tistory.com/entry/안드로이드-에뮬레이터에-가상의-SD카드-마운트시키기


안드로이드 에뮬레이터에서 사용자가 임의로 파일을 저장하려면 안드로이드 에뮬레이터에 가상의 SD카드가 마운트 되어 있어야 합니다. 오늘은 mksdcard를 이용한 가상의 SD카드 생성부터 시작해서 이클립스 내의 설정 변경, DDMS를 이용하여 가상의 SD카드에 파일 넣기까지 알아보겠습니다.

일단, 에뮬레이터에 마운트시킬 가상의 SD카드를 생성해야합니다. 가상 SD카드를 생성하려면 안드로이드 SDK폴더\tools 폴더의 mksdcard.exe 을 이용하면 됩니다.


실행-cmd를 입력하여 명령 프롬프트 창을 열고, 안드로이드 sdk가 설치된 폴더\tools폴더에 간 후, mksdcard [용량] [파일명] 을 입력하여 가상의 SD카드를 만듭니다. 저는 128MB의 크기로 만들었습니다.

생성된 가상 SD카드 파일


가상 SD카드 파일도 만들었으니, 이제 에뮬레이터에 마운트를 시켜야겠지요?
에뮬레이터를 실행시킬 때 sd카드를 마운트시키는 옵션을 활성화시켜주어야 하는데요, 그 설정은 Run-Run Configurations-Target 탭의 Additional Enulator Command Line Options에 넣어주면 됩니다.


저같은 경우는 생성한 가상SD카드를 c:\ 드라이브에 넣어주어서 경로를 저렇게 설정하였습니다. 각자 경로에 맞게끔 넣어주시면 됩니다.

이렇게 설정을 끝낸 후, 에뮬레이터를 실행시키면 가상SD카드가 마운트 된 채로 에뮬레이터가 실행됩니다.
그럼, 이 SD카드에 파일을 넣어볼까요?

이클립스에서 DDMS를 실행시킨 후, File Explorer탭을 클릭해보면 아래와 같은 아이콘이 보이실겁니다. 에뮬레이터에 파일을 넣어야하니 Push a file onto the device를 눌러줍니다.



요로코롬 파일을 선택할 수 있습니다. 개발하는데 깝깝한데~~ 음악이나 듣게 음악을 넣어봅시다. 이 때, 파일명은 영어로 되어 있어야 합니다. 안그러면 에러납니다. -_-


자, 저렇게 해주면 이렇게! 뿅! 들어가있는 것을 볼 수 있습니다.
자, 그럼 이제 이 파일을 안드로이드 에뮬레이터에서 들어볼까요?
파일을 추가했으니, 바로 음악을 듣기 전에 Dev Tools의 Media Scanner를 실행해서 파일을 인식시켜주어야 합니다.

Media Scanner가 새로 추가된 파일을 검색중인 화면.


검색이 끝났다면, 음악을 들어볼까요?
Music을 눌러보시면, 다음과 같이 음악이 추가되어있는 것을 보실 수 있을 겁니다!


음악 파일 뿐만 아니라 다른 파일을 넣을 떄에도 지금과 동일한 과정으로 수행하시면 됩니다. :)

Posted by 삼스
Android/App개발2009. 4. 21. 17:21
Professional Android Application Development
지은이  Reto Meier  출판사 WROX PRESS  |   발행일 2008년 11월 10일
 
클릭하시면 큰 도서이미지를 보실 수 있습니다.
판매가 64,500원 → 55,700원 14%
마일리지 3% 1,670원
발행일 2008-11-10
ISBN 0470344717 | 9780470344712
기타정보 원서 | 400쪽 | $ 44.99 | Paperback
예상출고일 예상입고기간: 7~9일 소요예정
배송비 무료 배송
    정가, 판매가는 항공 운임료 포함 
Java
종합지수 2p 350 위
월간지수 8p 26 위
주간지수 12p 15 위
   
주의사항  ㆍ 현지사정에 의해 지연, 품절 될 수 있습니다.
 ㆍ 해외주문원서는 취소 및 반품이 불가능합니다.
     (단, 파본이나 오발송은 제외 입니다.)
 ㆍ 수입절차/입고소요기간 자세히
 
 Java 분야 베스트
1. Game Programming Gems 6
2. 열혈강의 VISUAL C++ 2008 MFC 윈도우프로그래밍
3. 제프리 리처의 Windows via C/C++
 
 
 Java 분야 베스트
1. 헬로, 안드로이드
2. 차세대 MVC 스트럿츠 2 프로그래밍
3. 알기 쉽게 풀어 쓴 웹로직과 EJB
 
 
 Java 분야 신간
1. Javafx: Developing Rich Internet Applications
2. Android Application Development: Create Modify Reuse
3. Spring in Practice
 
 
A hands-on guide to building mobile applications, Professional Android Application Development features concise and compelling examples that show you how to quickly construct real-world mobile applications for Android phones. Fully up-to-date for version 1.0 of the Android software development kit, it covers all the essential features, and explores the advanced capabilities of Android (including GPS, accelerometers, and background Services) to help you construct increasingly complex, useful, and innovative mobile applications for Android phones. 
What this book includes 

  • An introduction to mobile development, Android, and how to get started. 
  • An in-depth look at Android applications and their life cycle, the application manifest, Intents, and using external resources. 
  • Details for creating complex and compelling user interfaces by using, extending, and creating your own layouts and Views and using Menus. 
  • A detailed look at data storage, retrieval, and sharing using preferences, files, databases, and Content Providers. 
  • Instructions for making the most of mobile portability by creating rich map-based applications as well as using location-based services and the geocoder. 
  • A look at the power of background Services, using threads, and a detailed look at Notifications. 
  • Coverage of Android's communication abilities including SMS, the telephony APIs, network management, and a guide to using Internet resources 
  • Details for using Android hardware, including media recording and playback, using the camera, accelerometers, and compass sensors. 
  • Advanced development topics including security, IPC, advanced 2D / 3D graphics techniques, and user–hardware interaction. 

    Who this book is for
    This book is for anyone interested in creating applications for the Android mobile phone platform. It includes information that will be valuable whether you're an experienced mobile developer or making your first foray, via Android, into writing mobile applications. It will give the grounding and knowledge you need to write applications using the current SDK, along with the flexibility to quickly adapt to future enhancements.
  • Posted by 삼스
    Android/App개발2009. 4. 21. 15:31

    G:\_PROJECT\Android\SDK\android-sdk-windows-1.1_r1\docs\sdk\1.1_r1\installing.html

    Installing the Android SDK

    This page describes how to install the Android 1.1 SDK, Release 1, and set up your development environment. If you haven't downloaded the SDK yet, you can so so from the Download page.

    Before you begin, be sure that your development environment meets the SDK System Requirements.

    Upgrading?

    If you have already developed applications using an earlier version of the SDK, please skip this page and read the Upgrading the SDK document instead.

    Installing the SDK

    After downloading the SDK, unpack the .zip archive to a suitable location on your machine. By default, the SDK files are unpacked into a directory named android_sdk_<platform>_<release>_<build>. The directory contains the subdirectories tools/, samples/, and others.

    Make a note of the name and location of the unpacked SDK directory on your system — you will need to refer to the SDK directory later, when setting up the Android plugin or using SDK tools.

    Optionally, you can add the path to the SDK tools directory to your path. As mentioned above, the tools/ directory is located in the SDK directory.

    • On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:
        export PATH=${PATH}:<your_sdk_dir>/tools
    • On a Mac, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile, if you haven't already set one up on your machine.
    • On Windows, right click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path under System Variables. Add the full path to the tools/ directory to the path.

    Adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory. Note that, if you update your SDK, you should remember to update your PATH settings to point to the new location, if different.

    Setting up Eclipse

    If you'll be developing with the Eclipse IDE, follow the following procedure to setup the IDE to use the Android SDK.

    Basically, you just need to update your Eclipse preferences to point to the Android SDK directory:

    1. Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences)
    2. Select Android from the left panel.
    3. For the SDK Location in the main panel, click Browse... and locate the SDK directory.
    4. Click Apply, then OK.

    Done! We now recommend that you install the ADT Eclipse plugin, which will provide some much-appreciated assistance in developing Android apps with Eclipse...

    Installing the Eclipse Plugin (ADT)

    If you will be using the Eclipse IDE as your environment for developing Android applications, you can install a custom plugin called Android Development Tools (ADT), which adds integrated support for Android projects and tools. The ADT plugin includes a variety of powerful extensions that make creating, running, and debugging Android applications faster and easier. Developing in ADT/Eclipse is highly recommended for Eclipse users and those new to Android.

    If you will not be using the Eclipse IDE, you do not need to download or install the ADT plugin. You can still develop Android applications using other tools.

    To download and install the ADT plugin, follow the steps below for your respective Eclipse version.

    Eclipse 3.3 (Europa) Eclipse 3.4 (Ganymede)
    1. Start Eclipse, then select Help > Software Updates > Find and Install....
    2. In the dialog that appears, select Search for new features to install and click Next.
    3. Click New Remote Site.
    4. In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
      https://dl-ssl.google.com/android/eclipse/

      Alternatively, you can use http in the Location URL, if you are having trouble with https (https is preferred for security reasons).

      http://dl-ssl.google.com/android/eclipse/

      Click OK.

    5. You should now see the new site added to the search list (and checked). Click Finish.
    6. In the subsequent Search Results dialog box, select the checkbox for Android Plugin > Developer Tools. This will check both features: "Android Developer Tools", and "Android Editors". The Android Editors feature is optional, but recommended. If you choose to install it, you need the WST plugin mentioned earlier in this page. Click Next.
    7. Read the license agreement and then select Accept terms of the license agreement. Click Next.
    8. Click Finish.
    9. The ADT plugin is not signed; you can accept the installation anyway by clicking Install All.
    10. Restart Eclipse.
    1. Start Eclipse, then select Help > Software Updates....
    2. In the dialog that appears, click the Available Software tab.
    3. Click Add Site...
    4. Enter this as the Location:
      https://dl-ssl.google.com/android/eclipse/

      Alternatively, you can use http in the Location URL, if you are having trouble with https (https is preferred for security reasons).

      http://dl-ssl.google.com/android/eclipse/

      Click OK.

    5. Back in the Available Software view, you should see the plugin. Select the checkbox next to Developer Tools and click Install...
    6. On the subsequent Install window, "Android Developer Tools", and "Android Editors" should both be checked. The Android Editors feature is optional, but recommended. If you choose to install it, you need the WST plugin mentioned earlier in this page. Click Next.
    7. Accept the license agreement and click Finish.
    8. Restart Eclipse.

    Troubleshooting ADT Installation

    If you are having trouble downloading the ADT plugin after following the steps above, here are some suggestions:

    • If Eclipse can not find the remote update site containing the ADT plugin, try changing the remote site URL to use http, rather than https. That is, set the Location for the remote site to:
      http://dl-ssl.google.com/android/eclipse/
    • If you are behind a firewall (such as a corporate firewall), make sure that you have properly configured your proxy settings in Eclipse. In Eclipse 3.3/3.4, you can configure proxy information from the main Eclipse menu in Window (on Mac, Eclipse) > Preferences > General > Network Connections.

    If you are still unable to use Eclipse to download the ADT plugin as a remote update site, you can download the ADT files to your local machine using a browser and the install the files in Eclipse from there:

    1. Download the ADT zip file (do not unpack it).
    2. Follow steps 1 and 2 in the default install instructions (above).
    3. In Eclipse 3.3, click New Archive Site....
      In Eclipse 3.4, click Add Site..., then Archive...
    4. Browse and select the downloaded the zip file.
    5. Follow the remaining procedures, above, starting from steps 5.

    Note that to update your plugin, you will have to follow these steps again instead of the default update instructions.

    Note that the "Android Editors" feature of ADT requires several optional Eclipse components (for example, WST). If you encounter an error when installing ADT, your Eclipse installion might not include those components. For information about how to quickly add the necessary components to your Eclipse installation, see the troubleshooting topic ADT Installation Error: "requires plug-in org.eclipse.wst.sse.ui".

    For Linux users

    If you encounter this error when installing the ADT Plugin for Eclipse:

    An error occurred during provisioning.
    Cannot connect to keystore.
    JKS

    ...then your development machine lacks a suitable Java VM. Installing Sun Java 6 will resolve this issue and you can then reinstall the ADT Plugin.

    Installation Notes

    Ubuntu Linux Notes

    • If you need help installing and configuring Java on your development machine, you might find these resources helpful:
    • Here are the steps to install Java and Eclipse, prior to installing the Android SDK and ADT Plugin.
      1. If you are running a 64-bit distribution on your development machine, you need to install the ia32-libs package using apt-get::
        apt-get install ia32-libs
      2. Next, install Java:
        apt-get install sun-java6-bin
      3. The Ubuntu package manager does not currently offer an Eclipse 3.3 version for download, so we recommend that you download Eclipse from eclipse.org (http://www.eclipse.org/ downloads/). A Java or RCP version of Eclipse is recommended.
      4. Follow the steps given in previous sections to install the SDK and the ADT plugin.

    Other Linux Notes

    • If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed at the top of this page. In particular, note that some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which are not supported for Android development.
    Posted by 삼스
    Android/Porting2009. 4. 20. 10:54
    http://kelp.or.kr/korweblog/stories.php?story=08/11/20/8615396



    Posted by 삼스
    Android/Porting2009. 4. 20. 10:47
    http://www.kandroid.org/board/board.php?board=toolchain&command=body&no=11

    android 1.0 전체소스의 컴파일용도로 사용하기 위한 Kandroid Toolchain Ver. 20081022 을 릴리즈 합니다.
    구글에 의해  릴리즈된 툴체인에 비해 페도라 및 우분투를 모두 안정적으로 지원하며, 툴체인의 디버깅을
    위해서 Stripping 하지 않고 만들어진 이른바 칸드로이드 툴체인입니다.  향후 아래의 "Final Goal"의 작업이
    완료되어 좀더 다양한 목적으로 사용가능한 툴체인으로 성장시킬 계획입니다.

                                         Last Modified on Nov-13-2008


    1. Final Goal
     - Fedora 배포판 개발자들이 툴체인 사용에 문제가 없도록 지원하도록 한다.
       (현재 구글의 안드로이드는 공식적으로 우분투를 지원하고 있음.)
     - 툴체인의 최근 피쳐를 적용하도록 한다.
     - 소스컴파일이 좀더 편리하게 필요 라이브러리를 내장하도록 한다.
     - 컴파일 되는 바이너리 최적화 및 경량화
     - 컴파일러파일들은 no stripped으로 보존하도록 한다.
     - arm v5T 이상 아키텍쳐에 대한 지원을 완전하게 지원하도록 한다.
     - Etc

    2. 버젼확인 방법
     f9#> cd /opt/
     f9#> wget  http://www.kandroid.org/devtools/kandroid-toolchain-for.android.1.0.20081022.tgz (Binary-41M)
     f9#> tar xzf kandroid-toolchain-for.android.1.0.20081022.tgz
     f9#> cd ./kandroid-toolchain-for.android.1.0.20081022
     f9#> ./bin/arm-kandroid-eabi-gcc --version [enter]


    3. Etc
      - 최종적인 작업이 완료되면 http://kat.sourceforget.net을 통해 다운로드를 제공하는 형태로 제공될수도 있습니다.
         (Kat : Korea Android Toolchain for Korean )
    Posted by 삼스
    Android/Porting2009. 4. 7. 16:16
    Posted by 삼스
    Android/Porting2009. 4. 6. 21:23
    Posted by 삼스
    Android/Porting2009. 4. 5. 16:01
    http://www.aesop.or.kr/?document_srl=23030

    토요일 오후에 안드로이드 소스코드를 빌드해보았습니다.
    생각보단 어렵진 않았지만 역시나 처음하는 거라서
    약간은 헤멨습니다.

    홈페이지는 http://source.android.com/download 입니다.


    주의사항
    --------

    1. root권한으로 작업할것. 그렇지 않으면 많은 삽질해야함.
    2. 디스크 용량이 충분한지 반드시 확인할것.
    3. Andriod SDK와 혼동하지 말것.
       여기서 시도하는 작업은 새 기계에 안드로이드 플랫폼을
       올리는것이 목적이지 안드로이드 응용프로그램 개발이 절대아님.

       안드로이드 응용 프로그램을 개발하고져 하는 분들은
       Windows용 Android SDK를 받아서 사용할것.
       http://code.google.com/android

    사전준비
    --------

    1. 리눅스나 MacOS가 설치된 x86호환 컴퓨터 필요
    2. 되도록이면 리눅스 권장(우분투 리눅스 권장)
    3. 여기서는 리눅스만 설명함(FedoraCore9에서 진행했음)
    4. 다음에 열거되는 리눅스 패키지를 설치할것
       하나라도 빠지면 빌드도중 에러 발생함.

    git 1.54 이후버전
    python 2.4
    JDK 5.0, update 12 이후 버전

    # apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
    # apt-get install valgrind

    .bash_profile 파일에 다음을 추가한다음 source .bash_profile

    export JAVA_HOME=/usr/java/jdk1.6.0_10
    PATH=$PATH:$HOME/bin:/usr/java/jdk1.6.0_10/bin


    코드 받아오기
    -------------

    # curl http://android.git.kernel.org/repo >~/bin/repo
    # chmod a+x ~/bin/repo

    # mkdir mydroid
    # cd mydroid

    # repo init -u git://android.git.kernel.org/platform/manifest.git
    # repo sync        

    sync 가 끝나면 올바른 이메일이 어쩌고 저쩌고 메세지가 나오는데 개발자로
    등록을 할게 아니라면 무시할것.


    빌드하기
    --------

    .bash_profile에 export ANDROID_JAVA_HOME=$JAVA_HOME 추가해 준다음
    source .bash_profile 하고 나서 cd ~/mydroid 디렉토로 이동한 다음
    make 할것.

    에러가 나면 에러메세지를 긁어다가 구글에서 검색해 볼것.

    필자의 경우 root가 아닌 일반계정으로 시도했다가 헤멨음.
    root 계정으로 하는 것이 속편함.

    위에 열거한 패키지중에 빠진것이 없는지 반드시 확인할것.

    JDK가 제대로 설치되지 않아서 javac, javah 같은 프로그램이 없다는
    에러가 발생했었고, gperf 가 설치되지 않은채로 빌드했다가
    web관련 코드가 제대로 파싱되지 않아서 오류가 났었고
    그이외에는 별다른 오류가 발생하지 않았음.

    빌드해본 소감을 말하자면..
    커널을 뺀 나머지는 거의 JAVA로 도배되어 있다는점
    현재는 Windows에서 빌드할수 없다는거..
    커널이 의외로 최신버전이라는 점(2.6.25)
    생각보다 싱겁게 빌드가 끝난다는거..
    * 고도리님에 의해서 게시물 복사되었습니다 (2008-10-31 21:02)
    Posted by 삼스