5

I expect it to be something like

adb shell am start SomethingArcane ... "Hello, world"

and the message box pops up on screen, saying "Hello, world".

1

2 Answers 2

2

Hacky workaround: DirectFB

With DirectFB and root access, you can display the text on screen directly, without Android at all.

I've implemented a program for this: directfbtext.

( echo "Hello, world"; echo "FLIP"; sleep 2; echo "QUIT" ) |  /h/bin/directfbtext --dfb:fbdev=/dev/graphics/fb0  --dfb:no-vt  /system/fonts/DroidSans-Bold.ttf 30 120 200 255

Note that it is probably not that easy to get DirectFB working on Android, but I happen to have it already configured.


Update Per user request, I've created and tested a "portable" pre-built version of directfbtext. Setting up and running:

  1. Unpack directfbtext_deps.tar.gz into /data/local/tmp/;
  2. Start adb shell, go root (su);
  3. cd /data/local/tmp/directfbtext;
  4. Create symlink from /usr/lib/arm-linux-gnueabi/ to /data/local/tmp/directfbtext:

    # mount -o remount,rw / /
    # mkdir /usr
    # mkdir /usr/lib
    # ln -s /data/local/tmp/directfbtext /usr/lib/arm-linux-gnueabi
    
  5. Ensure display is on

  6. LD_LIBRARY_PATH=. ./ld-linux.so.3 ./directfbtext --dfb:fbdev=/dev/graphics/fb0 --dfb:no-vt /system/fonts/DroidSans-Bold.ttf --dfb:system=fbdev 30 120 200 255
  7. Type some text, followed by a line that reads "FLIP";
  8. Observe the text visible on the display;
  9. Type "QUIT" to exit directfbtext;
  10. Interact with the device, so it updates display and clears remaining glitches caused by DirectFB.
5
  • Maybe you can tell what need to be configured?
    – not2qubit
    Commented Jan 8, 2015 at 0:16
  • The main thing is probably a Debian in chroot.
    – Vi0
    Commented Jan 8, 2015 at 1:20
  • Could you provide a binary? (Or instructions how to compile with NDK?)
    – not2qubit
    Commented Jan 14, 2015 at 23:08
  • Unfortunately static binaries are tricky to get with DirectDB. The program was build not using Android NDK and depends on Debian libraries. I'll try to hack up "semi-portable" version of it now.
    – Vi0
    Commented Jan 14, 2015 at 23:34
  • 1
    @user1147688, Done. You can try testing it.
    – Vi0
    Commented Jan 15, 2015 at 0:28
2

FBTrueType-android

I have written a native android program FBTrueType-android to print TrueType font text directly to the display on the device using ADB.

It has many features including clearing the framebuffer (display) and changing the *.ttf font used, font color, font size, x and y positions.

It also can run with Zygote (android interface) running and it can capture the framebuffer from Zygote in fullscreen.

I setup a github repository for it which you can access here, alternatively you can clone the repository like this:

$ git clone https://github.com/mikelinux/fbtruetype-android.git

You will need to be setup to cross compile for ARM, the README file has full instructions on doing this.

Enjoy, and please post your feedback.

Mike

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .