diff --git a/pdk/Pdk.mk b/pdk/Pdk.mk index abe9491d2..fbe8b5c90 100644 --- a/pdk/Pdk.mk +++ b/pdk/Pdk.mk @@ -16,7 +16,7 @@ # Assemble the Platform Development Kit (PDK) # (TODO) Figure out why $(ACP) builds with target ndk but not pdk_docs -# (TODO) Build doxygen (depend on latest version) +# (TODO) Build doxygen (depend on latest version) -> line 25 error pdk: @echo "Package: $@ has targets ndk, pdk_docs and pdk_all" @@ -38,6 +38,8 @@ include $(LOCAL_PATH)/ndk/Ndk.mk # Doxygenize the header files to create html docs in the generatedDocs dir. # Copy the appengine files, the template files and the generated html # to the docs dir and zip everything up to the distribution directory. +# Run javadocs/droiddocs/clearsilver on the generatedDocs dir to get the right +# styles added to the html. # Workspace directory @@ -149,13 +151,27 @@ $(pdk_docs_intermediates)/pdk.py: $(pdk_hosting_dir)/pdk.py @echo "PDK: $@" $(copy-file-to-target-with-cp) +# Copy appengine server files for new system +$(OUT_DOCS)/app.yaml: $(pdk_hosting_dir)/app.yaml + @echo "PDK: $@" + $(copy-file-to-target-with-cp) + +$(OUT_DOCS)/pdk.py: $(pdk_hosting_dir)/pdk.py + @echo "PDK: $@" + $(copy-file-to-target-with-cp) + +# All the files that we depend upon +all_pdk_docs_files := $(pdk_doxygen_config_override_file) \ + $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \ + $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \ + $(pdk_doxy_docsfiles_dir)/main.dox all_copied_pdk_templates # Run doxygen and copy all output and templates to the final destination # We replace index.html with a template file so don't use the generated one pdk_doxygen: all_copied_pdk_headers $(pdk_doxygen_config_override_file) \ $(pdk_doxygen_config_file) $(pdk_docs_intermediates)/header.html \ $(pdk_docs_intermediates)/footer.html $(pdk_doxy_docsfiles_dir)/groups.dox \ - $(pdk_doxy_docsfiles_dir)/main.dox + $(pdk_doxy_docsfiles_dir)/main.dox @echo "Files for Doxygination: $^" @mkdir -p $(pdk_generated_source_dir) @rm -f $(pdk_generated_source_dir)/* @@ -164,7 +180,40 @@ pdk_doxygen: all_copied_pdk_headers $(pdk_doxygen_config_override_file) \ @cd $(pdk_generated_source_dir) && chmod ug+rx * @rm -f $(pdk_generated_source_dir)/index.html @cp -fp $(pdk_generated_source_dir)/* $(pdk_docs_dest_dir) - + + +# ==== docs for the web (on the google app engine server) ======================= +# Run javadoc/droiddoc/clearsilver to get the formatting right + +# make droiddocs run after we make our doxygen docs +$(pdk_docs_intermediates)/pdk-timestamp: pdk_doxygen + @touch $(pdk_docs_intermediates)/pdk-timestamp + +$(LOCAL_PATH)/pdk-timestamp: $(pdk_docs_intermediates)/pdk-timestamp + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := pdk-timestamp samples/samplejni/src/com/example/jniexample/JNIExample.java +LOCAL_MODULE_CLASS := development/pdk/ndk/samples/samplejni/src/com/example/jniexample +LOCAL_DROIDDOC_SOURCE_PATH := $(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH) +LOCAL_DROIDDOC_HTML_DIR := ../../../$(pdk_docs_dest_dir) + +LOCAL_MODULE := online-pdk + +LOCAL_DROIDDOC_OPTIONS := \ + $(framework_docs_LOCAL_DROIDDOC_OPTIONS) \ + $(web_docs_sample_code_flags) \ + -toroot /online-pdk/ \ + -hdf android.whichdoc online-pdk + +LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR := build/tools/droiddoc/templates-pdk +LOCAL_DROIDDOC_CUSTOM_ASSET_DIR := assets-pdk + +include $(BUILD_DROIDDOC) + +# The docs output dir is: out/target/common/docs/online-pdk +DOCS_OUT_DIR := $(OUT_DOCS)/$(LOCAL_MODULE) + # Name the tar files name := android_pdk_docs-$(REQUESTED_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) @@ -173,21 +222,25 @@ endif name := $(name)-$(BUILD_NUMBER) pdk_docs_tarfile := $(pdk_docs_intermediates)/$(name).tar pdk_docs_tarfile_zipped := $(pdk_docs_tarfile).gz +new_pdk_docs_tarfile := $(pdk_docs_intermediates)/new-$(name).tar +new_pdk_docs_tarfile_zipped := $(new_pdk_docs_tarfile).gz -.PHONY: pdk pdk_docs pdk_doxygen all_copied_pdk_headers all_copied_pdk_templates +.PHONY: pdk pdk_docs pdk_doxygen all_copied_pdk_headers all_copied_pdk_templates pdk-timestamp -pdk_docs: $(pdk_docs_tarfile_zipped) +pdk_docs: $(pdk_docs_tarfile_zipped) $(new_pdk_docs_tarfile) @echo "PDK: Docs tarred and zipped" # Put the pdk_docs zip files in the distribution directory $(call dist-for-goals,pdk_docs,$(pdk_docs_tarfile_zipped)) +$(call dist-for-goals,pdk_docs,$(new_pdk_docs_tarfile_zipped)) # zip up tar files %.tar.gz: %.tar - @echo "PDK: zipped $<" + @echo "PDK docs: zipped $<" $(hide) gzip -cf $< > $@ # tar up all the files to make the pdk docs. +# old version $(pdk_docs_tarfile): pdk_doxygen all_copied_pdk_templates \ $(pdk_docs_intermediates)/pdk.py $(pdk_docs_intermediates)/app.yaml @echo "PDK: $@" @@ -195,6 +248,13 @@ $(pdk_docs_tarfile): pdk_doxygen all_copied_pdk_templates \ @rm -f $@ $(hide) tar rf $@ -C $(pdk_docs_intermediates) docs pdk.py app.yaml +# new version +$(new_pdk_docs_tarfile): $(DOCS_OUT_DIR)-timestamp + @echo "PDK docs: $@" + @mkdir -p $(dir $@) + @rm -f $@ + $(hide) tar rf $@ -C $(OUT_DOCS) $(LOCAL_MODULE) + # Debugging reporting can go here, add it as a target to get output. pdk_debug: @echo "You are here: $@" diff --git a/pdk/README b/pdk/README index 86621552e..18ff5d120 100644 --- a/pdk/README +++ b/pdk/README @@ -4,78 +4,72 @@ Building the pdk (platform development kit) (We currently support version 1.4.6) sudo apt-get install doxygen + +Make sure that you are using the right version of java + + sudo update-java-alternatives -s java-1.5.0-sun + +If that doesn't work, go through the instructions on + + http://source.android.com/download again. + 2) from the root . build/envsetup.sh -3) run choosecombo - Build for the simulator or the device? - 1. Device - 2. Simulator - - Which would you like? [1] 1 - - - Build type choices are: - 1. release - 2. debug - - Which would you like? [1] 1 - - - Product choices are: - 0. emulator - 1. generic - 2. sim - 3. surf - You can also type the name of a product if you know it. - Which would you like? [generic] 1 - - - Variant choices are: - 1. user - 2. userdebug - 3. eng - Which would you like? [eng] 3 - - ============================================ - TARGET_PRODUCT=generic - TARGET_BUILD_VARIANT=eng - TARGET_SIMULATOR=false - TARGET_BUILD_TYPE=release - TARGET_ARCH=arm - HOST_ARCH=x86 - HOST_OS=linux - HOST_BUILD_TYPE=release - BUILD_ID= - ============================================ 4) mkdir dist mkdir logs - mkpdkcupcake.sh + +then build everything: -(which contains: + time make -j4 pdk pdk_all dist DIST_DIR=dist 2>&1 | tee logs/`date +%y%m%d-%H%M%S` -DT=`date +%y%m%d-%H%M%S` -time make -j4 pdk pdk_all dist DIST_DIR=dist 2>&1 | tee logs/$DT +so you can have a record of the build commands in the logs directory. -so you can see the results of the build in the logs directory.) 5) the pdk tar file is put in the dist directory. +6) the pdk-docs are in + + out/target + The build target 'pdk' brings in the pdk/ndk make files into the build system. - Then there are three targets: - pdk_docs - which builds the pdk documentation - ndk - which builds the native development kit (native compiler, linker, etc.) - pdk_all - which builds the above two targets + Then there are three targets: + pdk_docs - which builds just the pdk documentation + ndk - which builds the native development kit (native compiler, linker, etc.) + pdk_all - which builds the above two targets -for doxygen version changing you can pass in the variable: -doxygen_version='' +To chnage which version of doxygen runs you can pass in the variable: + doxygen_version='' on the make line. -------------------------------------------------------------------------------- -To host the pdk docs on appengine run: -/home/build/static/projects/apphosting/devtools/appcfg.py update pdk/ -where the pdk directory contains: pdk.py, app.yaml, and the docs directory, -all of which are tarred up by the Pdk.mk file when using the targer pdk_docs. +# Testing +You must install google appengine. See: http://code.google.com/appengine/downloads.html + +Here's the command to run the pdk-docs server locally: + python /dev_appserver.py --address 0.0.0.0 \ + /android/out/target/common/docs/online-pdk + +To verify it is working you can access it with a browser loacally on port 8080: + +http://localhost:8080/index.html +TODO: index.html needs correct links. +TODO: app.yaml not working for redirecting, getting extra '.' in html names... + + -------------------------------------------------------------------------------- +# Deployment +To host the pdk docs on the interanl appengine run: +/home/build/static/projects/apphosting/devtools/appcfg.py update /out/common/docs +where the docs directory contains: pdk.py, app.yaml, and the online-pdk directory, +all of which are tarred up by the Pdk.mk file when using the target pdk_docs. + +# Deployment +To host the pdk docs on the external appengine run: +/home/build/static/projects/apphosting/devtools/appcfg.py -s pdk-docs.appspot.com update /out/common/docs +where the docs directory contains: pdk.py, app.yaml, and the online-pdk directory, +all of which are tarred up by the Pdk.mk file when using the target pdk_docs. + + diff --git a/pdk/docs/audio_sub_system.html b/pdk/docs/audio_sub_system.html deleted file mode 100755 index 8639cf0b1..000000000 --- a/pdk/docs/audio_sub_system.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

AudioHardwareInterface serves as the glue between proprietary audio drivers and the Android AudioFlinger service, the core audio service that handles all audio-related requests from applications.

-

- -Solid elements represent Android blocks and dashed elements represent partner-specific blocks. - - - -

Building an Audio Library

- -

To implement an audio driver, create a shared library that implements the interface defined in AudioHardwareInterface.h. You must name your shared library libaudio.so so that it will get loaded from /system/lib at runtime. Place libaudio sources and Android.mk in partner/acme/chipset_or_board/libaudio/.

-

The following stub Android.mk file ensures that libaudio compiles and links to the appropriate libraries:

- -
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libaudio
-
-LOCAL_SHARED_LIBRARIES := \
-    libcutils \
-    libutils \
-    libmedia \
-    libhardware
-
-LOCAL_SRC_FILES += MyAudioHardware.cpp
-
-LOCAL_CFLAGS +=
-
-LOCAL_C_INCLUDES +=
-
-LOCAL_STATIC_LIBRARIES += libaudiointerface
-
-include $(BUILD_SHARED_LIBRARY)
-
- - -

Interface

- - - -

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

- - - - - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/audio_sub_system.jd b/pdk/docs/audio_sub_system.jd new file mode 100755 index 000000000..903032fad --- /dev/null +++ b/pdk/docs/audio_sub_system.jd @@ -0,0 +1,56 @@ +page.title=Audio +pdk.version=1.0 +@jd:body + + + + +

Introduction

+ +

AudioHardwareInterface serves as the glue between proprietary audio drivers and the Android AudioFlinger service, the core audio service that handles all audio-related requests from applications.

+

+ +Solid elements represent Android blocks and dashed elements represent partner-specific blocks. + + + +

Building an Audio Library

+ +

To implement an audio driver, create a shared library that implements the interface defined in AudioHardwareInterface.h. You must name your shared library libaudio.so so that it will get loaded from /system/lib at runtime. Place libaudio sources and Android.mk in partner/acme/chipset_or_board/libaudio/.

+

The following stub Android.mk file ensures that libaudio compiles and links to the appropriate libraries:

+ +
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libaudio
+
+LOCAL_SHARED_LIBRARIES := \
+    libcutils \
+    libutils \
+    libmedia \
+    libhardware
+
+LOCAL_SRC_FILES += MyAudioHardware.cpp
+
+LOCAL_CFLAGS +=
+
+LOCAL_C_INCLUDES +=
+
+LOCAL_STATIC_LIBRARIES += libaudiointerface
+
+include $(BUILD_SHARED_LIBRARY)
+
+ + +

Interface

+ + + +

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

+ + + diff --git a/pdk/docs/bluetooth.html b/pdk/docs/bluetooth.html deleted file mode 100755 index edd3c260d..000000000 --- a/pdk/docs/bluetooth.html +++ /dev/null @@ -1,276 +0,0 @@ - -

- - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -

- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 host stack.

- -

Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.

- -

Headset and Handsfree (v1.5) profiles are implemented in the Android framework and are both tightly coupled with the Phone App. These profiles are also SIG qualified.

- -

The diagram below offers a library-oriented view of the Bluetooth stack. Click Bluetooth Process Diagram for a process-oriented view.

- -

- -Solid elements represent Android blocks and dashed elements represent partner-specific blocks. - - - -

Porting

- -

BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points:

-

    -
  • UART driver
  • -
  • Bluetooth Power On / Off
  • -
-

- - -

UART Driver

- -

The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the hciattach daemon.

-

For example, for MSM7201A, this is drivers/serial/msm_serial.c. You may also need to edit command line options to hciattach via init.rc.

- - -

Bluetooth Power On / Off

- -

The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0.

- -

    -
  • 1.0: Android framework writes a 0 or 1 to /sys/modules/board_[PLATFORM]/parameters/bluetooth_power_on.
  • - -
  • Post 1.0: Android framework uses the linux rfkill API. See arch/arm/mach-msm/board-trout-rfkill.c for an example.
  • -
-

- - -

Tools

- -

BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:

-

    -
  • hciconfig
  • -
  • hcitool
  • -
  • hcidump
  • -
  • sdptool
  • -
  • dbus-send
  • -
  • dbus-monitor
  • -
-

- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/bluetooth.jd b/pdk/docs/bluetooth.jd new file mode 100755 index 000000000..a21ad7dea --- /dev/null +++ b/pdk/docs/bluetooth.jd @@ -0,0 +1,82 @@ +page.title=Bluetooth +@jd:body + + + +

Introduction

+ +

Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 host stack.

+ +

Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.

+ +

Headset and Handsfree (v1.5) profiles are implemented in the Android framework and are both tightly coupled with the Phone App. These profiles are also SIG qualified.

+ +

The diagram below offers a library-oriented view of the Bluetooth stack. Click Bluetooth Process Diagram for a process-oriented view.

+ +

+ +Solid elements represent Android blocks and dashed elements represent partner-specific blocks. + + + +

Porting

+ +

BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points:

+

    +
  • UART driver
  • +
  • Bluetooth Power On / Off
  • +
+

+ + +

UART Driver

+ +

The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the hciattach daemon.

+

For example, for MSM7201A, this is drivers/serial/msm_serial.c. You may also need to edit command line options to hciattach via init.rc.

+ + +

Bluetooth Power On / Off

+ +

The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0.

+ +

    +
  • 1.0: Android framework writes a 0 or 1 to /sys/modules/board_[PLATFORM]/parameters/bluetooth_power_on.
  • + +
  • Post 1.0: Android framework uses the linux rfkill API. See arch/arm/mach-msm/board-trout-rfkill.c for an example.
  • +
+

+ + +

Tools

+ +

BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:

+

    +
  • hciconfig
  • +
  • hcitool
  • +
  • hcidump
  • +
  • sdptool
  • +
  • dbus-send
  • +
  • dbus-monitor
  • +
+

+ + + diff --git a/pdk/docs/bring_up.html b/pdk/docs/bring_up.jd similarity index 66% rename from pdk/docs/bring_up.html rename to pdk/docs/bring_up.jd index b70a35dd5..763f85e36 100755 --- a/pdk/docs/bring_up.html +++ b/pdk/docs/bring_up.jd @@ -1,184 +1,12 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Bring Up

+page.title=Bring Up +@jd:body

Once your code is built and you have verified that all necessary directories exist, power on and test your device with basic bring up, as described below. Bring up tests are typically designed to stress certain aspects of your system and allow you to characterize the device's behavior.

 

1. Confirm a Clean Installation of a Basic Linux Kernel

Before considering Android-specific modifications to the Linux kernel, verify that you can build, deploy, and boot a core Linux kernel on your target hardware.

 

+

2. Modify Your Kernel Configuration to Accommodate Android Drivers

Your kernel configuration file should include the following:

@@ -530,32 +358,3 @@ service akmd /sbin/akmd
 
-

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
-
- - diff --git a/pdk/docs/build_new_device.html b/pdk/docs/build_new_device.html deleted file mode 100755 index cbf9ed7a5..000000000 --- a/pdk/docs/build_new_device.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Building Android for a new Mobile Device

- - - - -
- -

Detailed Instructions

- -

The directions below describe how to configure make files for new mobile devices and products.

-
    -
  1. Create a company directory in //device/partner.
    -
    -  mkdir device/partner/<company_name>
  2. -
  3. Create a products directory beneath the company directory you created in step 1.
    -
    -  mkdir device/partner/<company_name>/products/
  4. -
  5. Create a product-specific make file, called device/partner/<company_name>/products/<first_product_name>.mk, that includes the following code:
    -
    -  $(call inherit-product, target/product/generic.mk)
    -  #
    -  # Overrides
    -  PRODUCT_NAME := <first_product_name>
    -  PRODUCT_DEVICE := <board_name>
  6. -
  7. In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files.
    -
    -  #
    -  # This file should set PRODUCT_MAKEFILES to a list of product makefiles
    -  # to expose to the build system.  LOCAL_DIR will already be set to
    -  # the directory containing this file. 
    -  #
    -  # This file may not rely on the value of any variable other than
    -  # LOCAL_DIR; do not use any conditionals, and do not look up the
    -  # value of any variable that isn't set in this file or in a file that
    -  # it includes.
    -  #
    -  
    -  PRODUCT_MAKEFILES := \
    -    $(LOCAL_DIR)/first_product_name.mk \
  8. -
  9. Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
    -
    -  mkdir device/partner/<company_name>/<board_name>
  10. -
  11. Create a product_config.mk file in the directory created in the previous step (device/partner/<company_name>/<board_name>). If this directory does not include a product_config.mk file, the build will fail.
    -
    -  # These definitions override the defaults in config/config.make for <board_name>
    -  #
    -  # TARGET_NO_BOOTLOADER := false
    -  # TARGET_HARDWARE_3D := false 
    -  #
    -  TARGET_USE_GENERIC_AUDIO := true
  12. -
  13. If you wish to modify system properties, create a system.prop file in your <board_name> directory(device/partner/<company_name>/<board_name>).
    -
    -  # system.prop for 
    -  # This overrides settings in the products/generic/system.prop file
    -  #
    -  # rild.libpath=/system/lib/libreference-ril.so
    -  # rild.libargs=-d /dev/ttyS0
  14. -
  15. Add a pointer to <second_product_name>.mk within products/AndroidProducts.mk.
    -
    -  PRODUCT_MAKEFILES := \
    -    $(LOCAL_DIR)/first_product_name.mk \
    -    $(LOCAL_DIR)/second_product_name.mk
  16. -
  17. device/partner/<company_name>/<board_name> must include an Android.mk file with at least the following code:

    -
    -  # make file for new hardware  from 
    -  #
    -  LOCAL_PATH := $(call my-dir)
    -  #
    -  # this is here to use the pre-built kernel
    -  ifeq ($(TARGET_PREBUILT_KERNEL),)
    -  TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel
    -  endif
    -  #
    -  file := $(INSTALLED_KERNEL_TARGET)
    -  ALL_PREBUILT += $(file)
    -  $(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
    -		$(transform-prebuilt-to-target)
    -  #
    -  # no boot loader, so we don't need any of that stuff..  
    -  #
    -  LOCAL_PATH := partner/<company_name>/<board_name>
    -  #
    -  include $(CLEAR_VARS)
    -  #
    -  # include more board specific stuff here? Such as Audio parameters.      
    -  #
  18. -
  19. To create a second product for the same board, create a second product-specific make file called device/partner/company_name/products/<second_product_name>.mk that includes:
    -
    -  $(call inherit-product, partner/google/products/generic.mk)
    -  #
    -  # Overrides
    -  PRODUCT_NAME := <second_product_name>
    -  PRODUCT_DEVICE := <board_name>
  20. -
-

By now, you should have two new products, called <first_product_name> and <second_product_name> associated with <company_name>. To verify that a product is properly configured (<first_product_name>, for example), execute the following:
-

-  cd device
-  . ./envsetup.sh
-  partner_setup <first_product_name>
-  make PRODUCT-<first_product_name>-user
-
-

You should find new build binaries located in device/out/target/product/<board_name>. - - -

New Product File Tree

- -

The file tree below illustrates what your own system should look like after completing the steps above.

-

-

    -
  • <company_name>
  • -
      -
    • <board_name>
    • -
        -
      • Android.mk
      • -
      • product_config.mk
      • -
      • system.prop
      • -
      -
    • products
    • -
        -
      • AndroidProducts.mk
      • -
      • <first_product_name>.mk
      • -
      • <second_product_name>.mk
      • -
      -
    -
-

- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/build_new_device.jd b/pdk/docs/build_new_device.jd new file mode 100755 index 000000000..f0a816f54 --- /dev/null +++ b/pdk/docs/build_new_device.jd @@ -0,0 +1,130 @@ +page.title=Building Android for a new Mobile Device +pdk.version=1.0 +@jd:body + + + + + + +

Detailed Instructions

+ +

The directions below describe how to configure make files for new mobile devices and products.

+
    +
  1. Create a company directory in //device/partner.
    +
    +  mkdir device/partner/<company_name>
  2. +
  3. Create a products directory beneath the company directory you created in step 1.
    +
    +  mkdir device/partner/<company_name>/products/
  4. +
  5. Create a product-specific make file, called device/partner/<company_name>/products/<first_product_name>.mk, that includes the following code:
    +
    +  $(call inherit-product, target/product/generic.mk)
    +  #
    +  # Overrides
    +  PRODUCT_NAME := <first_product_name>
    +  PRODUCT_DEVICE := <board_name>
  6. +
  7. In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files.
    +
    +  #
    +  # This file should set PRODUCT_MAKEFILES to a list of product makefiles
    +  # to expose to the build system.  LOCAL_DIR will already be set to
    +  # the directory containing this file. 
    +  #
    +  # This file may not rely on the value of any variable other than
    +  # LOCAL_DIR; do not use any conditionals, and do not look up the
    +  # value of any variable that isn't set in this file or in a file that
    +  # it includes.
    +  #
    +  
    +  PRODUCT_MAKEFILES := \
    +    $(LOCAL_DIR)/first_product_name.mk \
  8. +
  9. Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
    +
    +  mkdir device/partner/<company_name>/<board_name>
  10. +
  11. Create a product_config.mk file in the directory created in the previous step (device/partner/<company_name>/<board_name>). If this directory does not include a product_config.mk file, the build will fail.
    +
    +  # These definitions override the defaults in config/config.make for <board_name>
    +  #
    +  # TARGET_NO_BOOTLOADER := false
    +  # TARGET_HARDWARE_3D := false 
    +  #
    +  TARGET_USE_GENERIC_AUDIO := true
  12. +
  13. If you wish to modify system properties, create a system.prop file in your <board_name> directory(device/partner/<company_name>/<board_name>).
    +
    +  # system.prop for 
    +  # This overrides settings in the products/generic/system.prop file
    +  #
    +  # rild.libpath=/system/lib/libreference-ril.so
    +  # rild.libargs=-d /dev/ttyS0
  14. +
  15. Add a pointer to <second_product_name>.mk within products/AndroidProducts.mk.
    +
    +  PRODUCT_MAKEFILES := \
    +    $(LOCAL_DIR)/first_product_name.mk \
    +    $(LOCAL_DIR)/second_product_name.mk
  16. +
  17. device/partner/<company_name>/<board_name> must include an Android.mk file with at least the following code:

    +
    +  # make file for new hardware  from 
    +  #
    +  LOCAL_PATH := $(call my-dir)
    +  #
    +  # this is here to use the pre-built kernel
    +  ifeq ($(TARGET_PREBUILT_KERNEL),)
    +  TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel
    +  endif
    +  #
    +  file := $(INSTALLED_KERNEL_TARGET)
    +  ALL_PREBUILT += $(file)
    +  $(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
    +		$(transform-prebuilt-to-target)
    +  #
    +  # no boot loader, so we don't need any of that stuff..  
    +  #
    +  LOCAL_PATH := partner/<company_name>/<board_name>
    +  #
    +  include $(CLEAR_VARS)
    +  #
    +  # include more board specific stuff here? Such as Audio parameters.      
    +  #
  18. +
  19. To create a second product for the same board, create a second product-specific make file called device/partner/company_name/products/<second_product_name>.mk that includes:
    +
    +  $(call inherit-product, partner/google/products/generic.mk)
    +  #
    +  # Overrides
    +  PRODUCT_NAME := <second_product_name>
    +  PRODUCT_DEVICE := <board_name>
  20. +
+

By now, you should have two new products, called <first_product_name> and <second_product_name> associated with <company_name>. To verify that a product is properly configured (<first_product_name>, for example), execute the following:
+

+  cd device
+  . ./envsetup.sh
+  partner_setup <first_product_name>
+  make PRODUCT-<first_product_name>-user
+
+

You should find new build binaries located in device/out/target/product/<board_name>. + + +

New Product File Tree

+ +

The file tree below illustrates what your own system should look like after completing the steps above.

+

+

    +
  • <company_name>
  • +
      +
    • <board_name>
    • +
        +
      • Android.mk
      • +
      • product_config.mk
      • +
      • system.prop
      • +
      +
    • products
    • +
        +
      • AndroidProducts.mk
      • +
      • <first_product_name>.mk
      • +
      • <second_product_name>.mk
      • +
      +
    +
+

diff --git a/pdk/docs/build_system.html b/pdk/docs/build_system.jd similarity index 62% rename from pdk/docs/build_system.html rename to pdk/docs/build_system.jd index 4286e71f0..b157f4dbc 100755 --- a/pdk/docs/build_system.html +++ b/pdk/docs/build_system.jd @@ -1,179 +1,6 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Android Build System

- +page.title=Android Build System +pdk.version=1.0 +@jd:body @@ -425,34 +252,3 @@ Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
 % make -j4
 
- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
-
- - diff --git a/pdk/docs/camera.html b/pdk/docs/camera.html deleted file mode 100755 index 1b6565984..000000000 --- a/pdk/docs/camera.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android's camera subsystem connects the camera application to the application framework and user space libraries, which in turn communicate with the camera hardware layer that operates the physical camera.

-

The diagram below illustrates the structure of the camera subsystem.

-

- - -

Building a Camera Library

- -

To implement a camera driver, create a shared library that implements the interface defined in CameraHardwareInterface.h. You must name your shared library libcamera.so so that it will get loaded from /system/lib at runtime. Place libcamera sources and Android.mk in partner/acme/chipset_or_board/libcamera/.

-

The following stub Android.mk file ensures that libcamera compiles and links to the appropriate libraries:

-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libcamera
-
-LOCAL_SHARED_LIBRARIES := \
-    libutils \
-    librpc \
-    liblog
-
-LOCAL_SRC_FILES += MyCameraHardware.cpp
-
-LOCAL_CFLAGS +=
-
-LOCAL_C_INCLUDES +=
-
-LOCAL_STATIC_LIBRARIES += \
-    libcamera-common \
-    libclock-rpc \
-    libcommondefs-rpc
-
-include $(BUILD_SHARED_LIBRARY)
-
- - -

Sequence Diagrams

- - - -

Preview

- -

The following diagram illustrates the sequence of function calls and actions necessary for your camera to preview.

- - - -

Taking a Picture

- -

The following diagram illustrates the sequence of function calls and actions necessary for your camera to take a picture.

- - - -

Interface

- - - -

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

- - - - - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/camera.jd b/pdk/docs/camera.jd new file mode 100755 index 000000000..85ed3dc4f --- /dev/null +++ b/pdk/docs/camera.jd @@ -0,0 +1,87 @@ +page.title=Camera Subsystem +@jd:body + + + +

Introduction

+ +

Android's camera subsystem connects the camera application to the application framework and user space libraries, which in turn communicate with the camera hardware layer that operates the physical camera.

+

The diagram below illustrates the structure of the camera subsystem.

+

+ + +

Building a Camera Library

+ +

To implement a camera driver, create a shared library that implements the interface defined in CameraHardwareInterface.h. You must name your shared library libcamera.so so that it will get loaded from /system/lib at runtime. Place libcamera sources and Android.mk in partner/acme/chipset_or_board/libcamera/.

+

The following stub Android.mk file ensures that libcamera compiles and links to the appropriate libraries:

+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libcamera
+
+LOCAL_SHARED_LIBRARIES := \
+    libutils \
+    librpc \
+    liblog
+
+LOCAL_SRC_FILES += MyCameraHardware.cpp
+
+LOCAL_CFLAGS +=
+
+LOCAL_C_INCLUDES +=
+
+LOCAL_STATIC_LIBRARIES += \
+    libcamera-common \
+    libclock-rpc \
+    libcommondefs-rpc
+
+include $(BUILD_SHARED_LIBRARY)
+
+ + +

Sequence Diagrams

+ + + +

Preview

+ +

The following diagram illustrates the sequence of function calls and actions necessary for your camera to preview.

+ + + +

Taking a Picture

+ +

The following diagram illustrates the sequence of function calls and actions necessary for your camera to take a picture.

+ + + +

Interface

+ + + +

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

+ + + + + diff --git a/pdk/docs/display_drivers.html b/pdk/docs/display_drivers.jd similarity index 61% rename from pdk/docs/display_drivers.html rename to pdk/docs/display_drivers.jd index c20afe547..d1272079e 100755 --- a/pdk/docs/display_drivers.html +++ b/pdk/docs/display_drivers.jd @@ -1,187 +1,12 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Display Drivers

- - +page.title=Display Drivers +@jd:body
+Troubleshooting

Introduction

@@ -513,32 +338,3 @@ MODULE_LICENSE("GPL");

Android relies on a double buffer to smoothly render page flips (please see Functionality for details). -

- -

-
- -
- -
- - - - - - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/getting_source_code.html b/pdk/docs/getting_source_code.html deleted file mode 100755 index ad0cddbd4..000000000 --- a/pdk/docs/getting_source_code.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android relies on Git, a version control system, to install the Android platform. You will need to install Git 1.5.2 or greater in order to access the source tree. Please visit http://git.or.cz/ for more information regarding Git.

-

Git permits you to control access to working directories, and we recommend that you use it to limit Android repository access to only a few people within your organization (please refer to your Google NDA for potential contractual restraints on sharing Android source access).

-

You may clone Google's repository to a local copy for sharing internally (see Git documentation for details).

- - -

Installing and Configuring Git

- -

To install the Git package, execute:

-
-% sudo apt-get install git-core
-
- - -

Establishing Server Access

- -

Once Git is cleanly installed, you need to establish a connection with Google's Git server, a connection that requires an RSA key in order to authenticate requests.

- - -

Generating RSA Keys

- -

Each developer must have a unique RSA key in order to access Android source code. To generate an RSA key:

-

-

    -
  1. Type:
    -
    % ssh-keygen -t rsa -C  email@domain.com

    -You must use a valid email address to create your key.
  2. -
  3. When prompted, indicate the file to which you wish to write your key (id_rsa in this example).
  4. -
  5. When prompted, associate a passphrase with your key.
  6. -
  7. Upon success, you should have two files saved to the designated directory:
  8. -
      -
    • id_rsa: This file contains the private half of your RSA key. You shouldn't share this file with anyone.
    • -
    • id_rsa.pub: This is the public half or your RSA key and you should send it to your Google technical account manager.
    • -
    -
-

-

Send your Google Account Manager your public key file in order to establish Git server access.

- - -

Verifying a Connection to the Git Server

- -

Once you have generated an RSA key and shared the public file with Google, you can test your connection with the Git server with the following command:

-
-% ssh  android-git.ext.google.com
-
- -

You should receive one of the following results:

- - - - - - - - - - - - - - - - - - - - - - -
ResultCauseAction
-fatal: What do you think I am? A shell?
-Connection to android-git closed.
-
SuccessNone. You successfully connected to the Git server. (You should not have shell access and it's expected to receive this error.)
ssh hangs and eventually times out. Your setup is failing to locate and establish a basic connection. Google needs to debug network settings.
Error: Permission denied <public key> Either you are not using the matching username or the RSA private key does not match the public key. Try executing:
- -% ssh $USER@android- - git.ext.google.com -
- - -

Downloading Code

- -

Android source code is maintained in two repositories: device and kernel. The device repository includes the Android framework (things like the Activity Manager, Window Manager, Telephony Manager, View System, etc.). The kernel repository includes the core code necessary to run the operating system (things like the Display Driver, Camera Driver, Keypad Driver, Power Management, etc.). (Please see What is Android? for details.)

- -

Save device and kernel code at the same directory level, for example:

-

-

  • /home/joe/android/device
  • -
  • /home/joe/android/kernel
  • -

-

Device Code

-

To download device code, you need your username and a unique <path> string supplied by Google to execute the following:

-
-% git-clone $USER@android-git.ext.google.com:<path>/device.git
-
- -

Kernel Code

-

To download kernel code, you need your username and a unique <path> string supplied by Google to execute the following:

-
-% git-clone $USER@android-git.ext.google.com:<path>/kernel.git
-
- - - -

Extracting an Android Patch

- -

You likely already have Linux running on your platform and only need to integrate Android-specific changes. The following directions describe how to extract an Android patch.

-
    -
  1. Download a generic version of the Linux kernel that matches the Linux version downloaded with the Android Kernel code.
  2. -
  3. Run diff on the two kernel packages to get Android-specific changes.
  4. -
  5. Apply the patch to your target kernel and build.
  6. -
- - -

- -

-
- -
- -
- - - -
- - - -
v0.5 - 25 September 2008
- - - diff --git a/pdk/docs/getting_source_code.jd b/pdk/docs/getting_source_code.jd new file mode 100755 index 000000000..19a7069ab --- /dev/null +++ b/pdk/docs/getting_source_code.jd @@ -0,0 +1,126 @@ +page.title=Getting Source Code +@jd:body + + + + +

Introduction

+ +

Android relies on Git, a version control system, to install the Android platform. You will need to install Git 1.5.2 or greater in order to access the source tree. Please visit http://git.or.cz/ for more information regarding Git.

+

Git permits you to control access to working directories, and we recommend that you use it to limit Android repository access to only a few people within your organization (please refer to your Google NDA for potential contractual restraints on sharing Android source access).

+

You may clone Google's repository to a local copy for sharing internally (see Git documentation for details).

+ + +

Installing and Configuring Git

+ +

To install the Git package, execute:

+
+% sudo apt-get install git-core
+
+ + +

Establishing Server Access

+ +

Once Git is cleanly installed, you need to establish a connection with Google's Git server, a connection that requires an RSA key in order to authenticate requests.

+ + +

Generating RSA Keys

+ +

Each developer must have a unique RSA key in order to access Android source code. To generate an RSA key:

+

+

    +
  1. Type:
    +
    % ssh-keygen -t rsa -C  email@domain.com

    +You must use a valid email address to create your key.
  2. +
  3. When prompted, indicate the file to which you wish to write your key (id_rsa in this example).
  4. +
  5. When prompted, associate a passphrase with your key.
  6. +
  7. Upon success, you should have two files saved to the designated directory:
  8. +
      +
    • id_rsa: This file contains the private half of your RSA key. You shouldn't share this file with anyone.
    • +
    • id_rsa.pub: This is the public half or your RSA key and you should send it to your Google technical account manager.
    • +
    +
+

+

Send your Google Account Manager your public key file in order to establish Git server access.

+ + +

Verifying a Connection to the Git Server

+ +

Once you have generated an RSA key and shared the public file with Google, you can test your connection with the Git server with the following command:

+
+% ssh  android-git.ext.google.com
+
+ +

You should receive one of the following results:

+ + + + + + + + + + + + + + + + + + + + + + +
ResultCauseAction
+fatal: What do you think I am? A shell?
+Connection to android-git closed.
+
SuccessNone. You successfully connected to the Git server. (You should not have shell access and it's expected to receive this error.)
ssh hangs and eventually times out. Your setup is failing to locate and establish a basic connection. Google needs to debug network settings.
Error: Permission denied <public key> Either you are not using the matching username or the RSA private key does not match the public key. Try executing:
+ +% ssh $USER@android- + git.ext.google.com +
+ + +

Downloading Code

+ +

Android source code is maintained in two repositories: device and kernel. The device repository includes the Android framework (things like the Activity Manager, Window Manager, Telephony Manager, View System, etc.). The kernel repository includes the core code necessary to run the operating system (things like the Display Driver, Camera Driver, Keypad Driver, Power Management, etc.). (Please see What is Android? for details.)

+ +

Save device and kernel code at the same directory level, for example:

+

+

  • /home/joe/android/device
  • +
  • /home/joe/android/kernel
  • +

+

Device Code

+

To download device code, you need your username and a unique <path> string supplied by Google to execute the following:

+
+% git-clone $USER@android-git.ext.google.com:<path>/device.git
+
+ +

Kernel Code

+

To download kernel code, you need your username and a unique <path> string supplied by Google to execute the following:

+
+% git-clone $USER@android-git.ext.google.com:<path>/kernel.git
+
+ + + +

Extracting an Android Patch

+ +

You likely already have Linux running on your platform and only need to integrate Android-specific changes. The following directions describe how to extract an Android patch.

+
    +
  1. Download a generic version of the Linux kernel that matches the Linux version downloaded with the Android Kernel code.
  2. +
  3. Run diff on the two kernel packages to get Android-specific changes.
  4. +
  5. Apply the patch to your target kernel and build.
  6. +
+ diff --git a/pdk/docs/gps.html b/pdk/docs/gps.html deleted file mode 100755 index eb5473fc1..000000000 --- a/pdk/docs/gps.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android defines a user space C abstraction interface for GPS hardware. The interface header is defined in include/hardware/gps.h. In order to integate GPS with Android, you need to build a shared library that implements this interface.

- - -

Building a GPS Library

- -

To implement a GPS driver, create a shared library that implements the interface defined in gps.h. You must name your shared library libgps.so so that it will get loaded from /system/lib at runtime. Place GPS sources and Android.mk in partner/acme/chipset_or_board/gps/ (where "acme" is your product name and "chipset_or_board" is your hardware target).

- -

The following stub Android.mk file ensures that libgps compiles and links to the appropriate libraries:

- -
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libgps
-
-LOCAL_STATIC_LIBRARIES:= \
-# include any static library dependencies
-
-LOCAL_SHARED_LIBRARIES := \
-# include any shared library dependencies
-
-LOCAL_SRC_FILES += \
-# include your source files.  eg. MyGpsLibrary.cpp
-
-LOCAL_CFLAGS += \
-# include any needed compile flags
-
-LOCAL_C_INCLUDES:= \
-# include any needed local header files
-
-include $(BUILD_SHARED_LIBRARY)
-
- - -

Interface

- - - -

- -

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

- - - - - -
-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/gps.jd b/pdk/docs/gps.jd new file mode 100755 index 000000000..aa617e364 --- /dev/null +++ b/pdk/docs/gps.jd @@ -0,0 +1,49 @@ +page.title=GPS +@jd:body + + + + +

Introduction

+ +

Android defines a user space C abstraction interface for GPS hardware. The interface header is defined in include/hardware/gps.h. In order to integate GPS with Android, you need to build a shared library that implements this interface.

+ + +

Building a GPS Library

+ +

To implement a GPS driver, create a shared library that implements the interface defined in gps.h. You must name your shared library libgps.so so that it will get loaded from /system/lib at runtime. Place GPS sources and Android.mk in partner/acme/chipset_or_board/gps/ (where "acme" is your product name and "chipset_or_board" is your hardware target).

+ +

The following stub Android.mk file ensures that libgps compiles and links to the appropriate libraries:

+ +
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libgps
+
+LOCAL_STATIC_LIBRARIES:= \
+# include any static library dependencies
+
+LOCAL_SHARED_LIBRARIES := \
+# include any shared library dependencies
+
+LOCAL_SRC_FILES += \
+# include your source files.  eg. MyGpsLibrary.cpp
+
+LOCAL_CFLAGS += \
+# include any needed compile flags
+
+LOCAL_C_INCLUDES:= \
+# include any needed local header files
+
+include $(BUILD_SHARED_LIBRARY)
+
+ + +

Interface

+ + + diff --git a/pdk/docs/group__memory.html b/pdk/docs/group__memory.jd similarity index 54% rename from pdk/docs/group__memory.html rename to pdk/docs/group__memory.jd index 44d078280..87f19d5f9 100755 --- a/pdk/docs/group__memory.html +++ b/pdk/docs/group__memory.jd @@ -1,19 +1,6 @@ - - - - -Doxygen-Generated Content - - - - - +page.title=Providing Heap Memory +@jd:body + -
-

Porividng Heap Memory
+ [Neworking Support]

This is the text in the "Providing Heap Memory" subgroup
- - + diff --git a/pdk/docs/group__networking.html b/pdk/docs/group__networking.jd similarity index 57% rename from pdk/docs/group__networking.html rename to pdk/docs/group__networking.jd index 6a8e1b846..c5a94fcf2 100755 --- a/pdk/docs/group__networking.html +++ b/pdk/docs/group__networking.jd @@ -1,19 +1,6 @@ - - - - -Doxygen-Generated Content - - - - - +page.title=Networking Support +@jd:body + -
-

Neworking Support

+ +
@@ -34,5 +21,4 @@

Modules

 Porividng Heap Memory

Detailed Description

This is a text for the Networking Support Group
- - + diff --git a/pdk/docs/index.html b/pdk/docs/index.html deleted file mode 100755 index 6eac80b5a..000000000 --- a/pdk/docs/index.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Welcome to the Android Porting Guide

- - - - -
- -

The Open Handset Distribution (OHD) is a software distribution for mobile devices, often referred to as Android, developed by members of the Open Handset Alliance.  Android includes an operating system, middleware, and key applications typically required for a mobile device.

- -

This porting guide describes the steps necessary to port Android to a new mobile device.  Android is designed as a highly-portable, hardware-independent platform based on Linux, and porting the platform to new devices requires little more than porting the Linux kernel and developing the Linux drivers necessary for your device.

- -

The current version of this guide describes bringing Android up to "PDA-level" functionality; functionality sufficient to support non-multimedia apps that run on unconnected mobile devices through the standard user interface devices such as keypad and display.  Future versions of this guide will cover complete telephony, multi-media and peripheral integration to create a complete mobile device.

- - -

Intended Audience

- -

This porting guide is intended for engineers proficient with running (and writing drivers for) Linux on embedded devices. -

The guide also assumes you have a target hardware that matches Device Requirements and that you -can boot and run a recent (2.6.x) version of the Linux kernel -with at least keypad and display drivers properly installed.

- - -

Getting Started with Android

- -

To get started with Android, start with the publicly-available documentation at http://code.google.com/android/documentation.html, paying particular attention to What is Android? and Getting Started with Android.

- - -

Porting Android to Your Device

- -

Start with the following sections in order to port Android to your target hardware.

-
-
Device Requirements
-
What must your device support in order to successfully port Android to it?
-
Setting up a Development Environment
- -
Install necessary packages and retrieve source code through a Git server. Build System offers a conceptual overview of Android's build system and instructions to affect a simple build.
-
Basic Bring up
-
Establish core components necessary to your device, such as keymaps / keyboard input and display drivers.
-
 
-
- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/index.jd b/pdk/docs/index.jd new file mode 100644 index 000000000..b7529d3a7 --- /dev/null +++ b/pdk/docs/index.jd @@ -0,0 +1,39 @@ +home=true +page.title=Welcome to the Android Porting Guide +pdk.version=1.0 +@jd:body + + +

The Open Handset Distribution (OHD) is a software distribution for mobile devices, often referred to as Android, developed by members of the Open Handset Alliance.  Android includes an operating system, middleware, and key applications typically required for a mobile device.

+ +

This porting guide describes the steps necessary to port Android to a new mobile device.  Android is designed as a highly-portable, hardware-independent platform based on Linux, and porting the platform to new devices requires little more than porting the Linux kernel and developing the Linux drivers necessary for your device.

+ +

The current version of this guide describes bringing Android up to "PDA-level" functionality; functionality sufficient to support non-multimedia apps that run on unconnected mobile devices through the standard user interface devices such as keypad and display.  Future versions of this guide will cover complete telephony, multi-media and peripheral integration to create a complete mobile device.

+ + +

Intended Audience

+ +

This porting guide is intended for engineers proficient with running (and writing drivers for) Linux on embedded devices. +

The guide also assumes you have a target hardware that matches Device Requirements and that you +can boot and run a recent (2.6.x) version of the Linux kernel +with at least keypad and display drivers properly installed.

+ + +

Getting Started with Android

+ +

To get started with Android, start with the publicly-available documentation at http://code.google.com/android/documentation.html, paying particular attention to What is Android? and Getting Started with Android.

+ + +

Porting Android to Your Device

+ +

Start with the following sections in order to port Android to your target hardware.

+
+
Device Requirements
+
What must your device support in order to successfully port Android to it?
+
Setting up a Development Environment
+ +
Install necessary packages and retrieve source code through a Git server. Build System offers a conceptual overview of Android's build system and instructions to affect a simple build.
+
Basic Bring up
+
Establish core components necessary to your device, such as keymaps / keyboard input and display drivers.
+
 
+
diff --git a/pdk/docs/instrumentation_framework.html b/pdk/docs/instrumentation_framework.jd similarity index 50% rename from pdk/docs/instrumentation_framework.html rename to pdk/docs/instrumentation_framework.jd index 306cbc6d9..a8eab2e74 100755 --- a/pdk/docs/instrumentation_framework.html +++ b/pdk/docs/instrumentation_framework.jd @@ -1,150 +1,5 @@ - - - - -Android - Instrumentation Framework - - - - - - - - - - - - - - - -
- - -
- -
-
- - - -
- -
- -
- -
-

Android Platform Development Kit

- -
- -
- -
- -
- -
-

Introduction

@@ -284,33 +139,3 @@ E/AndroidRuntime( 688): ERROR: thread attach failed

It's possible that the instrumentation apk isn't installed on your device or that the package name is incorrect in the Manifest file.

- -

- -

-
- -
- -
- - - - - - - -
v0.3 - 9 June 2008
- - - diff --git a/pdk/docs/instrumentation_testing.html b/pdk/docs/instrumentation_testing.jd similarity index 77% rename from pdk/docs/instrumentation_testing.html rename to pdk/docs/instrumentation_testing.jd index 931fd77d3..c0248aec4 100755 --- a/pdk/docs/instrumentation_testing.html +++ b/pdk/docs/instrumentation_testing.jd @@ -1,180 +1,5 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -

Introduction

@@ -687,33 +512,3 @@ E/AndroidRuntime( 688): ERROR: thread attach failed

It's possible that the instrumentation apk isn't installed on your device or that the package name is incorrect in the Manifest file.

- -

- -

-
- -
- - - - - - - - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/intro_source_code.html b/pdk/docs/intro_source_code.html deleted file mode 100755 index f86b56805..000000000 --- a/pdk/docs/intro_source_code.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android source code is maintained in two code bases: the Android Linux kernel (kernel directory) and Android platform and applications (device directory). This document provides a high-level introduction to the source code organization and an overview of the major components of each primary directory.

- -

Android Source

- - -

Linux Kernel

- -

The Android Linux kernel includes enhancements to the Linux 2.6 kernel that provide additional drivers to support the Android platform, including:

-
    -
  • Binder: an OpenBinder-based driver to facilitate inter-process communication (IPC) in the Android platform.
  • -
  • Android Power Management: a light weight power management driver built on top of standard Linux power management but optimized for embedded systems.
  • -
  • Low Memory Killer: Based on hints from the userspace, the low memory killer can kill off processes to free up memory as necessary. It is designed to provide more flexibility than the Out Of Memory (OOM) killer in the standard kernel.
  • -
  • Logger: A light weight logging device used to capture system, radio, logdata, etc.
  • -
  • USB Gadget: Uses the USB function framework.
  • -
  • Android/PMEM: The PMEM (physical memory) driver is used to provide contiguous physical memory regions to userspace libraries that interact with the digital signal processor (DSP) and other hardware that cannot cope with scatter-gather.
  • -
  • Android Alarm: A driver which provides timers that can wake the device up from sleep and a monotonic timebase that runs while the device is asleep.
  • -
-

Look for Android-specific enhancements in the following directories:

-

    -
  • /drivers/android
  • -
  • /drivers/misc
  • -
  • /include/linux
  • -
-

- - -

Android Platform and Applications

- -

The following list outlines the directory structure found within the device branch of Android source code:

- - -

- -

    - - -
  • apps -Core Android applications such as Phone, Camera, and Calendar. -
  • - - -
  • boot -Reference Android bootloader and other boot-related source code. -
  • - - -
  • commands -Common Android commands, the most important of which is the runtime command, which does much of the initialization of the system. -
  • - - -
  • config -System-wide makefiles and linker scripts. -
  • - - -
  • content -Standard Android ContentProvider modules. -
  • - - -
  • dalvik -Android runtime Virtual Machine (VM). -
  • - - -
  • data -Fonts, keymaps, sounds, timezone information, etc. -
  • - - -
  • docs -Full set of Android documentation. -
  • - - -
  • extlibs -Non-Android libraries. This directory is intended to host unmodified external code. None of the libraries included within this directory rely on Android headers or libraries. -
  • - - -
  • ide -Tools for support of the IDE's used to write Android applications. -
  • - - -
  • include -Android system headers for inclusion. -
  • - - -
  • java -Android core APIs, as well as some external libraries. -
  • - - -
  • libs -Android-specific C++ based libraries. -
  • - - -
  • partner -Project-specific source code for various proprietary components. -
  • - - -
  • prebuilt -Prebuilt tools, like the toolchains and emulator binary. -
  • - - -
  • product -Device-specific configuration files. This directory will include a subdirectory for each new device. -
  • - - -
  • samples -Sample applications. -
  • - - -
  • servers -C++ based system servers. -
  • - - -
  • system -Core of the embedded Linux platform at the heart of Android. These essential bits are required for basic booting, operation, and debugging. -
  • - - -
  • tests -Platform and application test cases. -
  • - - -
  • tools -Tools for building and debugging Android (of particular interest for porting are "adb" and "emulator"). -
  • - - - -

    - -

- - -

Adding Source Code

- -

You can develop Android applications with the same standard tools you use to develop any Java application. The Android core libraries provide the functionality needed to build rich mobile applications and the Android development tools are designed to simplify running, debugging, and testing your applications.

- -

Add project-specific source code to the Android source tree under the partner directory in a directory specific to the application or service you are building. For example, all Google-specific applications would be placed under device/partner/google/. A Google search application would be placed under device/partner/google/apps/Search. -

See Building Android for a new Mobile Device for detailed instructions.

- - - -

- -

-
- -
- -
- - - -
- - - -
v0.5 - 25 September 2008
- - - diff --git a/pdk/docs/intro_source_code.jd b/pdk/docs/intro_source_code.jd new file mode 100755 index 000000000..100f3ee5b --- /dev/null +++ b/pdk/docs/intro_source_code.jd @@ -0,0 +1,169 @@ +page.title=Source Code Overview +@jd:body + + + + +

Introduction

+ +

Android source code is maintained in two code bases: the Android Linux kernel (kernel directory) and Android platform and applications (device directory). This document provides a high-level introduction to the source code organization and an overview of the major components of each primary directory.

+ +

Android Source

+ + +

Linux Kernel

+ +

The Android Linux kernel includes enhancements to the Linux 2.6 kernel that provide additional drivers to support the Android platform, including:

+
    +
  • Binder: an OpenBinder-based driver to facilitate inter-process communication (IPC) in the Android platform.
  • +
  • Android Power Management: a light weight power management driver built on top of standard Linux power management but optimized for embedded systems.
  • +
  • Low Memory Killer: Based on hints from the userspace, the low memory killer can kill off processes to free up memory as necessary. It is designed to provide more flexibility than the Out Of Memory (OOM) killer in the standard kernel.
  • +
  • Logger: A light weight logging device used to capture system, radio, logdata, etc.
  • +
  • USB Gadget: Uses the USB function framework.
  • +
  • Android/PMEM: The PMEM (physical memory) driver is used to provide contiguous physical memory regions to userspace libraries that interact with the digital signal processor (DSP) and other hardware that cannot cope with scatter-gather.
  • +
  • Android Alarm: A driver which provides timers that can wake the device up from sleep and a monotonic timebase that runs while the device is asleep.
  • +
+

Look for Android-specific enhancements in the following directories:

+

    +
  • /drivers/android
  • +
  • /drivers/misc
  • +
  • /include/linux
  • +
+

+ + +

Android Platform and Applications

+ +

The following list outlines the directory structure found within the device branch of Android source code:

+ + +

+ +

    + + +
  • apps +Core Android applications such as Phone, Camera, and Calendar. +
  • + + +
  • boot +Reference Android bootloader and other boot-related source code. +
  • + + +
  • commands +Common Android commands, the most important of which is the runtime command, which does much of the initialization of the system. +
  • + + +
  • config +System-wide makefiles and linker scripts. +
  • + + +
  • content +Standard Android ContentProvider modules. +
  • + + +
  • dalvik +Android runtime Virtual Machine (VM). +
  • + + +
  • data +Fonts, keymaps, sounds, timezone information, etc. +
  • + + +
  • docs +Full set of Android documentation. +
  • + + +
  • extlibs +Non-Android libraries. This directory is intended to host unmodified external code. None of the libraries included within this directory rely on Android headers or libraries. +
  • + + +
  • ide +Tools for support of the IDE's used to write Android applications. +
  • + + +
  • include +Android system headers for inclusion. +
  • + + +
  • java +Android core APIs, as well as some external libraries. +
  • + + +
  • libs +Android-specific C++ based libraries. +
  • + + +
  • partner +Project-specific source code for various proprietary components. +
  • + + +
  • prebuilt +Prebuilt tools, like the toolchains and emulator binary. +
  • + + +
  • product +Device-specific configuration files. This directory will include a subdirectory for each new device. +
  • + + +
  • samples +Sample applications. +
  • + + +
  • servers +C++ based system servers. +
  • + + +
  • system +Core of the embedded Linux platform at the heart of Android. These essential bits are required for basic booting, operation, and debugging. +
  • + + +
  • tests +Platform and application test cases. +
  • + + +
  • tools +Tools for building and debugging Android (of particular interest for porting are "adb" and "emulator"). +
  • + + + +

    + +

+ + +

Adding Source Code

+ +

You can develop Android applications with the same standard tools you use to develop any Java application. The Android core libraries provide the functionality needed to build rich mobile applications and the Android development tools are designed to simplify running, debugging, and testing your applications.

+ +

Add project-specific source code to the Android source tree under the partner directory in a directory specific to the application or service you are building. For example, all Google-specific applications would be placed under device/partner/google/. A Google search application would be placed under device/partner/google/apps/Search. +

See Building Android for a new Mobile Device for detailed instructions.

+ + diff --git a/pdk/docs/keymaps_keyboard_input.html b/pdk/docs/keymaps_keyboard_input.jd similarity index 71% rename from pdk/docs/keymaps_keyboard_input.html rename to pdk/docs/keymaps_keyboard_input.jd index 9a1a66a42..d52a73fe3 100755 --- a/pdk/docs/keymaps_keyboard_input.html +++ b/pdk/docs/keymaps_keyboard_input.jd @@ -1,180 +1,5 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -

Introduction

@@ -682,32 +507,3 @@ I/KeyInputQueue( 1548): Keymap: partnerxx_keypad.kl

The snippet above contains artificial line breaks to maintain a print-friendly document.

-

- -

-
- -
- - - - - - - - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/power_management.html b/pdk/docs/power_management.html deleted file mode 100755 index eb510dd90..000000000 --- a/pdk/docs/power_management.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android supports its own Power Management (on top of the standard Linux Power Management) designed with the premise that the CPU shouldn't consume power if no applications or services require power. For more information regarding standard Linux power management, please see Linux Power Management Support at http://kernel.org.

-

Android requires that applications and services request CPU resources with "wake locks" through the Android application framework and native Linux libraries. If there are no active wake locks, Android will shut down the CPU.

-

The image below illustrates the Android power management architecture.

-

- -Solid elements represent Android blocks and dashed elements represent partner-specific blocks. - - - -

Wake Locks

- -

Wake locks are used by applications and services to request CPU resources.

- - -

Types of Wake Locks

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Wake Lock Description
ACQUIRE_CAUSES_WAKEUP
Normally wake locks don't actually wake the device, they just cause it to remain on once it's already on. Think of the video player app as the normal behavior. Notifications that pop up and want the device to be on are the exception; use this flag to be like them.
FULL_WAKE_LOCKWake lock that ensures that the screen and keyboard are on at full brightness.
ON_AFTER_RELEASEWhen this wake lock is released, poke the user activity timer so the screen stays on for a little longer.
PARTIAL_WAKE_LOCKWake lock that ensures that the CPU is running. The screen might not be on.
SCREEN_BRIGHT_WAKE_LOCKWake lock that ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off.
SCREEN_DIM_WAKE_LOCKWake lock that ensures that the screen is on, but the keyboard backlight will be allowed to go off, and the screen backlight will be allowed to go dim.
- - -

Exploring a Wake Lock Example

- -

All power management calls follow the same basic format:

-

  1. Acquire handle to the PowerManager service.
  2. -
  3. Create a wake lock and specify the power management flags for screen, timeout, etc.
  4. -
  5. Acquire wake lock.
  6. -
  7. Perform operation (play MP3, open HTML page, etc.).
  8. -
  9. Release wake lock.
  10. -
-

-

The snippet below illustrates this process.

-
-PowerManager pm = (PowerManager)mContext.getSystemService(
-                                          Context.POWER_SERVICE);
-PowerManager.WakeLock wl = pm.newWakeLock(
-                                      PowerManager.SCREEN_DIM_WAKE_LOCK
-                                      | PowerManager.ON_AFTER_RELEASE,
-                                      TAG);
-wl.acquire();
- // ...
-wl.release();
-
- - -

PowerManager class

- -

The Android Framework exposes power management to services and applications through the PowerManager class.

-

User space native libraries (any hardware function in //device/lib/hardware/ meant to serve as supporting libraries for Android runtime) should never call into Android Power Management directly (see the image above). Bypassing the power management policy in the Android runtime will destabilize the system.

-

All calls into Power Management should go through the Android runtime PowerManager APIs.

-

Please visit -http://code.google.com/android/reference/android/os/PowerManager.html for a description of the API and examples.

- - -

Registering Drivers with the PM Driver

- -

You can register Kernel-level drivers with the Android Power Manager driver so that they're notified immediately before power down or after power up. For example, you might set a display driver to completely power down when a request comes in to power down from the user space (see the Android MSM MDDI display driver for a sample implementation).

-

To register drivers with the Android PM driver, implement call-back handlers and register them with the Android PM, as illustrated in the snippet below:

-
-android_register_early_suspend(android_early_suspend_t *handler)
-android_register_early_resume(android_early_resume_t *handler)
-
-

It is critical in a drive to return immediately and not wait for anything to happen in the call back.

- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/power_management.jd b/pdk/docs/power_management.jd new file mode 100755 index 000000000..52c23e803 --- /dev/null +++ b/pdk/docs/power_management.jd @@ -0,0 +1,108 @@ +page.title=Power Management +@jd:body + + + + +

Introduction

+ +

Android supports its own Power Management (on top of the standard Linux Power Management) designed with the premise that the CPU shouldn't consume power if no applications or services require power. For more information regarding standard Linux power management, please see Linux Power Management Support at http://kernel.org.

+

Android requires that applications and services request CPU resources with "wake locks" through the Android application framework and native Linux libraries. If there are no active wake locks, Android will shut down the CPU.

+

The image below illustrates the Android power management architecture.

+

+ +

Solid elements represent Android blocks and dashed elements represent partner-specific blocks.

+ + + +

Wake Locks

+ +

Wake locks are used by applications and services to request CPU resources.

+ + +

Types of Wake Locks

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Wake Lock Description
ACQUIRE_CAUSES_WAKEUP
Normally wake locks don't actually wake the device, they just cause it to remain on once it's already on. Think of the video player app as the normal behavior. Notifications that pop up and want the device to be on are the exception; use this flag to be like them.
FULL_WAKE_LOCKWake lock that ensures that the screen and keyboard are on at full brightness.
ON_AFTER_RELEASEWhen this wake lock is released, poke the user activity timer so the screen stays on for a little longer.
PARTIAL_WAKE_LOCKWake lock that ensures that the CPU is running. The screen might not be on.
SCREEN_BRIGHT_WAKE_LOCKWake lock that ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off.
SCREEN_DIM_WAKE_LOCKWake lock that ensures that the screen is on, but the keyboard backlight will be allowed to go off, and the screen backlight will be allowed to go dim.
+ + +

Exploring a Wake Lock Example

+ +

All power management calls follow the same basic format:

+

  1. Acquire handle to the PowerManager service.
  2. +
  3. Create a wake lock and specify the power management flags for screen, timeout, etc.
  4. +
  5. Acquire wake lock.
  6. +
  7. Perform operation (play MP3, open HTML page, etc.).
  8. +
  9. Release wake lock.
  10. +
+

+

The snippet below illustrates this process.

+
+PowerManager pm = (PowerManager)mContext.getSystemService(
+                                          Context.POWER_SERVICE);
+PowerManager.WakeLock wl = pm.newWakeLock(
+                                      PowerManager.SCREEN_DIM_WAKE_LOCK
+                                      | PowerManager.ON_AFTER_RELEASE,
+                                      TAG);
+wl.acquire();
+ // ...
+wl.release();
+
+ + +

PowerManager class

+ +

The Android Framework exposes power management to services and applications through the PowerManager class.

+

User space native libraries (any hardware function in //device/lib/hardware/ meant to serve as supporting libraries for Android runtime) should never call into Android Power Management directly (see the image above). Bypassing the power management policy in the Android runtime will destabilize the system.

+

All calls into Power Management should go through the Android runtime PowerManager APIs.

+

Please visit +http://code.google.com/android/reference/android/os/PowerManager.html for a description of the API and examples.

+ + +

Registering Drivers with the PM Driver

+ +

You can register Kernel-level drivers with the Android Power Manager driver so that they're notified immediately before power down or after power up. For example, you might set a display driver to completely power down when a request comes in to power down from the user space (see the Android MSM MDDI display driver for a sample implementation).

+

To register drivers with the Android PM driver, implement call-back handlers and register them with the Android PM, as illustrated in the snippet below:

+
+android_register_early_suspend(android_early_suspend_t *handler)
+android_register_early_resume(android_early_resume_t *handler)
+
+

It is critical in a drive to return immediately and not wait for anything to happen in the call back.

+ + + diff --git a/pdk/docs/source_setup_guide.html b/pdk/docs/source_setup_guide.html deleted file mode 100755 index 1588b2946..000000000 --- a/pdk/docs/source_setup_guide.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

This section provides instructions on how to configure your host system to build Android for mobile devices. While Android is designed as host-environment agnostic, it has been tested and is known to work on the following Linux operating system; Ubuntu 6.06 (Dapper), 7.10 (Gutsy), and 8.04. Cygwin is not recommended.

- - -

Installing Packages

- - - -

Required Packages

- -

Android requires the following system packages:

-

    -
  • flex: This lexical analyzer generator is used to read a given input file for a description of a scanner to generate.
  • -
  • bison: This is a general-purpose parser generator.
  • -
  • gperf: This is a perfect hash function generator.
  • -
  • libesd0-dev: This enlightened sound daemon (dev files) is used to mix digitized audio streams for playback by a single device.
  • -
  • libwxgtk2.6-dev: This package provides GUI components and other facilities for many different platforms.
  • -
  • build-essential: This package contains a list of packages considered fundamental to building Debian packages.
  • -

- - -

Ubuntu 6.06 (Dapper)

- -

On a clean Dapper system, type the following:

-
-% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev 
-   build-essential
-
-

This snippet includes an artificial line break to maintain a print-friendly document.

- - -

Ubuntu 7.10

- -
  1. The libwxgtk2.6-dev package will only work if the following code is included in your /etc/apt/source file. -

    -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    -## team, and may not be under a free license. Please satisfy yourself as to
    -## your rights to use the software. Also, please note that software in
    -## universe WILL NOT receive any review or updates from the Ubuntu security
    -## team.
    -# Line commented out by installer because it failed to verify:
    -deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    -# Line commented out by installer because it failed to verify:
    -deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    -# Line commented out by installer because it failed to verify:
    -deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    -# Line commented out by installer because it failed to verify:
    -deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    -

  2. -
  3. Install required packages with the following command: -

    -% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev
    -   build-essential
    -

    -This snippet includes an artificial line break to maintain a print-friendly document. -
  4. -
  5. -

    Install the X11 development environment with the following commands:

    -

    -% sudo apt-get install x-dev
    -% sudo apt-get install libx11-dev
    -% sudo apt-get install libncurses5-dev
    -

    -
  6. -
- - -

Ubuntu 8.04

- -

On a clean system, type the following:

-
-% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev
-zlib1g-dev build-essential
-% sudo apt-get install x-dev
-% sudo apt-get install libx11-dev
-% sudo apt-get install libncurses5-dev
-% sudo apt-get install sun-java5-jdk
-
- - -

Installing Java

- -

Android source code includes a hard dependency on the Java Developer Kit (JDK) 5.0 Update 12 or greater. The specific file name of the Update 12 package is jdk-1_5_0_12-linux-i586.bin. To download this version of the Java JDK:

-

    -
  1. Navigate to: http://java.sun.com/products/archive/.
  2. -
  3. Select '5.0 Update 12' from the 'Java 2 Platform Standard Edition (J2SE)' -> 'JDK/JRE - 5.0' field and click 'Go.'
  4. -
  5. Click 'Download JDK.'
  6. -
  7. In the 'Linux Platform' section, click 'Linux self-extracting file' associated with the jdk-1_5_0_12-linux-i586.bin package.
  8. -
  9. Follow the installation instructions.
  10. -
-

- -

Once you have cleanly installed the JDK, modify your PATH environment variable to include <jdk-install-dir>/jdk1.5.0_12/bin at its beginning so that Dapper will use the correct installation.

-

Ubuntu 7.10

-

An alternative method to quickly install Java is to enable multiverse repo in /etc/apt/sources.list and then execute:

-
-% sudo apt-get install sun-java5-jdk
-
- - -

- -

-
- -
- -
- - - -
- - - -
v0.5 - 25 September 2008
- - - diff --git a/pdk/docs/source_setup_guide.jd b/pdk/docs/source_setup_guide.jd new file mode 100755 index 000000000..5c0bed5e1 --- /dev/null +++ b/pdk/docs/source_setup_guide.jd @@ -0,0 +1,116 @@ +page.title=Host System Setup +@jd:body + + + + +

Introduction

+ +

This section provides instructions on how to configure your host system to build Android for mobile devices. While Android is designed as host-environment agnostic, it has been tested and is known to work on the following Linux operating system; Ubuntu 6.06 (Dapper), 7.10 (Gutsy), and 8.04. Cygwin is not recommended.

+ + +

Installing Packages

+ + + +

Required Packages

+ +

Android requires the following system packages:

+

    +
  • flex: This lexical analyzer generator is used to read a given input file for a description of a scanner to generate.
  • +
  • bison: This is a general-purpose parser generator.
  • +
  • gperf: This is a perfect hash function generator.
  • +
  • libesd0-dev: This enlightened sound daemon (dev files) is used to mix digitized audio streams for playback by a single device.
  • +
  • libwxgtk2.6-dev: This package provides GUI components and other facilities for many different platforms.
  • +
  • build-essential: This package contains a list of packages considered fundamental to building Debian packages.
  • +

+ + +

Ubuntu 6.06 (Dapper)

+ +

On a clean Dapper system, type the following:

+
+% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev 
+   build-essential
+
+

This snippet includes an artificial line break to maintain a print-friendly document.

+ + +

Ubuntu 7.10

+ +
  1. The libwxgtk2.6-dev package will only work if the following code is included in your /etc/apt/source file. +

    +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    +## team, and may not be under a free license. Please satisfy yourself as to
    +## your rights to use the software. Also, please note that software in
    +## universe WILL NOT receive any review or updates from the Ubuntu security
    +## team.
    +# Line commented out by installer because it failed to verify:
    +deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    +# Line commented out by installer because it failed to verify:
    +deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
    +# Line commented out by installer because it failed to verify:
    +deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    +# Line commented out by installer because it failed to verify:
    +deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
    +

  2. +
  3. Install required packages with the following command: +

    +% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev
    +   build-essential
    +

    +This snippet includes an artificial line break to maintain a print-friendly document. +
  4. +
  5. +

    Install the X11 development environment with the following commands:

    +

    +% sudo apt-get install x-dev
    +% sudo apt-get install libx11-dev
    +% sudo apt-get install libncurses5-dev
    +

    +
  6. +
+ + +

Ubuntu 8.04

+ +

On a clean system, type the following:

+
+% sudo apt-get install flex bison gperf libesd0-dev libwxgtk2.6-dev
+zlib1g-dev build-essential
+% sudo apt-get install x-dev
+% sudo apt-get install libx11-dev
+% sudo apt-get install libncurses5-dev
+% sudo apt-get install sun-java5-jdk
+
+ + +

Installing Java

+ +

Android source code includes a hard dependency on the Java Developer Kit (JDK) 5.0 Update 12 or greater. The specific file name of the Update 12 package is jdk-1_5_0_12-linux-i586.bin. To download this version of the Java JDK:

+

    +
  1. Navigate to: http://java.sun.com/products/archive/.
  2. +
  3. Select '5.0 Update 12' from the 'Java 2 Platform Standard Edition (J2SE)' -> 'JDK/JRE - 5.0' field and click 'Go.'
  4. +
  5. Click 'Download JDK.'
  6. +
  7. In the 'Linux Platform' section, click 'Linux self-extracting file' associated with the jdk-1_5_0_12-linux-i586.bin package.
  8. +
  9. Follow the installation instructions.
  10. +
+

+ +

Once you have cleanly installed the JDK, modify your PATH environment variable to include <jdk-install-dir>/jdk1.5.0_12/bin at its beginning so that Dapper will use the correct installation.

+

Ubuntu 7.10

+

An alternative method to quickly install Java is to enable multiverse repo in /etc/apt/sources.list and then execute:

+
+% sudo apt-get install sun-java5-jdk
+
+ + + diff --git a/pdk/docs/system_requirements.html b/pdk/docs/system_requirements.html deleted file mode 100755 index 2f236cf80..000000000 --- a/pdk/docs/system_requirements.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
-
- - -

Device Requirements

- -

While Android is designed to support a wide variety of hardware platforms and configurations, this section provides recommended minimum device requirements.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureMinimum RequirementNotes
ChipsetARM-basedFor the first release, Android is primarily targeted towards mobile handsets and portions of the platform, such as Dalvik VM graphics processing, currently assume an ARM architecture.
Memory128 MB RAM; 256 MB Flash ExternalAndroid can boot and run in configurations with less memory, but it isn't recommended.
StorageMini or Micro SD Not necessary for basic bring up, but recommended.
Primary Display HVGA requiredThe current Android interface targets a touch-based HVGA resolution display with a touch-interface no smaller than 2.8 inches in size. However, smaller displays will suffice for initial porting.
Navigation Keys 5-way navigation with 5 application keys, power, camera and volume controls 
Camera2MP CMOSNot required for basic bring up.
USBStandard mini-B USB interfaceAndroid uses the USB interface for flashing the device system images and debugging a running device.
Bluetooth1.2 or 2.0 Not required for initial bring up.
-

If available, your Android device can also benefit from the following optional device characteristics:

-
    -
  • QWERTY keyboard
  • -
  • WiFi
  • -
  • GPS
  • -
- - -

- -

-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
-
- - diff --git a/pdk/docs/system_requirements.jd b/pdk/docs/system_requirements.jd new file mode 100755 index 000000000..1b203ea2f --- /dev/null +++ b/pdk/docs/system_requirements.jd @@ -0,0 +1,63 @@ +page.title=Device Requirements +pdk.version=1.0 +@jd:body + +

While Android is designed to support a wide variety of hardware platforms and configurations, this section provides recommended minimum device requirements.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureMinimum RequirementNotes
ChipsetARM-basedFor the first release, Android is primarily targeted towards mobile handsets and portions of the platform, such as Dalvik VM graphics processing, currently assume an ARM architecture.
Memory128 MB RAM; 256 MB Flash ExternalAndroid can boot and run in configurations with less memory, but it isn't recommended.
StorageMini or Micro SD Not necessary for basic bring up, but recommended.
Primary Display HVGA requiredThe current Android interface targets a touch-based HVGA resolution display with a touch-interface no smaller than 2.8 inches in size. However, smaller displays will suffice for initial porting.
Navigation Keys 5-way navigation with 5 application keys, power, camera and volume controls 
Camera2MP CMOSNot required for basic bring up.
USBStandard mini-B USB interfaceAndroid uses the USB interface for flashing the device system images and debugging a running device.
Bluetooth1.2 or 2.0 Not required for initial bring up.
+

If available, your Android device can also benefit from the following optional device characteristics:

+
    +
  • QWERTY keyboard
  • +
  • WiFi
  • +
  • GPS
  • +
+ + + diff --git a/pdk/docs/telephony.html b/pdk/docs/telephony.jd similarity index 61% rename from pdk/docs/telephony.html rename to pdk/docs/telephony.jd index d4826f693..99a12c0e9 100755 --- a/pdk/docs/telephony.html +++ b/pdk/docs/telephony.jd @@ -1,180 +1,5 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-

Introduction

@@ -397,33 +222,3 @@ RIL_RadioFunctions;

- -

- -

-
- -
- - - - - - - - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/wifi.html b/pdk/docs/wifi.html deleted file mode 100755 index df40fb0a0..000000000 --- a/pdk/docs/wifi.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - -Android - Porting Guide - - - - - - - - - - - - - - - - -
- - -
- - -
-
- - - -
- -
- -
- -
- -

Android Platform Development Kit

- -
- -
- -
- -
- -
-
- - -

Introduction

- -

Android uses wpa_supplicant as the platform interface to the Wi-Fi device. Your Wi-Fi driver must be compatible with the standard wpa_supplicant in addition to extensions added to the supplicant (specifically, the "DRIVER" commands described in wifi.h/wifi_command()).

- - -

Building a Wi-Fi Library

- -

To create a Wi-Fi driver for Android:

-

    -
  • create a shared library that implements the interface defined in include/hardware/wifi.h, which also defines the Wi-Fi supplicant.
  • -
  • Follow the instructions posted at http://hostap.epitest.fi/wpa_supplicant/.
  • -
  • Place your driver in libs/hardware/wifi/
  • -
  • Test your driver using the command line wpa_cli utilities.
  • -
- -

You can find the default implementation in libs/hardware/wifi/wifi.c. If you need to make changes, create a new source file similar to wifi.c, for example, wifi_mywifi.c.

- -

Update the default Android.mk file (libs/hardware/wifi/Android.mk) as shown below.

-
-LOCAL_SHARED_LIBRARIES += libnetutils
-
-ifeq ($(TARGET_DEVICE),acme)
-LOCAL_SRC_FILES += wifi/wifi_mywifi.c
-else
-LOCAL_SRC_FILES += wifi/wifi.c
-endif
-
- - -

Interface

- - - -

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

- - - - - -
-
- -
- -
- - - -
- - - -
v0.6 - 25 November 2008
- - - diff --git a/pdk/docs/wifi.jd b/pdk/docs/wifi.jd new file mode 100755 index 000000000..42cb14cad --- /dev/null +++ b/pdk/docs/wifi.jd @@ -0,0 +1,49 @@ +page.title=Wi-Fi +@jd:body + + + + +

Introduction

+ +

Android uses wpa_supplicant as the platform interface to the Wi-Fi device. Your Wi-Fi driver must be compatible with the standard wpa_supplicant in addition to extensions added to the supplicant (specifically, the "DRIVER" commands described in wifi.h/wifi_command()).

+ + +

Building a Wi-Fi Library

+ +

To create a Wi-Fi driver for Android:

+

    +
  • create a shared library that implements the interface defined in include/hardware/wifi.h, which also defines the Wi-Fi supplicant.
  • +
  • Follow the instructions posted at http://hostap.epitest.fi/wpa_supplicant/.
  • +
  • Place your driver in libs/hardware/wifi/
  • +
  • Test your driver using the command line wpa_cli utilities.
  • +
+ +

You can find the default implementation in libs/hardware/wifi/wifi.c. If you need to make changes, create a new source file similar to wifi.c, for example, wifi_mywifi.c.

+ +

Update the default Android.mk file (libs/hardware/wifi/Android.mk) as shown below.

+
+LOCAL_SHARED_LIBRARIES += libnetutils
+
+ifeq ($(TARGET_DEVICE),acme)
+LOCAL_SRC_FILES += wifi/wifi_mywifi.c
+else
+LOCAL_SRC_FILES += wifi/wifi.c
+endif
+
+ + +

Interface

+ + + +

Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

+ + + + + + diff --git a/pdk/hosting/app.yaml b/pdk/hosting/app.yaml index 407cbb08b..6e08141bc 100644 --- a/pdk/hosting/app.yaml +++ b/pdk/hosting/app.yaml @@ -4,8 +4,8 @@ runtime: python api_version: 1 handlers: -- url: /docs - static_dir: docs +- url: /online-pdk + static_dir: online-pdk - url: / script: pdk.py diff --git a/pdk/hosting/pdk.py b/pdk/hosting/pdk.py index e88f826f8..421f19550 100644 --- a/pdk/hosting/pdk.py +++ b/pdk/hosting/pdk.py @@ -26,11 +26,9 @@ from google.appengine.ext.webapp.util import run_wsgi_app class MainPage(webapp.RequestHandler): def get(self): - self.redirect('docs/index.html') + self.redirect('online-pdk/index.html') -application = webapp.WSGIApplication( - [('/', MainPage)], - debug=True) +application = webapp.WSGIApplication([('/', MainPage)], debug=True) def main(): run_wsgi_app(application) @@ -38,6 +36,18 @@ def main(): if __name__ == "__main__": main() +# Testing +# You must install google appengine. See: http://code.google.com/appengine/downloads.html +# +# Here's the command to run the pdk-docs server locally: +# python /dev_appserver.py --address 0.0.0.0 \ +# /android/out/target/common/docs + +# To verify it is working you can access it with a browser loacally on port 8080: + +# http://localhost:8080/index.html + + # To upload this application: # /home/build/static/projects/apphosting/devtools/appcfg.py update pdk/ # where the pdk directory contains: pdk.py, app.yaml, and the docs directory.