Android4SAM FAQ

File attribute issue

Issue: when clone the source code from github, the file attribute is not 644.
Solution: add the "umask 022" into the profile file. For example, add it to /etc/profile

Android Configuration options

Android support 3 options to when execute lunch command. They are as following:
  • eng
  • user
  • userdebug
By default, we choose the engineering configuration using lunch <soc-name>-eng, for example:
$ . build/
$ lunch sama5d3-eng
You can configuration the Android according to your choice.

Build Android

Which version of JDK should I use to build Android?

A: Only JDK 6 can be used to build Android 2.3.5 r1. If you already installed JDK 5, you need download and install the JDK 6 from here and export the JDK 6 path to build Android.

If my host PC is not Ubuntu, how can I build Android?

A: You can check the Android web site:

Can I use virtual machine to build Android?

A: Yes. Note that the VM should have at least 1GB RAM and 40 GB free disk space.

When building Android, I met following errors. What should I do?

host Java: cts-dalvik-buildutil (out/host/common/obj/JAVA_LIBRARIES/cts-dalvik-buildutil_intermediates/classes)
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Install: out/host/linux-x86/framework/cts-dalvik-buildutil.jar
Collecting all junit tests...
Time: 0.009
OK (0 tests)
collected 3102 test methods in 225 junit test classes
Exception in thread "main" java.lang.RuntimeException: failed to parse
Caused by: cts/tools/vm-tests/src/dot/junit/opcodes/div_float/ (Too many open files)
            at Method)
            ... 3 more
make: *** [out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/tests] Error 1

A: You can add the following lines to the end of the file /etc/security/limits.conf (before the line # End of file)

*       soft  nofile   8192                                                      
*       hard  nofile   8192

and reboot. You can check whether your modification takes effect or not by "ulimit -n".

About Android SDK

Which version of Android SDK should I use for AT91 devices?

A: Using API level 10 for Android 2.3.5 r1

Do I need the NDK or the SDK?

A: We need the Android SDK to develop Android applications. If you want to develop applications using C or C++ language then you need the Android NDK. The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications. The NDK allows you to implement parts of your applications using native-code languages such as C and C++.

Can I program in C or C++ for Android or must I use only Java?

A: The Android project suggests that the developers use Java to program. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. Find more information, see

Can I use a emulator to develop for AT91 devices?

A: Yes. The Android SDK provided a set of tools to run a customized image. Please see below the steps:

  • After finish compiling Android4SAM you can find three .img files in out\target\product\sam9m10
    • system.img
      • The initial system image.
    • ramdisk.img
      • The ramdisk image used to boot the system
    • userdata.img
      • The initial user data image (see below)
    • kernel-qemu
      • The emulator-specific Linux kernel image
Tip, idea If the kernel image is not found in the out directory, you may find it in /prebuilt/android-arm/kernel
  • Copy those images in a directory.
  • Use command to start a emulator based on our own images by typing following command:
    In Windows:
    cd /(your directory)
    emulator.exe -kernel kernel-qemu -ramdisk ramdisk.img -system system.img -data userdata.img
    in Linux:
    out/host/linux-x86/bin/emulator -kernel kernel-qemu -ramdisk ramdisk.img -system system.img -data userdata.img

Are the Android debugging features available on an AT91 device?

A: When usb connected,the Android debugging features are available on an AT91 device. You can use adb commands to debug the system.


How to install and use busybox in Android console?

A: Android console only provides very limited commands. Many frequently used commands such as cp, vi are not supported by default in Android console.

We could enable these commands by using Busybox. We have prebuilt the Busybox here: for your convenience. After download, you can install it to your Android box according to the steps below,

  1. Unzip
  2. Use adb to push it into our demo with
    adb push busybox /system/bin
    Here, we assume busybox is in current directory, while image is push into =/system/bin=
  3. Enable the executable bit of busybox in console connect to our demo
    chmod 0777 /system/bin/busybox
  4. Then, you can use Busybox by
    busybox <cmd> <parameters>
    For example,
    busybox fdisk /dev/sdb
  5. TIP To list the commands supported by Busybox, just execute
    without any parameters.

r13 - 10 Dec 2014 - 05:00:08 - VoiceShen

Copyright by the contributing authors. All material on the platform is the property of the contributing authors.

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions

Atmel and others, are registered trademarks or trademarks of Atmel or its subsidiaries.This site is powered by the TWiki collaboration platform

ARM and others are registered trademarks or trademarks or ARM Ltd. Other terms and product names may be trademarks of others.

Under the terms of the Creative Commons Attribution License

Syndicate this siteRSS ATOM