开发者

Getting code and setting up system, as well as writing code

I need help开发者_运维百科 on setting up my system to develop the Android OS (not apps the OS). I have an Ubuntu machine running 10.10, but I'm stuck on preparing my system and actually getting the code. What programs do I use? And what kind of things do I need to type to write the code?


This handy guide will walk you through setting up your system.

In general, you will need to install:

  • Git
  • Python 2.4
  • JDK 5 (froyo or older) or JDK 6 (gingerbread or newer)

What programs do I use?

Eclipse seems to be the most popular IDE for working with Android. Personally, I like using a plain old editor (emacs, vi, kate, etc.) and a terminal window.


Here is my setup:

  • Android SDK unzipped to ~/sdk/
  • Add ~/sdk/android-sdk-linux_x86/tools and ~/sdk/android-sdk-linux_x86/platform-tools to your path:

    echo "PATH=$PATH:~/sdk/android-sdk-linux_x86/tools:~/sdk/android-sdk-linux_x86/platform-tools" >> ~/.profile

  • install sun-java6-jdk. first enable the partner repository.

    sudo apt-get install sun-java6-jdk

  • install ant

    sudo apt-get install ant

  • you'll have to choose an editor. if you like gedit, I suggest adding the ubuntu-on-rails ppa (http://www.webupd8.org/2010/12/get-textmate-features-and-styles-in.html) and installing gedit-gmate. if you're a vim person, I suggest install vim-scripts

To support your real phone you may need to create a udev rules file. Google 'android ubuntu udev your-phone-model' for help. For instance, for a nexus one you would:
- add /etc/udev/rules.d/51-android.rules with one line:

SUBSYSTEM=="usb", SYSFS{idVendor}=="18D1", MODE="0666"

After all of that, http://android.developer.com is your best friend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜