Friday, 17 December 2010

Changing the build.prop on a X5A-G

The following procedure will make Skype work on a X5A-G, make sure that the unit is using the screen space properly (no more big icons) and possibly make it a bit smoother.

Make sure you are rooted, and that adb recognises the device.

Type the following to download the build.prop file to your harddrive:
 adb -d pull /system/build.prop  

Open the build.prop file with a text editor and set the following properties as follows:


And add the following line at the end

Save it, and type the following to send the file back to the device.
 adb -d remount  
 adb -d push build.prop /system/build.prop  
 adb -d reboot  

If you get any error messages after the "adb -d remount" line, then you do not have root...

Edit: fixed missing '=' sign in the 'dalvik.vm.execution-mode=int:fast' line...

Thursday, 16 December 2010

HSG X5A and ADB Drivers

Similar to the previous posts about the Desire Z and Android devices in general, the lines you need to follow the following procedure to get a HSG X5A (which  is actually a decent device which can playback full HD with no problems):

1. Make sure you have updated the SDK and the USB driver to the latest version.
2. Open the android_winusb.inf file (located under the android-sdk-windows\usb_driver directory) using a text editor. I personally prefer Notepad++.
3. Add the following lines under the [Google.NTx86] and [Google.NTamd64] sections:
%SingleAdbInterface%        = USB_Install, USB\VID_18D1&PID_DEED
%CompositeAdbInterface%     = USB_Install, USB\VID_18D1&PID_DEED&MI_01
4. Save the file
5. Try to install the driver again.

This might work with other HSG tablets (or their rebrands).

Friday, 12 November 2010

HTC Desire Z (AKA HTC Vision AKA T-Mobile G2) and ADB drivers

I just got myself a Desire Z and once again the ADB drivers fail to install in windows.

It is the same problem described and solved in this post.

To fix:
1. Make sure you have updated the SDK and the USB driver to the latest version.
2. Open the android_winusb.inf file (located under the android-sdk-windows\usb_driver directory) using a text editor. I personally prefer Notepad++.
3. Add the following lines under the [Google.NTx86] and [Google.NTamd64] sections:
 ;Desire Z  
 %SingleAdbInterface%    = USB_Install, USB\VID_0BB4&PID_0C91  
 %CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C91&MI_01  
4. Save the file
5. Try to install the driver again.

If it still fails to load, follow the instructions from this post to find the correct VID and PID of your phone.

Sunday, 7 November 2010

"Unable to open connection to server" error when connecting to Exchange on Android 2.2

There seems to be a problem when using the default Android Email application to connect to an Exchange Server 2010 SP1.

When you go through the setup procedure and enter all necessary info to setup a new account on the phone, the setup will eventually fail throwing a "Setup could not finish" "Unable to open connection to server." message.

On the server side, the following log is generated:
 RequestBody :   
 <?xml version="1.0" encoding="utf-8" ?>  
 <FolderSync xmlns="FolderHierarchy:">  
 AccessState :   
 AccessStateReason :   
 ResponseHeader :   
 HTTP/1.1 449 Retry after sending a PROVISION command  
 MS-Server-ActiveSync: 14.1  

Google is aware of this ( and they calim to have fixed it but it is unknown when an update will be pushed.

The interesting thing though is that the Email application which is included with the 2.2 emulator seems to be working fine. So what we will do is extract the Email.apk from the emulator and install it on the phone.

Requirements: Rooted device, installed ADB and Android 2.2 Emulator.
Note: This will remove any improvements a ROM developer has included in Email.apk.
Disclaimer: I am not responsible if by doing this you damage your phone/data/life in an way. Backup your data first, preferably by making a Nandroid backup.

Saturday, 6 November 2010

Autostart script changes for Calibre 0.7.27

In version 0.7.27 of calibre, the "auto reload" command has been unbundled from "--develop". As a result, the script in the previous post has to be updated. Only the script changes, the rest of the procedure is the same.

The "DEMON_ARGS" line changes from
  DAEMON_ARGS="--develop --with-library=$CONTENT --pidfile=$PIDFILE --port=$PORT --max-cover=$MAX_COVER --daemonize"   
 DAEMON_ARGS="--auto-reload --with-library=$CONTENT --pidfile=$PIDFILE --port=$PORT --max-cover=$MAX_COVER --daemonize" 

The full updated script can be found after the break:

Thursday, 4 November 2010

Downloading and Parsing the IEEE MAC address OUI to a CSV in VB.Net

The following function will parse a OUI file and create a CSV file where each line will contain the first six characters of MAC address and the company they are registered to. To see how a OUI file looks like click here (it is a couple megabytes long).A function to download the OUI (or any file via HTTP) is also provided after the break.

It takes two parameters: "FileInPath" is the location of the OUI file and "FileOutPath" is the path of the CSVyou want to save to. If no file is there, one will be created automatically.

Wednesday, 13 October 2010

AxVLCPlugin2, Visual Basic 2008 and Windows 7 64bit - clr20r3 and REGDB_E_CLASSNOTREG

I've been writing an application to monitor multiple streams in VB 2008 and I started using the AxVLCPlugin2 which comes with VLC.

It is a nice plugin and apart from a few problems (it will not go fullsceen in version 1.1.4 for example) works fine for any stream that VLC supports.

I do most of my work on a 32bit XP box at work, but sometimes I like to work on projects at home using my 64bit Win7 PC.

For most projects this works fine, but on this one every time I started the application it would crash telling me that an error with an "EvenType: clr20r3" has occurred. It also gives a lot of information about the crash but nothing useful to point to the source of the error.

Assuming that the problem was that the application could not find VLC or that the AxVLCPlugin2 was not recognised, I fired up Visual Studio, cleaned up the project and tried to recompile - at which point VS proclaimed that "Class not registered (Exception from HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))".

No matter how many times I removed the reference an added it again, the error remained the same.

The solution was quite simple though.

Go to the "Project properties -> Compile" and set the platform to "x86" instead of "Any CPU". This allowed the application to successfully compile and run on the 64bit Win7 pc, without breaking it for the 32bit.

If "x86" does not appear in the combobox, open the configuration manager (Build -> Configuration Manager).

In the Configuration Manager dialogue, select "New" from the "Active Solution Platform" combobox.

In the new dialogue, select "x86" and "Copy Setting from Any CPU" and leave the checkbox ticked.

Keep in mind that this will create a new directory under the "<project>/bin/" folder of your project called "x86" which will contain new debug and release subdirectories. So make sure that if you have any shortcuts to your executables pointing to the old "<project>/bin/release" or "<project>/bin/debug" folders they are updated accordingly.

Tuesday, 12 October 2010

Setting up an AXIS 241QA Video Server to Control an Everfocus PTZ Camera

Camera Setup
1. Set the protocol on the camera to Pelco-D.
2. Set the baud rate to 9600bps.
3. Give a unique address to the camera.

For the Everfocus EPTZ500 cameras, the setup DIP switches will look like: 10 00 00 00

AXIS Server Setup

1. Set the RS485 mode to “Pan Tilt Use”.
2. Load the Pelco driver. It can be found at the Axis website (there is a link in the server’s web UI).
3. Check the “Force Install” checkbox before hitting ok.
4. Set the device type to “Generic”.
5. Set the Address to be the same as the camera’s address.
6. Set the RS485 port settings as follows (they are at the bottom of the page):
Baud Rate: 9600
Data Bits: 8
Stop Bits: 1
Parity: None

Cable Connection
1. The Yellow (+) cable on the Camera goes to the RS-485-A pin on the Axis (Pin 11 for the 241QA).
2. The Orange (-) cable on the Camera goes to the RS-485-B pin on the Axis (Pin 12 for the 241QA).

1. If something doesn’t work, make sure that Camera’s address is reflected correctly in the server’s port/video settings.

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('').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 ~/ /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  

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

 SubSection "Display"  
   Depth 24  
   Modes "1024x768"  

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:


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