Android USB debugging on openSUSE 11.4

Debugging your android app using a hardware device has several advantages, ie faster and more testing possibilities. On windows you have to install a custom USB driver, on linux it’s a matter of configuring your udev rules:

  • add a rules files in /etc/udev/rules.d , ie 44-android.rules
  • enter a line like this:
    SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="users"

    and adapt the vendor id using this table.

  • Reload udev rules: udevadm control --reload-rules

When you run adb devices, it should now list your device:

List of devices attached 
emulator-5554   device
SH14FPL06953    device

Before, you would rather have something like this:

List of devices attached 
emulator-5554   device
????????????    no permissions

On succesful connection, the system log shows something like:

kernel: [11172.551464] usb 2-1: USB disconnect, address 4
kernel: [11178.813044] usb 2-1: new high speed USB device using ehci_hcd and address 5
kernel: [11178.942137] usb 2-1: New USB device found, idVendor=0bb4, idProduct=0c87
kernel: [11178.942150] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: [11178.942157] usb 2-1: Product: Android Phone
kernel: [11178.942162] usb 2-1: Manufacturer: HTC
kernel: [11178.942166] usb 2-1: SerialNumber: SH14FPL06953
kernel: [11178.943867] scsi8 : usb-storage 2-1:1.0
mtp-probe: checking bus 2, device 5: "/sys/devices/pci0000:00/0000:00:04.1/usb2/2-1"
mtp-probe: bus: 2, device: 5 was not an MTP device
kernel: [11179.953172] scsi 8:0:0:0: Direct-Access     HTC      Android Phone    0100 PQ: 0 ANSI: 2
kernel: [11179.953375] sd 8:0:0:0: Attached scsi generic sg4 type 0
kernel: [11179.961631] sd 8:0:0:0: [sdd] Attached SCSI removable disk

Note that it seems normal that a usb storage device is detected, although I did not have it enabled on the phone.

Project announcement: UZLGastennetLogin

One month ago, I bought an android smartphone and a few days later my first app was born: UZLGastennetLogin! =)

Note: This app is only useful to people working at or visiting the University Hospitals Leuven.

At UZLeuven we have a separate network to provide internet access to alien/untrusted devices: patient, visitor or external company laptops, tablets, smartphones etc. You need a personal access code to access this network though. When you are not logged in, any website you try to access, redirects you to a login portal.

There are 2 problems using this network on a smartphone:

  • Not all smartphone browsers can display the login page properly, so it is impossible to access the internet.
  • Every time you turn off your wifi (to save battery) or loose signal (very likely in an elevator), you have to relogin, which is quite time-consuming.

This is where the app will come in handy:

  • Detect network changes (without polling)
  • When UZLeuven guest network is detected, check whether we are logged in, if not login in the background using preconfigured credentials.
  • Indicate current state through a widget.

The first version of the app allows only manual login, but it already saves you from using the webinterface and re-entering your credentials over and over again. Today, I published it on the market.

Available in Android Market

Disabling hibernation on windows 7 and why Dirt 2 shows no replay

Yesterday I made this awesome flying finish in Colin McRae Dirt 2 and wanted to view the replay only to realize: there is no replay? That sounded impossible and today, after missing another fine opportunity, I decided to go to the bottom of this. 🙂

Turned out Dirt 2 automatically disables the replay functionality behind your back when there is insufficient free space on your OS partition! That’s right:

  • I have Dirt 2 installed on a partition with 15 GB free space, but that doesn’t matter.
  • It requires 2GB to save a replay!
  • I does not inform the player when it gets turned off (it used to work in the beginning).
  • There is no visual indication whatsoever, that the replay functionality uberhaupt exists but is disabled! It is surgically removed from the gui instead of just a disabled button, for example.

IMO, this is just another example of why consolisation of excellent PC games like CMR is BAD. Anyway, don’t let me go there, let’s focus on hibernation in win 7. 🙂

So I have a 20GB partition for Wintendo 7, but with only 1GB free that does not seem to cut it. Turns out about 6.5GB is taken by the hibernation file (I have 8GB RAM) which I don’t use. So, how to disable that in windows 7? Open a command prompt as administrator and type:

powercfg.exe /hibernate off

That’s all.

Mouse locating kwin effects

Ever felt lost on your desktop? Or more precisely: unable to find your mouse pointer within a (few) second(s)? I know I have, and nowadays on 2 monitors or more (or a huge 48″ tv), this isn’t an exception.

In KDE, we always had the track mouse effect which draws circling yellow stars around your pointer. Unfortunately, this is not adequate anymore. That’s why I thought it would be fun to write my own effect which would do a better job. The key to success seems to me that it should be a full screen effect drawing the attention to the right spot no matter where at the screen you’re looking.

For now, I’ve devised 3 effects:

  1. Looney tunes zoom: fancy term for describing an effect which darkens the background and zooms in on the cursor with a spotlight. I somehow associated that with intro or outro from looney tunes, not sure if that makes sense. :p
  2. Sunray: animates some kind of rays around the mouse position.
    kwin sunray mouse locate effect
  3. Radial texture animation: least fancy name, as it is so generic. 🙂 It just animates a texture from outer to inner. The concrete application is to show arrows pointing to the mouse.
    kwin arrow mouse locate effect

For the last 2 effects, I don’t have screencasts yet, don’t ask, I’ve been through hell to create the first one. Also, for the last one, I have to fix the texture uv map generation, or use a better mesh (or maybe a different technique 🙂 ).

Project announcement: KonnectionMonitor

A few years ago, back in 2007 when I started using Linux as my primary operating system, I had a few itches to scratch because I missed my handy windows utility programs I’d become grown to. One of those utilities was TCPView which monitors incoming and outgoing TCP connections.
Hence, a new project was born: KonnectionMonitor. It’s goal was to mimic the TCPView utility on Linux/KDE.

Learning the /proc filesystem, I was amazed how easy it was to write such program. I’m not sure if it is the ideal way, but it works. Packaging seemed less easy though. 🙂 Nowadays we have a fully fledged opensuse build service and kde-apps.org integrating with it which makes publishing your soft a lot easier. I already gained some experience packaging VocTrainer and Telemeter Plasmoid, so it was only a matter of finding time to package this oldy. It’s baptized with the kind of cheesy name KonnectionMonitor which suggests it is built for KDE, but currently there is no KDE dependency present, so feel free to use it bloatingly-free in other desktop environments. 🙂

One remark: if you know TCPView, you will currently miss the close connection command in KonnectionMonitor. I’ve looked into ways on how to implement this on linux and there is no obvious way to do that (there is no api function). The only solution coming close to that, is sniffing the network and sending a RST (reset) packet (which in turn involves some other low level network tricks to be able to send a valid packet to the right host). I’ve already started experimenting with libpcap. It should be doable, stay tuned.

For now, we have version 0.1 which can be downloaded from kde-apps.org. The source is on gitorious.

KonnectionMonitor v0.1

Telemeter plasmoid v0.2

Most important improvements are:

  • Auto refresh respecting server-side request throttling.
  • Asynchronous webservice request prevent plasma from freezing (when webservice time-outs)

Keep in mind: the telenet webservice does not always work. 😉

Changelog
– added icon
– don’t let theme determine label color
– autorefresh option: takes ticket expiry into account
– deny refresh request when request is in progress
– don’t fetch at startup when configuration is needed
– gui feedback when refreshing
– show usage and next request time in tooltip
– on error, show webservice error message in tooltip
– refresh in separate thread: fixes plasma hang when webservice is out of service

Download

Telemeter plasmoid v0.2