> For the complete documentation index, see [llms.txt](https://bananapi.gitbook.io/bpi-m2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bananapi.gitbook.io/bpi-m2/zh/howtobuildandroid442imageforbpim2.md).

# How to build Android 4.4.2 Image for BPI-M2

1. Install the Linux system for building，'Ubuntu 12.04.x LTS'is recommended.
2. Install the needed software packages.

   ```
   sudo apt-get install python-software-properties
   sudo add-apt-repository ppa:webupd8team/java
   sudo apt-get update
   sudo apt-get install oracle-java6-installer
   sudo apt-get install libglapi-mesa:i386
   sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
   sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
   sudo apt-get install uboot-mkimage
   sudo apt-get install xserver-xorg
   ```

   Do NOT reboot system during the process! (IMPORTANT!)
3. Download the latest source code pack from our developer website <http://dev.banana-pi.org.cn> .And unpack.

4.Building. Build for hdmi.

````
Build for 7' LCD.

``` ./build_LCD.sh
````

If you have finished building one of versions(hdmi OR LCD).Please run following commmand before building another!(IMPORTANT!)

`./make_clean.sh`

For more information of buileding,pleace view 'Build\_Code\_Command.txt' in code package.

discuss on forum:

<http://forum.banana-pi.org/t/how-to-build-android-4-4-2-image-for-bpi-m2/467>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bananapi.gitbook.io/bpi-m2/zh/howtobuildandroid442imageforbpim2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
