Tuesday 21 September 2010

ADB driver installation fails after ROM update or change

Sometimes, after changing the ROM in an Android device, ADB will not detect the phone when you plug it in.
This can happen because:
  1. The rom is a different OS version and there an updated driver version exists, so you will need to update your SDK.
  2. The update changed your device's PID (Product ID) and/or VID (Vendor ID). These two values are used in USB devices to identify them and to select the correct drivers for them.
In the second case, you can modify the inf file which comes with the Android drivers to associate it with the new VID/PID.

Friday 17 September 2010

Getting Calibre Server to run at Boot in Ubuntu 10.04

Calibre is a multi-platform eBook management software which supports multiple eBook reader and formats.

It also contains a simple eBook distribution server which can be accessed both via a web browser and an OPDS compatible client.

In this article I will set-up the Calibre server to start at boot time and serve books.

Even though Ubuntu 10.4 has Calibre in its repositories, I prefer to download and install the latest version as Calibre updates quite often with both compatibility fixes and new functionality.

The following procedure can be completely done over command line, on a headless system.

To do this, enter the following in a terminal:
 sudo apt-get install xdg-utils  
 sudo python -c "import urllib2; exec urllib2.urlopen('http://status.calibre-ebook.com/linux_installer').read(); main()"  

And follow the on-screen instructions. In case something goes wrong, go here and see if the instructions have changed.

There has been a report (by Emil in the comments) that the following are also needed in Ubuntu 10.10:
 sudo apt-get install xdg-utils imagemagick python-imaging python-mechanize python-lxml python-dateutil python-cssutils python-beautifulsoup python-dnspython python-poppler libpodofo-utils libwmf-bin python-chm   

After installing Calibre, it is time to set it up for boot start up.

Enter the following:
 cd /etc/init.d  
 sudo pico calibre  

In the editor which opens up, copy and paste the following script, making changes as needed (check the top 20-30 lines). UPDATE: if you are sing Calibre 0.7.27+ you need the script from here instead.

Sunday 12 September 2010

AMX and Procon Equipment

At work we are using a number of AMX Novara panels to automate the teaching lecterns/cabinets.

As Novara panels and the Solecis integrators used to be produced by Procon, there can be a bit of confusion regarding the model numbers.

Here is a small table with what is what (at least the things we use :)):

AMX NameProcon NameDescription
Novarra CP2024-TRYP2024-0124 Button Console 1 Cross
AVS-SLPR-0201-0301YP2020-021U Integrator
AVS-SLPR-0401-0601YP2011-022U Integrator
?8450-03IP Unit

On a similar note, most of the Novaras don't have the pin-out of the programming port printed on their back, so here it is:

Funny characters when using ADB,

Depending on the device's ROM and whether terminal colour is enabled, when you use ADB to connect to a shell, you might see weird characters in the terminal after you enter a command.

For example, this is my terminal after I entered 'ls':
The reason for this is that cmd cannot interpret the escape sequences for color and it is printing them as ASCII characters.

To fix this start adb shell normally and enter:
 alias ls='ls --color=never'  

It should then look like this:

Thursday 9 September 2010

Android tabbed, horizontally and and vertically scrollable tablelayouts

The following layout XML will allow you to create an application layout similar to the following, where the data under the tabs can be scrolled both horizontally and vertically by a finger swipe.


To see the horizontal scrollbar, you'll have to scroll to the bottom of the screen.

The XML file is after the jump:

Sunday 5 September 2010

Ubuntu 10.4 on a Toshiba SP6000


Installing Ubuntu 10.4 on a Toshiba SP6000 is actually quite painless.

Essentially everything seems to work out of the box, except the SD card reader (for which there are no drivers as far as I know) and a small resolution problem.I haven't tried the built-in modem either, but the third-party driver manager does install something in Ubuntu.

Display resolution fix:

The device will boot fine, but the X server will not detect the fact that the laptop supports 1024x768 and will only offer a maximum of 800x600.

This can be changed by editing the xorg file, but odds are that you won't have one under /etc/X11/xorg.conf.

To fix this, do the following. If you have an xorg.conf file, skip this bit:

  1. Change into a TTY pressing CTRL+ALT+1 or 2 or 3 or ...
  2. Log in using an account with sudo privileges.
  3. Type 'sudo service gdm stop'. this will kill the X server
  4. Type 'sudo Xorg -configure'. this will create an xorg.conf file in your home directory.
  5. Type 'sudo mv ~/xorg.conf.new /etc/X11/xorg.conf' to copy the file to the correct position.
Edit the file (using nano for example - don't forget to sudo it!) and change the following:

Add the HorizSync and VertRefresh lines to the "Monitor" section to make it look like this:

 Section "Monitor"  
   Identifier "Monitor0"  
   VendorName "Monitor Vendor"  
   ModelName "Monitor Model"  
   HorizSync 31-60  
   VertRefresh 50-75  
 EndSection  

Similarly, add the modes lines to the display subsection of the screen:

 SubSection "Display"  
   Depth 24  
   Modes "1024x768"  
 EndSubsection  

Start the X server again (sudo service gdm start) and you should be done.

TTY resolution fix:

A second problem (which you might have noticed if you followed the guide above) is that the TTY display is a bit weird.

To fix it, edit the /etc/defaults/grub file and add/edit the following two lines:


 GRUB_GFXMODE=1024x768  
 GRUB_GFXPAYLOAD_LINUX=1024x768x32  

Afterwards, recreate the GRUB by typing "sudo configure-grub" and restart to see it work.