Tuesday, March 31, 2009

Android seminar in Lund

Our initial project in the Android team was to prepare a demo were we integrated the Enea message passing methods available in Linx with the Android platform. This demo was presented at our Android seminar in Lund, Sweden on March 10. The seminar was a success with more than 200 attendees from different companies in the wireless industry, among them ST Ericsson and Sony Ericsson. The breakfast session included a short presentation of embedded Linux in general as well as an overview of the Android mobile technology platform.

Our demo setup is illustrated below. The hardware we used for this setup was a beagle board running Android using the patches made by Embinux. The Linx kernel modules and libraries were cross compiled for the platform and added to the Android init scripts. We also created some test libraries to handle the communication.

The setup allowed a user to write and send an SMS via the standard Android SMS application. When the user press "send" we catch the number and message and call a native C-routine via Java Native Interfaces. This routine creates and sends a Linx signal to a Linux PC with a phone attached to the COM-port, acting as a modem. Finally the message is sent via AT-commands.

This way we created a demo that interacts with the real world and with a obvious effect!

Thursday, March 26, 2009

Getting started with LINX on Android

Initial LINX tests on Android were made using a beagle board running Android with patches from Embinux. To get started with LINX the following steps are needed:
Download the LINX source from SourceForge. To get an initial cross compiled build we need a matchning kernel. Currently just pointing out the kernel in the Android distro will not work since LINX will produce some build errors. This should be checked and maybe fixed later on.
The way we worked around was to compile LINX against a standard kernel with Android patches. In this case a 2.6.27 OMAP kernel. I.e the build command will look something like:
cd <path>make ARCH=arm CROSS_COMPILE=<path>/arm-none-linux-gnu-eabi- KERNEL=<path>

At this point we took the generated kernel modules and copied them to a suitable place in the Android file system. The rest of LINX currently needs to be statically linked by adding -static to the makefile gcc options. This is because it is not built as part of the android build system and c library. Then copy the binaries to the /system/bin library of Android.
An ownership change is also needed to make the commands run on android
sudo chown root.root <file>
sudo chmod 777 <file>

After this it is just a matter of starting up android and doing insmods using the shell. Links can be created with mklink.


Howto build sdk and plugin - copy'n'paste version

The following commands are needed when building your own sdk and eclipse plugin.
In your homedir:

mkdir ~/repodir ~/plugindir ~/eclipse-android

cd ~/repodir

repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake

repo sync

source ./build/envsetup.sh

lunch 1



./development/tools/eclipse/scripts/build_server.sh ~/plugindir

make sdk

The output files are:
~/plugindir/android-eclipse-v200903261355.zip (or whatever date it is)
~/repodir/out/host/linux-x86/sdk/android-sdk_eng.user_linux-x86.zip (replace 'user' with your username)

Not much info about what they do at the moment. Execute the commands in the specified order and it should work. If it doesn't - please comment and I will try to clarify.