Le gioie di Javascript #1

Le gioie di javascript, scusate l’allitterazione…
Ho iniziato questo tutorial per JavaScript sulle pagine di un forum gestito da un amico ed ora che il mio blog comincia a predere forma e consistenza, ho deciso di proseguire direttamente qui. Spero di fare cosa utile.

Ho visto in giro alcune belle animazioni realizzate con programmi specializzati. Le animazioni sono un eccezionale strumento per attirare l’attenzione su un argomento di cui si sta trattando. Gli strumenti software che si utilizzano normalmente, siano quelli a pagamento, siano quelli gratuiti, hanno tantissime possibilità e permettono la realizzazione di “effetti speciali” davvero notevoli. Tutto OK.
Vorrei però focalizzare la vostra attenzione anche su un paio di formidabili strumenti gratuiti e multipiattaforma, in grado di girare su qualsiasi sistema operativo.
Questi strumenti sono :

a) il browser, in special modo Firefox che è presente su praticamente tutte le piattaforme software
b) il linguaggio di scripting Javascript

Javascript è un linguaggio semplice e potente e basta un qualsiasi editor di testi per scrivere la propria applicazione. Dove si fa “girare” un programma scritto in Javascript ? Dentro una pagina web, usando un browser. Il bello è che il programma può essere sul vostro PC o su Internet, le cose non cambiano.
La sintassi di Javascript è simile a quella del linguaggio C e comunque la rete è strapiena di esempi interessanti. Io ne aggiungo uno mio personale, per insistere nel discorso sulle risorse gratuite e liberamente utilizzabili e soprattutto per tentare di modificare l’atteggiamento comune di prendere “roba precotta” e invitare tutti a diventare “chef”, informaticamente parlando. Cominciate con un “ovetto al tegamino” per diventare grandi programmatori 🙂

Cliccando su questo link potrete trovare un’animazione minima realizzata con Javascript. Il programma è semplicissimo e si avvale del versatile tag DIV del linguaggio HTML usato per creare la “pagina” che contiene il gioco. Con Javascript è possibile modificare la posizione di una “sezione” DIV sullo schermo ; siccome in questo esempio la sezione DIV interessata contiene l’immagine di una palla, possiamo far muovere e “rimbalzare” la palla modificando, ad intervalli regolari di tempo, le coordinate X (left) ed Y (top) del relativo tag DIV. Questo è giusto un primo passo…

Per chi vuole studiare il “come è fatto dentro”, aggiungo il listato del programmino presentato (demo1.js) :

//<!-- javascript demo #1 - Emilio Ficara 2011
var id,timer; // definizione variabili per identificatore e timer
var xpos,ypos,xstep,ystep,xsize,ysize; // definizione variabili posizione, spostamento, dimensioni

  xpos = 0; // posizione x iniziale (0,0 angolo in alto a sinistra)
  ypos = 0; // posizione y iniziale
  xstep = 3; // spostamento ad ogni step sull'asse x
  ystep = 2; // spostamento ad ogni step sull'asse y
  xsize = 30; // dimensione orizzontale oggetto mobile (pallone)
  ysize = 30; // dimensione verticale oggetto mobile pallone
  gamex = 480; // dimensione orizzontale sfondo fisso (campo)
  gamey = 303; // dimensione verticale sfondo fisso (campo)
  NewStep(); // esegui la funzione per la prima volta (dopo verrà richiamata da timer)

function NewStep() // nuovo step spostamento oggetto mobile
{
    xpos += xstep; // nuova posizione x
    ypos += ystep; // nuova posizione y
    if(xpos > (gamex - xsize) || xpos < 0) // se oltre il bordo destro o sinistro
      {
      xstep = -xstep; // inverti lo step di spostamento orizzontale
      xpos = xpos +xstep +xstep; // esegui lo spostamento due volte (era andato già oltre)
      }
    if(ypos > (gamey - ysize) || ypos < 0) // se oltre il bordo superiore o inferiore
      {
      ystep = -ystep; // inverti lo step di spostamento verticale
      ypos = ypos +ystep +ystep; // esegui lo spostamento due volte (era andato già oltre)
      }
    id = "palla"; // assegna identificativo dell'oggetto che vogliamo muovere
    document.getElementById(id).style.top=ypos+"px"; // assegna la nuova posizione verticale all'oggetto
    document.getElementById(id).style.left=xpos+"px"; // assegna la nuova posizione orizzontale all'oggetto
    timer = setTimeout("NewStep()",10); // attiva timer per eseguire di nuovo la funzione NewStep tra 10 mS
}
//->

Di seguito, il istato del file demo1.htm che costituisce il “contenitore” che sarà visualizzato con un browser (preferibilmente FireFox) sia su Windows, che su Linux o su qualsiasi altro sistema operativo che supporti un browser in grado di eseguire JavaScript :

<html>
<head>
 <title>Javascript demo #1 - Emilio P.G. Ficara 2012</title>
</head>
<body>
<h1>scendiamo in campo...</h1>
<div id="campo" style="position:absolute; top:60px; left:40px;">
 <img src="img/campo.jpg">
 <div id="palla" style="position:absolute;">
  <img src="img/palla.png">
 </div>
</div>
<script src="demo1.js"></script>
</body></html>

Immagine di un disco

In questa pagina parliamo di immagini del disco…

Questo è un disco volante 🙂 e non ha niente a che vedere con quanto voglio descrivere.
Nonostante sia definito “disco”, quello di cui voglio parlare è un dispositivo di forma rettangolare.

I più smaliziati avranno notato la totale assenza di forme rotonde ; eppure… sono dischi.

Per “immagine del disco” si intende un file in cui è salvata una copia di TUTTO il contenuto di un disco, SETTORE per SETTORE, quindi non importa che tipo di file system sia installato, quante partizioni, quali. E’ una serie di blocchi di dati grezzi, messi insieme (per comodità) in un file che può essere utilizzato (con appositi programmi) per “clonare” su altri dispositivi un disco originale, rispettandone la struttura (partizioni con relativi file-systems) ed i dati contenuti. Uno strumento formidabile per trasferire via internet (o su supporti di memoria USB) un intero disco.

Parlando di programmi in grado di “trattare” questi files immagine, ce ne sono disponibili, spesso gratuitamente, su moltissimi siti internet e basta fare una ricerca con Google per avere l’imbarazzo della scelta. Io, dopo aver dato un’occhiata in giro, ho scelto Win32 Disk Imager perché è open-source (mi piace vedere cosa c’è dentro) e si è comportato benissimo nell’uso pratico. Il link al sito dove può essere prelevato è disponibile nella parte destra della pagina, sotto “links utili”.
ATTENZIONE !!! Questi programmi scrivono sul disco in maniera “cieca”, cioè se dite loro di scrivere il contenuto del vostro file immagine copia_di_disco.img sul disco C: , vi ritrovate SENZA PIU’ IL VOSTRO SISTEMA OPERATIVO, perché il disco C: , al termine delle operazioni, è diventato il “clone” di quello salvato a suo tempo sul file copia_di_disco.img . Triplo check, quindi, della lettera indicante il supporto di destinazione per la copia.
In genere queste operazioni sulle memorie flash si effettuano su chiavette USB o sui lettori interni di SD-Card del proprio Netbook / Notebook ; verificate BENE, quindi, quale lettera di unità sia stata assegnata dal sistema alla periferica. Qui sotto c’è la finestra del programma in esecuzione :

Potete vedere in alto a sinistra il nome del file, in alto a destra la lettera di unità e in basso i comandi. Write scrive il contenuto di un file .img sul disco (F: in questo caso) e Read legge dal disco e salva su un file (qualora voleste fare una copia di un vostro disco).

Un altro programma di cui avrete sicuramente bisogno (molti files .img sono zippati per risparmiare spazio) è 7Z (7.Zip), un’applicazione “open source” (come al solito) per compattare / scompattare files. E’ molto efficiente, apre praticamente qualsiasi tipo di archivio e si integra nella shell di Windows.
Se il prezioso tecnicismo “si integra nella shell” vi fa venire in mente solo una scena al distributore di benzina, allora mi correggo e dico: “il programma aggiunge se stesso al menù che viene fuori quando cliccate su un file con il tasto DESTRO del mouse”.
Il link per accedere al sito dove potrete scaricare il programma è, come al solito, nella colonna a destra della pagina, sotto “links utili”.

Update: a new program to rebuild the SPI flash memory contents

In my previous post here I proposed a program that was able to create the SPI flash memory contents for an Android tablet, starting from U-boot.bin and W-load.bin taken from FirmwareInstall folder of a working, original or modded, firmware rom. The previous program had a limit : the environment variables (and the boot script that is stored in the same space) were not used in the creation of the my-spi.bin output file, so when you re-program the SPI flash memory with the file produced by the old program, you must supply the needed instructions to upgrade the system via serial terminal.

Now, the new version adds the full environment variables and the necessary CRC32 code to the output file my-spi.bin, making the file much more useful and easy to use. Obviously, while in the first version you had to supply only two “input” files (u-boot.bin and w-load.bin), now you must supply a third: the env_uboot, that can be found on the FirmwareInstall/env/ folder or the usual, working, firmware distribution related to the tablet.

The instructions for use are exactly the same as for previous version, just add the env_uboot file in the program folder. As usual, the program was written in FreeBASIC and compiled under Win7. It doesn’t require installation, just unzip the downloaded file in a folder, and add the needed input files, then start the application…. that’s all. Hope this will be useful for someone 🙂

Download the zip file at this link.

The memory areas of the resultant my-spi.bin files are:

0x00000 to 0x5FFFF reserved for u-boot.bin
0x60000 to 0x6FFFF reserved for environment variables
0x70000 to 0x7FFFF reserved for w-load.bin

Remember to get the right w-load—.bin file from the FirmwareInstall folder.
Generally, in most of the tablets I’ve seen (but NOT in all), the right one has the string DDR3_700M_1066M_8bit_2_256MB in the filename. Obviously, when you copy this file in the application folder, you must rename it in w-load.bin, ‘cause the program looks exactly for that file name.

Gambas2 su tablet WM8650 9.7″ (prove)

Programmare in Gambas2 ( Basic visuale per Linux ) direttamente su un tablet cinese da 100 Euro ? Si può fare !

Nella foto, una applicazione di esempio, compilata quindi avviata, per il test della porta seriale ttyS0 del tablet ; mediante un’ interfaccia RS232 collegata al dispositivo, si trasmettono e ricevono dati con il programma HyperTerminal ( o qualsiasi altro terminale seriale ) su un PC Windows ( protocollo 19200,N,8,1 ). Funziona.! Cliccare sull’immagine per una visione ingrandita.

Backup your SPI flash memory on SD card (Wm8505 – Wm8650 tablets)

The most important thing to do before attempting to change / upgrade / modify the default firmware for a tablet (we speak about the WM8505 / WM8650 models), is to create a backup of the internal SPI flash memory. The internal SPI flash memory is the hearth of a tablet. If you can rewrite it with original contents, you can always restore your tablet to the original state.

I highly recommend, for anyone wants to play this “game” with his own tablet, to build a serial interface, that is a basic, but powerful, instrument to “look” inside a tablet. There are many interfaces available to convert the 3.3V signals, present in the tablet, to RS232 levels, and other cheap circuits that directly connect 3.3V true logic from the tablet to USB port, that is seen as COM port from a PC. I suggest to use my own design circuit proposed on my page at this link, ‘cause is powered by the tablet itself, so it doesn’t introduce any voltage in the device input lines when the device itself isn’t powered on. I have had problems, with direct USB to TTL interfaces, due to the presence of positive voltages on transmitting side of the interface even if the tablet was off. So, please, build my circuit (it works !), or use one similar…

In the oldest tablet I own, the Evodroid Devo, based on WM8505 processor, there isn’t any “dongle” for the USB / LAN / Serial. There is just a mini plug for USB, but the serial port is always present inside the tablet. So, opening the case, you can solder the 4 wires needed for a serial terminal connection on the 4 pads as in the picture below :

The TXD is intended as tablet TXD, so is the output from tablet, while RXD is obviously, the data input to tablet.

Using a terminal emulator and the RS232 interface, we can make huge amount of tests and experiments. I recently updated my PC serial terminal program for some problems encountered on WM8505 tablets. In the new version, available for download at this link , I added the sequence “+++” ; if you quickly type this sequence on your PC keyboard, the terminal sends a Ctrl-C plus a CR to the tablet, stopping the autoboot (as default, U-Boot automatically starts the Linux Kernel and Android OS that are stored on tablet’s mass storage NAND flash).

Note that, for storing a copy of the internal SPI flash memory, you must insert a FAT32 freshly formatted microSD card in the tablet’s slot !

Well, if you have the serial interface connected to your PC, launch the terminal program, then turn on the tablet. You will see the W-load and the U-Boot messages ; immediatly type on the PC the +++ sequence (or type Ctrl-C and Enter if using another terminal program)… After a while the U-Boot will stop writing the command prompt WMT # ; the autoboot has been stopped and you can execute commands from the U-Boot provided set. Note that the U-Boot versions are different from one tablet model to another, but many commands are always available, even with small syntax differences. Here, I will describe the backups done from a relatively new 9.7″ tablet based on WM8650 processor, and from old 7″ Evodroid tablet (the one shown in the picture).

The first command to enter is the MMC initialization (MMC is the default name for the SD card), so we must type :

mmcinit 0

 (0 selects the first SD card in wm8650 tablet, that has 2 SD cards capability)

or simply :

mmcinit

 (in wm8505 that has only one SD card available)

We receive some messages from the tablet ; if all is OK, the MMC (SD) has been initialized and is ready to operate. Remember to use a FAT32 formatted one !

Now, we type the command :

cp.b FFF80000 0 80000

that means : copy bytes from address FFF80000 (the start of SPI flash memory) to address 0 (the start of RAM) for a length of 80000 bytes (that is hexadecimal, as all the data supplied), so 80000 is 8 * 64K = 512K bytes, the size of the whole SPI flash.

This operation will take a couple of seconds… then we have a copy of the whole SPI flash stored in system RAM. Now, we can use the powerful command “fatstore” to save that area to a binary file on the SD card :

fatstore mmc 0:1 0 backup.bin 80000

This command means : store a file on FAT system device mmc (our SD card), on partition 0:1 (the card is freshly formatted, so has just one partition : card 0, partition 1), reading data from RAM address 0, to a file named backup.bin, for a length of 80000 (hexadecimal) bytes. Note that in the wm8650 tablet I havent had any problem to execute this command, but in WM8505 there was something wrong while writing the SD card. The solution, was (simply) to substitute the original 4GB SD card previously used, with another one, a little bit older, sized just 128 MBytes ! That card was VERY OLD, it was in my LG cellphone by many years. So, if you have errors, try with another SD card, freshly formatted, of different type, brand or size.

When this operation terminates with success, you have a copy of your SPI flash stored on the SD card. This 512KBytes file has the U-Boot.bin, the Env_uboot.bin and the W-Load.bin files all in one. You can expand in 3 different files using my software tool that can be downloaded from this link. The zip file contains just one executable written in FreeBasic ; it does not require installation ; just deflate it in a new directory and copy in the same folder the spi.bin file you want to split ; at end of the process you will have u-boot.bin, w-load.bin and env_uboot files in the same folder.

Obviously, you can simply use the full file spi.bin file with an SPI programmer in case of tablet “hard bricked”.

To turn off the tablet, type the command :

shutdown

or, if it isn’t recognized, simply press and hold the power button. Extract the SD card and read the contents with your PC. If you want, send the BIN file to my blog, using the file transfer form ; I will collect the different roms for future help requests… 🙂

Double the size of LocalDisk on Evodroid tablet (WM8505)

Hello, I purchased an old, used, working tablet based on obsolete processor WM8505. Why an obsolete model ? The reason is very simple : there is, on the internet, a full datasheet of the processor and good documentation, in general. When new products reach the market, they are still very technical, so well documented and simple to use. When it goes to be a business, the “commercials” come in and say to technicians : “you must hide all the infos and introduce some strange key to make impossible for anyone to look inside”. This is ‘cause the “commercials” are not able to produce ideas, they are able just to speak about things they can’t understand, and always have blinded vision of the future. Someone, any time, breaks the locks and looks inside,  ‘cause the “perfect lock” doesn’t exists. The result of this stupid behaviour is that the mankind is slowered and uses 20 years to reach the results that can be achieved in two. But the “commercials” are so happy, they sell and make big business. Absolutely haven’t a long view into the future.

Ok, I opened my tablet, just for look what’s inside. Here is a picture :

Just in the middle, you can see the “coreboard”, the hearth of the system, with the processor, the SPI flash with boot program, the ram, the oscillators and … the NAND FLASH ?  I can’t see the NAND flash, the “hard disk” of my tablet. Where is the NAND flash ?

ooooh, I found it, Is on a small board, hidden under the main board. But… there are only four wires ! Naaah, the NAND flash is a very common USB memory key ! That’s incredible, so the boot program in SPI flash is able to launch the system from an USB memory… VERY interesting !

I decided to disconnect the module from the tablet and wire it to a standard USB plug, in order to analyze it with my PC.

So, now I have an USB memory key with the hard disk of my tablet… Immediatly put in my PC and use the program Win32 Disk Imager, it’s open source, it’s simple, it works very well. I create a copy (img) of full pendrive and saved to disk for cloning on another USB memory key. Obviously, for using a standard usb memory key, I mounted a female usb plug in the tablet, using the 4 wires where was attached the original board. I used a 4GB memory key as destination of image file and tried to restart my tablet with such pendrive…

Ok, wires are connected, try to boot the tablet :

Uhmmm, animation starts, but continues “ad libitum” without starting the Android OS. There must be something wrong. Now, I extracted my pendrive and put it in another PC, running Puppy Linux. This is for a simple reason, Puppy Linux is my favourite “distro” and has the great GParted program, a powerful application to “look” inside disks and partitions. Inserting the pendrive, I discovered that has MANY partitions inside !

I see the main partition (the start) hasn’t the ‘boot’ flag. May be that’s the reason for tablet not starting ? Mmhh, let’s try to check. Modified the flags adding the ‘bootable’ to the first partition, then extracted the pendrive and tried again on the tablet…

WOW, now it works ! Ok, now, coming back to the Puppy Linux, I looked at all the partitions and the contents. First, the partitions list:

and now, the contents of each one : first SDB1

then, SDB5

then, SDB6

then, SDB7

and, finally, the SDB8

This is our “localDisk” ! Now, the original NAND flash was 2 GB and I have the new one that is 4GB, so i will resize the partition, using the GParted going from this situation :

to this new organization, filling all available space :

OK, all done. Now back again to the tablet and reboot. The led lights, the system starts…

And now, let’s go to measure how big is our LocalDisk 🙂

Wow… very good. Now, I can’t have an USB memory key attached to my tablet, so I opened the pendrive’s case and discovered that the small board inside is VERY similar to the original one…

So, I desoldered the USB plug and soldered the new circuit in place of the old one. All worked perfectly, tablet closed, disk space doubled.

 

Very simple wifi enhancement for tablet

Hello, my tablet has so many moddings… but when far from the router it has some difficulties to connect to the internet. So I soldered a 32 mm long enamelled wire at the base of printed CS antenna. The gain was more than aspected. Now I can connect from places where it wasn’t possible before.
Obviously, the enamelled wire must be “scratched” in the point where it’s soldered to the circuit. In this picture below you can see my version of this very basic antenna…
P.S. to the R.F. gurus : I know that this is NOT a clean way, but it works…

My camera works with one AA LiFePO4 cell

Hello, I own an old but efficient HP photosmart 447 camera. Normally, it works with 2 standard AA 1.5V cells. I love my camera, but has a defect : the batteries are discharged even if the camera is OFF. Ok, my first thought was to use 2 standard rechargeable AA Ni-Mh cells, but there is a problem… that cells are 1.2V, not 1.5V as the alkaline, and the camera works just for some minutes and after that shows the “purple screen of death” with the message “battery level insufficient to take a picture”. Ok I searched for 1.5V rechargeable cells. I found the new LiFePO4 batteries, widely used in the electrical byke and cars, and solar generators. Such batteries have many advantages and are quickly going to “invade” the market even for different applications. One single cell is rated for 3.2V Wow… I found one AA size, with 1000mA capacitance. Note that, as other Lithium based batteries, the nominal capacitance is NOT the maximum you can ask from your device. You can drain over TEN TIMES that capacitance, so if my camera needs (while the motor runs to put in or out the lens) for 2000 mA for a couple of seconds, the battery can supply it without any problem.

Now, the battery is 3.2V and my camera works (normally) with 2 batteries 1.5V, so a total of 3V. Any electronic device can accept a 10% overvoltage ! Now the problem is that the single AA battery is 3.2V, but in the camera we have place for 2 batteries… so I created a fake 0V battery using these materials :

Assembling the parts I had this result :

So, this is my 0V battery that placed in the camera together with the other AA LiFePO4 cell rated for 3.2V gives a total of… 3.2V :

Turned on the camera… ALL RIGHT. It works. Now I need for a charger for my new battery. I realized one in few minutes. This is a very basic one.. look at the schematic :

lampdiode

This circuit HASN’T any control, YOU are the controller. Measuring the voltage on the battery under charge, you MUST disconnect the charger when you read, with a voltmeter the voltage of 3.60V . Remember… YOU ARE THE CONTROLLER ! Here is a picture of the working circuit :

This is a slow charging circuit. You can find much more efficient and automatic controlled, but this is simple and can be built with real basic components. Consider that slow charging mantains the life of the battery for longer time. The LiFePO4 batteries have a typical life of 2000 (two thousands !) charges losing just the 10% of the capacitance. That’s incredible.

LAN connection without dongle on WM8650 tablet

When using a LAN connection with a tablet that hasn’t the RJ connector on-board, you can have some problem to gain the Heaven, ‘cause very often the “dongle” with the attached LAN cable detaches from the tablet, breaking all the connections (and probably your active work) and you, in such situation, may automatically start a sequence of @#@#@# and @@#@#@ that are not good to make points to your future “seat” up into the Sky.

So, what’s the simplest way to add an RJ connector to a tablet that hasn’t one ? It’s very simple : open the tablet and look for the transformer. Every tablet I’ve seen has all the circuitry inside, just the connector is outside, on the dongle. The transformer is the better place to solder wires, ‘cause has (usually) the pins spaced of 1.27 mm that is a measure easy to solder. In this picture, you can see one model of these transformers :

Even if your model is different, you will always have four small wires (look at the red arrows in the image) that comes from the “black bug” and go to the dongle’s socket. In my tablet’s specific case, the pins are named this way :

  • pin 16  RX + goes to RJ45 connector pin 6
  • pin 15  RX – goes to RJ45 connector pin 3
  • pin 10  TX + goes to RJ45 connector pin 8
  • pin  9   TX – goes to RJ45 connector pin 7

To clarify what are the positions of the pins on the RJ female connector / socket, here is a picture of the one that’s normally placed on the tablet’s dongle : note that the pin 1 is at the left ; the pinout suggested in the list above uses this standard.

Note that the pairs RX and TX are always “physically separated” (it’s a transformer !), so if in doubt when connecting a different type, consider that the TX and RX pairs are : one on a side, the other on the opposite. Also note that all the components on the circuit, needed for a correct ESD protection, are not mounted. It’s for sparing some money. In the practical use, if you just connect the tablet to a 1 meter cable tied to a router or another PC, you don’t need for it. Remember : you’re playing with very cheap devices. Anyway… soldering isn’t difficult, look here how I connected 4 wires of typical flat cable :

Not too difficult… and now, on the other side, I connected the RJ45 socket that will be used as tablet’s LAN connector. After testing the connection with success, use something like hot glue to make it “solid” and electrically insulated.

And finally, using a normal 1,5 meters LAN cable, I connected the tablet at my router and gained access to Google, as you can see in this final picture (note that wifi isn’t enabled !)

If you look a little bit deeply, you can see also other 2 cables coming out from the tablet… One is the serial port that actually is connected to IR led to work as remote control for my Sony TV, and the other is an USB female port, active and working (but unconnected in this picture), that I often use for my wireless KB / Mouse. Obviously… I hate tablet dongles 🙂

 

WM8650 tablet as remote control for Sony TV

Hello, here I am, again, with a simple mod for our tablets. In this picture you can see how it’s possible to control a TV set with our tablet using just one resistor and one IR Led ! In the picture you can see the tablet “dongle” (free of the plastic case) with the additional components needed. The circuit is the same proposed at point 3. of my article at this link (in Italian), just the led “color” is IR and the resistor is of lower value to gain some additional emitting “power”.

The IR led anode is directly connected to the 3.3V pad and the cathode to the resistor and this to the TXD pad ; the resistor value is 220 Ohm and must not be decreased in value.

Obviously, the distance you can reach with this small interface is very low, about 20 cm, but I will add in next days a driver circuit to make it working at longer distance. This is just a “proof of concept” (I like this definition).
At this link you can find the zipped APK file (the application) that I’ve written to test the device. Starting the application, you can see 12 buttons keyboard for entering the code to be transmitted, one “display” that shows what you type, and 2 other buttons: one is named “SEND” and simply transmits the IR code while you hold it down, and the other is named “QUIT”, to exit the application.

The program is compiled in debug mode, so without keys or locks. Deflate it from the downloaded zip and copy to sdcard of your tablet, then install it. Obviously, you must have the “unknown source” flag active.

The default command is 21 that in my Sony Bravia TV is the power-on / Power-off ; also test the numbers from 0 to 8 that are for changing channel from 1 to 9 ; for other commands, search on the internet for the Sony IR protocol.

Note: the program needs a small modification in init.rc file (you must be able to do this or the program will open with an exception error). In the init.rc command you MUST disable the console service.

this is the original:

## Daemon processes to be run by init.
##
#service console /bin/sh
service console /bin/login
    console

you must change it to :

## Daemon processes to be run by init.
##
#service console /bin/sh
#service console /bin/login
#    console

Obviously, this is a first try… so if there are errors, please, don’t shot me ! But give me your feedbacks and suggestions to improve it. Thanks