HowTo: Use SurfTab Xiron on Mac for Development + ADB

After you enabled the developer mode and USB debugging on your SurfTab Xiron you have to add the Vendor-ID to an special file.

The easy solution is:

“echo 0x1e68 >> $HOME/.android/adb_usb.ini”

This will open the adb_usb.ini file in you .android folder and adds the vendor ID of Trekstor 0x1e68.

SurfTab Xiron 7 USB Debugging

Ignore the warning and do NOT type android update adb.

After that you can call adb kill-server and adb start-server.

Have fun using USB Debugging on your TrekStor SurfTab Xiron!


How to fix Nexus 4 Black Screen and not charging problem

This morning it happened: MY NEXUS 4 WAS DEAD ! BLACK SCREEN !
Pushing the power Button had no effect and when i tried to charge it there was no battery symbol.
I tried everything with success !

1. Remove the Nexus 4 from the charger.

2. Press and Hold Power + Vol Down for 20 seconds

3. Connect the Nexus 4 to the Charger AND ….

4. Black Screen Problem should be solved !

if not try again. If nothing helps and you had problems charging you Neuxs 4 before. Try another usb cable to charge you phone. Maybe you charging port is broken. If you have a friend with a Qi Wireless charging station give it a try.

Download and Install Android Studio 0.8.12

Two days ago the brand new Android Studio version 0.8.12 (download) was release. It brings a totally new Android Virtual Device Manager (AVD Manager). Its more easier to use and allows you to quickly deploy your App on a Emulated Device (better integration). Other changes are mainly for a better and smoother usability. If you want do have more details please visit the Android Studio 0.8.12 change log page.


0. Pre-Requirements

For absolute beginner please first check if you have java installed (at lease v1.6). To do that simply type: javac -version

javac -version

If this is not installed please go to the Oracle website and download the Java JDK.


1. Download Android Studio 0.8.12

Go to Android Tools Project Site to download the latest version of the Android Studio IDE. It is available for Windows, MacOS and Linux. As you can read in the NOTES the Android SDK is not included. So we also need to download that. Simply go the Android Developer Site and Download the Android  SDK for an existing IDE. I’ve made the experience that you can’t download the SDK using Chrome or IE. So I had to use Firefox. Really odd.

As Windows user you can download the recommended Installer version.


2. Install Android Studio 0.8.12 on Mac and the Android SDK (as standalone)

Installation is quite simple. On MacOS you simply have to extract the and put the “Android” into you Program folder (as usual).

If you would start it now this Warning will be popup: Your Android SDK is missing, out of date, or is missing templates.

Your Android SDK is missing, ut of date, or is missing templates

So first unzip the SDK zip, Next is finding a place where you want to store the SDK. I created a Android folder in my home-directoy and copied the android-sdk folder into it. So that the Path to my Android SDK is “/Users/your-username/Android/android-sdk-macosx/“. Please remember where ever u put it.

Android SDK folder structure

Android SDK folder structure


3. Configure the Android Studio for the Android SDK

Now we can start Android Studio. On the “Welcome to Android Studio”-Dialog we click “Configure” –> “Project Defaults” –> “Project Structure”. On the “Android SDK location” we click on the “…” Button and navigate to the location of the SDK. Than press “Ok”.

Setting the SDK Path in Android Studio

Setting the SDK Path in Android Studio

The Android SDK is now configured and can be used.  With the little blue arrow at the top left corner we can go pack to the start dialog.


4. Create a Android Project

We can now select “New Project…” and click next. The wizard is quite easy to understand. Simply fill in all fields and press Next.
Application Name: My First Android App
Company Domain: or
Project Location: /Users/your-username/Android/Workspace/MyFirstAndroidApp

The next Page is about the Android SDK that you want to use to compile (create) your app. It atm it usually suggests to take API 15 which is fine. There is also a explanation for the impact of the selected API version. It says:

Lower API levels target more devices, but have fewer features available. By targeting API 15 or later, you app will run on approximately 87,9% of the devices that are active on Google Play Store.

So, if you want to support Devices running Android 1.6 you have to pick API 4. But you can’t use features like the fancy ActionBar if you do so.

On the next Page they may ask you for some licence agreement and then download the SDK API Version in case it’s not already stored in your android-sdk folder.

Than, finally the wizard asks you with which “template activity” you want so start. For now se select “Blank Activity” and click next.
Template Activity

Now you can name your Activity (the class), the Layout (xml file), the Title (name displayed on the running app) and the menu res name (xml to define the menu). You can rename stuff here if you like. Click FINISH.

5. Android SDK Manager

Click on the Android Symbol with the blue little download box. If you want you can select more

android sdk manager

Android emulator: Failed to open the hax module

I had the Problem that i could not start the android emulator on my Macbook (Mac) using “Intel Atom x86”.


emulator: Failed to open the hax module
hax is not working and emulator runs in emulation mode mac

Solution was downloading this fix.

Android ActionBar “Check” and “Cancel” Icon Images

I recently was looking for Images for my Android app and could not find files were i was sure that i’m allowed to used them. I this case i needed “check” or “done” icons and a “cancel” icon.
ic_done ic_canel

I made some myself. There are free to use. I included the src photoshop files (psd) and the png’s for all different sized (xxxhdpi, xxhdpi, xhdpi, hdpi and mdpi)

Download Icons (mirror)

EasyBox 802 als Vorschalt-Modem über LAN1 Internet (Tutorial)

Die Folgende Anletung erklärt Schritt-für-Schritt wie ihr eure EasyBox 802 als Vorschalt-Modem verwendet könnt, also mit einer bestehenden Internet Verbindung per LAN1 das Gerät als WLAN Router nutzen könnt. Diesen Fall hat man häufig bei KabelDeutschland.

Schritt 1:

Router resetten. Dazu drückt ihr 10 Sekunden lang mit einem Sspitzen Gegenstand in die Einlassung die mit RESET beschriftet ist.

Schritt 2:
Mit dem Router Verbinden. Verbindet euch mit dem Router per LAN Kabel.
Öffnet den Browser und verbindet euch auf Box indem hier ihr IP-Adresse eingebt.
In der Regel sollte diese wie folgt lauten:
Nehmt keine Einstellungen vor !

Schritt 3: Vorschalt-Modus (VDSL) aktivieren. Die EasyBox 802 besitzt selbst kein VDSL Modem, daher gibt es den Vorschalt-Modus zu verwenden und die EasyBox802 nur als WLAN Router zu verwenden. Dazu ruft ihr die “vdsl_enable.stm” Seite auf. Ist die IP eures Router so lautet diese:
Setzt den Haken bei “LAN Port 1 als Uplink für ein externes Modem benutzen”.

Vorschalt-Modem EasyBox 802

Vorschalt-Modem EasyBox 802

Schritt 4:
Wartet 3 minuten und Versucht euch dann wieder mit der Box zu verbinden. Sollte dies nicht gelingen startet die Box neu (nicht resetten – nur neustarten).

Schritt 5:
Wenn ihr mit der Box verbunden seid sollte ihr nach dem einloggen (User: root – Passwort: 123456) im ersten Dialog auf “Benutzerspezifische Installation” klicken. Im Folgedialog “Offener Modus”

Schritt 6:
Nun kommt ihr zu der Standard Startseite der Vodafon EasyBox 802 mit der besonderheit das bei Internet “Ethernet Uplink: Nicht verbunden” steht. Klickt im Menü auf “Daten” und dann “WAN”. Bei WAN 1 übernehmt ihr folgende Einstellungen:

Protokoll: “Routing”
IP-Adresse bleibt auf
DHCP Client: Haken setzen
802.1Q (1p/VLAN ID) Tagging auf 0

Schritt 7:
Mögliche Netzwerkkonflikte aus dem Weg räumen. Mein Router, welches die EasyBox gleich mit Internet versorgen soll, befindet sich ebenfalls auf der IP Daher musste ich die IP Adresse der Easybox 802 ändern. Dazu klickt ihr im Menü auf “Startseite” und dann “LAN”. Ich habe die IP auf gesetzt. Im Anschluss übernehmen und warten bis die Einstellungen übernommen wurden. Trennt nun kurz eure WLAN oder Kabelverbindung und verbindet euch wieder wenn die Box neugestartet ist. Die Box ist nun über die neue IP Adresse erreichbar.

Schritt 6:
EasyBox 802 an das LAN anschließen. Das Netzwerkkabel welches zuvor euren Rechner mit der Box verbunden hatte benötigt ihr nicht mehr. Verbindet nun euer Netzwerk mit dem EasyBox 802 und nutzt dafür den Uplink Port (also LAN1).  Voraussetzung ist das euer Netzwerk ein DHCP Server verwendet.

Schritt 5: 
Verbindet euch mit dem WLAN der EasyBox 802 und genießt.


How To: Set Bluez into BLE or LE only mode (IBeacon)

By default a bluetooth device driven by bluez will appear as a “BLE and ER/EDR” or “Both” device. If you want it to be an LE only device this is what you need to do:

btmgmt le on
btmgmt bredr off

Info: the btmgmt command is not in the set of tools that are installed by default. Also your kernel version must be at least least version 3.13

To install btmgmt (bluez) go the the folder with the source code and run:

./configure --prefix=/usr    \
        --sysconfdir=/etc    \
        --localstatedir=/var \
        --enable-tools       \
        --disable-test       \

you may need to add:
--with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd




sudo /usr/bin/install -c tools/btmgmt /usr/bin/btmgmt

How to: Build you own Bluetooth Low Energy IBeacon for 10 $ DIY

IBeacons become more and more popular but most companys charge about 30$ for them. Thats way to much, so lets to it ourselves.
But first… the Shoppinglist:

HM-10 ( 6,50$
Battery Holder for Coincells ( 0,20$
Protoboard ( 0,60$
Steel Pins ( 1,50$
CR2025 CoinCell  1,00$

HM10 BLE Module

HM10 BLE Module

First we should have a look in the datasheet (HM10 are made by and search for this graphic:

HM-10 Wiring

HM-10 Wiring

Important for us are actually only UART_TX, UART_RX, GND and 3.3V. If you want you can also use pin23 and pin24 to have leds on you beacon. But using the leds will cost energy.

Next we take the steel pins and bend them in a way that they match the indentations on the HM-10 board. Than we can start soldering.

HM-10 soldered to pins

I also soldered some pins on the right side of the HM-10 this give more stability and it won’t break so fast.
We also need Pins to connect them to a serial interface and flash new firmware or configure the module.

DIY IBeacon with HM-10

to be continued … 🙂

Fix: Bluez keeps crashing

I had the problem that my BlueZ was continuously crashing. Even when I was just using a few commands of for example hcitool or scanned for advertising BLE devices (as example). 

Set scan parameters failed: Input/output error.

I than checked dmesg to find out more:

Bluetooth: hci0 command tx timeout.

At the beginning i tried to shut it down and up again.

hciconfig hci0 down 
hciconfig hci0 up


service bluetooth restart
service dbus restart

And it worked – sometimes :-/ Even better was removing the Bluetooth Stick and plug it in again. But that was annoying. So i figured out how to reset a usb device from command line tool. First use lsusb to find the vendorId and use grep to search for it.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp. 

cd /sys/bus/usb/devices/

grep -i -s -r 0a5c *

cd 1-1.2

echo 0 > authorized
echo 1 > authorized

So my usb device was in /sys/bus/usb/devices/1-1.2/. In the moment when you set the value in authorized to 0 the usb bluetooth device is not longer allowed to communicate with your computer (this is what I guess). And after setting it to 1 it is forced to re-init. Awesome. This is a solid solution.


Anyway I was looking for a solution that totally fixes the problem permanently. 
First I updated the kernel to the latest version. Since I was using an raspberry pi this can easily be done be using this commands:

cat /proc/version
sudo rpi-update
sudo reboot

Than i change the content of my /boot/cmdline.txt to:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline dwc_otg.microframe_schedule=1 dwc_otg.speed=1 rootwait

And after rebooting my problem was fixed. 🙂 Change to your cmdline.txt may cause problem with others USB devices. So to change it back later. Backup it first.

HowTo: Install bluez and dbus

I had a lot of trouble installing bluez-5.16 on my Raspberry Pis. But finally i made it and i wrote a little script. Which might be helpful for many of you.

Bluez is supporting the Bluetooth Low Energy (BLE) or Bluetooth Smart stack. So first thing i did was buying a Bluetooth LE USB Dongle on Amazon (DE / US).

Anyway here is the script. It’s pretty ugly written any maybe you should just copy and paste it line by line to install it on your machine otherwise i might miss some error messages that could occure. I’m using bluez-5.17 amd dbus-1.8.0.



if [ “$(id -u)” != “0” ]; then
echo “Sorry, but you have to be root.”
exit 1
apt-get update
apt-get upgrade
apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
echo “Creating bluez_temp folder”
mkdir bluez_temp
cd bluez_temp
echo “Download: bluez-5.17”
echo “Download: dbus-1.8.0”
echo “uncompressing”
tar –xz -xvf bluez-5.17.tar.xz
tar xzf dbus-1.8.0.tar.gz
cd dbus-1.8.0
echo “install dbus-1.8.0”
make install
cd ../bluez-5.17
echo “install dbus-1.8.0”
./configure –disable-systemd –enable-library
make install
sudo apt-get install python-bluetooth python-requests
sudo hciconfig hci0 up

To avoid a problem that might occur we need to add a permission to the dbus bluetooth config.

sudo su –
cd /etc/dbus-1/system.d
nano bluetooth.conf

and add this


Than restart the service: service dbus restart.