aboutsummaryrefslogtreecommitdiffstats
path: root/HOWTO/INSTALL-ANDROID.md
blob: 31698d4ce37a9e8470df6b913f7e3fcfdf718b1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Cross Compiling Erlang/OTP - ANDROID
====================================

Introduction
------------

This document describes how to cross compile Erlang OTP to Android/Rasberry Pi platforms.

### Download and Install Android NDK ###

https://developer.android.com/tools/sdk/ndk/index.html

### Define System Variables ###

export NDK_ROOT=/usr/local/android
export NDK_PLAT=android-9
export PATH=$NDK_ROOT/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin:$PATH

### Configure OTP ###

./otp_build configure \
   --xcomp-conf=./xcomp/erl-xcomp-arm-android.conf  \
   --without-ssl

### Compile OTP ###

make noboot [-j4]

### Make Release ###

./otp_build release -a /usr/local/otp_R16B03_arm

### Target Deployment ###

Make a tarball out of /usr/local/otp_R16B03_arm and copy it to target device
(e.g. Raspberry Pi). Extract it and install

./Install /usr/local/otp_R16B03_arm

Android SDK (adb tool) is used to deploy OTP/Erlang to target device for 
evaluation purpose only.

adb push /usr/local/otp_R16B03_arm /mnt/sdcard/otp_R16B03_arm
adb shell

### Known Issues ###

 * native inet:gethostbyname/1 return {error, nxdomain} on Raspberry PI. Use dns resolver to by-pass the issue (see http://www.erlang.org/doc/apps/erts/inet_cfg.html) 

### References ###

  The port derives some solutions from https://code.google.com/p/erlang4android/