8,367
edits
Changes
no edit summary
<div style="flex:1;text-align:center;">Pic 1</div>
<div style="flex:1;text-align:center;">Pic 2</div>
</div>
<br>
== '''Android Compilation Environment Construction''' ==
<br>
=== '''Download SDK compression package''' ===
<br>
* '''Android 6.0'''
Download the compression packages, corresponding to OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.00, OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.01, OrangePi_4G-IoT_Android 6.0_V1.0.tar.gz.14, a total of 15 volume compression packages. After obtaining the volume compressed packages, place all the compressed packages in the same directory, such as<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
'''Create directory:'''<br>
mkdir OrangePi_4G-IOT_Android6.0 <br>
'''Copy Volume Compression Packet:'''<br>
cp -rf OrangePi_4G-IoT_Android6.0_V1.0.tar.gz.* <br>
OrangePi_4G-IOT_Android6.0/<br>
'''Merge Compression Packet:'''<br>
cat OrangePi_4G-IoT_Android6.0_V1.0.tar.gz.* > <br>
OrangePi_4G-IOT_Android6.0.tar.gz<br>
'''Unzip:'''<br>
tar xzvf OrangePi_4G-IOT_Android6.0.tar.gz
</div>
* '''Android 8.1'''
After downloaded compression package, you will have 11packages named x00, x01, x02, x03 ...x10.Put packages on the same directory like the following:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
Create directory<br>
mkdir OrangePi_4G-IOT_Android8.1 <br>
Copy compress package<br>
cp -rf x00 x01 x02 ... x10 <br>
Merge compression package<br>
cat x*>OrangePi_4G-IOT_Android8.1.tar.gz <br>
Decompression<br>
tar xzvf OrangePi_4G-IOT_Android8.tar.gz
</div>
<br>
=== '''Construct Compilation Environment''' ===
<br>
It could also refer to Google file: [http://source.android.com/source/initializing.html
<span style="color:#6600ff;">http://source.android.com/source/initializing.html</span>]<br>
<br>
* '''Install JDK'''
Compilation of Android6.0 is based on JAVA7, it needs to first install OpenJDK before compilation.<br>
<br>
Command for installing:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
sudo apt-get install openjdk-7-jdk
</div>
<br>
Configure environment variable of JAVA, here is the path for installation:<br>
<br>
/usr/lib/jvm/java-7-openjdk-amd64<br>
<br>
It could configure on the terminal with the following command:<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 <br>
export PATH=$JAVA_HOME/bin:$PATH<br>
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
</div>
* '''Install Software Package'''
For Ubuntu12.04:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
sudo apt-get update<br>
sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-dev
libx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev gcc-4.4 g++-4.4 g++-4.4-multilib g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc wine
</div>
<br>
For Ubuntu14.04:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
sudo apt-get update<br>
sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-dev
libx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev g++-multilib g++-4.8-multilib mingw32 tofrodos python-markdown
libxml2-utils xsltproc libc6-dev-i386 lib32z1 lib32ncurses5 lib32bz2-1.0 lib32readline-gplv2-dev wine
</div>
<br>
We could process to SDK compilation after finished the above.<br>
<br>
=== '''Compilation of SDK Source Code''' ===
<br>
There are many compilation shell scripts for development.<br>
<br>
* '''Android 6.0'''
<br>
The directory would be: SDK/code/orangepi/scripts<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ cd code/orangepi/scripts<br>
$ ls<br>
anr_LM.sh auto.sh clean.sh codegen.sh init_project.sh tar_img.sh
</div>
auto.sh is automatically compilation script<br>
clean.sh automatically scavenging the compiled result script<br>
<br>
On the directory of code/orangepi/scripts, execute the automatically compilation script:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ ./auto.sh IoT_bd6737m_35g_b_m0_op_smt_hd720_pcb_v2 v00 eng
</div>
The meaning of the parameter is:<br>
#$1 project_info [eg: IoT_bd6737m_35g_b_m0_op_smt_hd720_pcb_v2] <br>
#$2 version_info [eg: v00 v01 ...]<br>
#$3 compile_mode [eng:user userdebug eng]
* '''Android 8.1'''
<br>
The directory would be: SDK/code/orangepi/scripts<br>
<br>
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ cd code/orangepi/scripts<br>
$ ls<br>
anr_LM.sh auto.sh clean.sh codegen.sh init_project.sh tar_img.sh
</div>
auto.sh--scripts for automatic compilation<br>
clean.sh--scripts for automatically cleaning the compiled result<br>
<br>
On the directory of code/orangepi/scripts, execute automatic compilation scripts:
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ ./auto.sh IoT_k37mv1_bsp_ry_smt_hd720_pcb_v2 v00 eng
</div>
Definition of the three parameters:<br>
#$1 project_info [eg: IoT_k37mv1_bsp_ry_smt_hd720_pcb_v2] <br>
#$2 version_info [eg: v00 v01 ...]<br>
#$3 compile_mode [eng:user userdebug eng]<br>
<br>
Execute command to compile:<br>
source build/envsetup.sh<br>
luncher >full_k37mv1_bsp-eng<br>
make -j4<br>
<br>
'''Module compilation'''
<br>
Here would take an example of only compilation launcer:<br>
mm packages/apps/Launcher3/ or enter into directory of packages/apps/Launcher3/, execute mm<br> Please note that some modules depend on the relationship of package, you need to run mma.
<br>
<br>
=== '''Generated Firmware''' ===
<br>
* '''Android6.0'''
After compiled, the firmware will gather in the directory of: code/IoT_op_smt_hd720_pcb_v2, pack it and name it like the following: IoT_op_smt_hd720_pcb_v2_v00_eng_20180126140300.tar.gz
<div style="background:#f1f1f1;border:1px solid #ddd;padding:5px;">
$ tree IoT_op_smt_hd720_pcb_v2 IoT_op_smt_hd720_pcb_v2<br>
├── images<br>
│ ├── boot.img<br>
│ ├── cache.img<br>
│ ├── lk.bin<br>
│ ├── logo.bin<br>
│ ├── MT6737M_Android_scatter.txt<br>
│ ├── preloader_bd6737m_35g_b_m0.bin<br>
│ ├── recovery.img<br>
│ ├── secro.img<br>
│ ├── system.img<br>
│ ├── trustzone.bin<br>
│ └── userdata.img<br>
└── modem<br>
├── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21<br>
├── _APDB_MT6735_S01_alps-mp-m0.mp1_W17.21.check<br>
└── APDB_MT6735_S01_alps-mp-m0.mp1_W17.21_ENUM
</div>