Difference between revisions of "Android"

From sigrok
Jump to navigation Jump to search
Line 1: Line 1:
== Building from source ==
== Building from source ==
=== Current status ===
You can start the sigrok application on your android phone using a terminal (ex: adb). You don't need root access.
It's strongly suggested to use at least android 4.0.3.
You cannot integrate sigrok in a android application yet. (WIP)
You don't have a nice UI. (WIP)
=== Binary ===
You can download a pre-compiled test version on [https://www.dropbox.com/sh/ndnwwct2ahl58cr/Awmm2vrTkX]
You are welcome to give feedback to martling on the IRC channel or gabriel.klein@nuage.ch.


=== Initial setup ===
=== Initial setup ===

Revision as of 10:00, 27 March 2014

Building from source

Current status

You can start the sigrok application on your android phone using a terminal (ex: adb). You don't need root access.

It's strongly suggested to use at least android 4.0.3.

You cannot integrate sigrok in a android application yet. (WIP)

You don't have a nice UI. (WIP)

Binary

You can download a pre-compiled test version on [1]

You are welcome to give feedback to martling on the IRC channel or gabriel.klein@nuage.ch.

Initial setup

First, download the latest Android NDK and extract it, e.g. in $HOME/android.

$ cd $HOME
$ mkdir android
$ cd android
$ wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86.tar.bz2
$ or wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2 (If you have a 64 bits version of Linux)
$ tar xfvj android-ndk-r9d-linux-x86.tar.bz2
$ cd android-ndk-r9d

Now, create a toolchain installation that can be used for cross-compiling for Android (adapt --platform and --arch as needed):

$ ./build/tools/make-standalone-toolchain.sh --platform=android-15 --install-dir=$HOME/android/android-arm-toolchain --arch=arm

You now have a working toolchain and build environment in $HOME/android/android-arm-toolchain.

You may need to install additional packages: libtool, ...

Cross-compiling

$ git clone git://sigrok.org/sigrok-util
$ cd sigrok-util/cross-compile/android
$ ./sigrok-cross-android

Please check the README and edit the sigrok-cross-android as needed.

Hardware

You may be interested to buy a Micro USB On-The-Go (delivery is 4-8 weeks.)

Testing

Create a temporary folder where you can store and execute files on your android phone.

$ adb shell
$ mkdir /data/local/tmp/sigrok/
$ exit

Copy libraries on your phone

$ cd ~/sr_android/lib/
$ ls *.so* | while read l; do adb push $l  /data/local/tmp/sigrok/; done

Copy sigrok-cli to the phone

$ cd ~/sr_android/bin/
$ adb push sigrok-cli /data/local/tmp/sigrok/

Test is sigrok cli is working as expected

$ adb shell
$ cd /data/local/tmp/sigrok
$ export LD_LIBRARY_PATH=/data/local/tmp/sigrok 
$ ./sigrok-cli --scan