Wednesday, March 12, 2008

Creating your own themes for Sony Ericsson K300i in Linux

First of all, Get some funny tux pictures from http://tux.crystalxp.net/en.cat.16.3.12.html.

Now get the tux.thm(or any other theme) from http://www.esato.com/logos/colour/k300themes.php?p=42

Ok , let’s check the theme file.

file tux.thm
tux.thm: POSIX tar archive
Oh.. It’s just a tar file ..Now Let’s untar it:

tar xvf tux.thm

background.png highlightSmall.png softkeys.png tabUnselected.png
desktop.png popupHighlight.png standby.png Theme.xml
doubleTitle.png popup.png status.png titleSmall.png
highlight.png popupTitle.png tabSelected.png

These files has a pre-defined sizes . It will be better to keep the size of
each image files as it will look good in the mobile.

Let’s peek into the Theme.xml file and see it’s structure.

<?xml version=”1.0″?>

<Sony_Ericsson_theme version=”3.0″>

<Author_firstname value=”Maxin”/>

<Author_url value=”153EE6″/>

<Background Color=”0xbbf7fb”/>

<Background_image Source=”background.png”/>

<Desktop Color=”0×153ee6″/>

<Desktop_image Source=”desktop.png”/>

<Desktop_title_text Color=”0xbbf7fb”/>

<Highlight_text Color=”0xbbf7fb”/>

<Highlight Color=”0×153ee6″/>

<Highlight_image Source=”highlight.png”/>

<Highlight_small_image Source=”highlightSmall.png”/>

<Popup_text Color=”0xbbf7fb”/>

<Popup Color=”0×153ee6″/>

<Popup_frame Color=”0xbbf7fb”/>

<Popup_highlight_text Color=”0×000040″/>

<Popup_highlight Color=”0xbbf7fb”/>

<Popup_highlight_image Source=”popupHighlight.png”/>

<Popup_image Source=”popup.png”/>

<Popup_scrollbar_background Color=”0×3cacff”/>

<Popup_scrollbar_slider Color=”0xbbf7fb”/>

<Popup_title_text Color=”0×000040″/>

<Popup_title Color=”0xbbf7fb”/>

<Popup_title_image Source=”popupTitle.png”/>

<Scrollbar_background Color=”0xbbf7fb”/>

<Scrollbar_slider Color=”0×0018b1″/>

<Softkeys_text Color=”0xbbf7fb”/>

<Softkeys Color=”0×153ee6″/>

<Softkeys_image Source=”softkeys.png”/>

<Standby_image Source=”standby.png”/>

<Standby_operatorname_text Color=”0xffffff”/>

<Standby_operatorname_outline Color=”0×000040″/>

<Standby_softkey_image Source=”softkeys.png”/>

<Standby_time Color=”0xffffff”/>

<Standby_time_outline Color=”0×000040″/>

<Standby_statusbar_image Source=”status.png”/>

<Tab_text Color=”0xbbf7fb”/>

<Tab Color=”0×153ee6″/>

<Tab_image Source=”doubleTitle.png”/>

<Tab_selected_image Source=”tabSelected.png”/>

<Tab_unselected_image Source=”tabUnselected.png”/>

<Text Color=”0×000040″/>

<Title_image Source=”doubleTitle.png”/>

<Title_small_image Source=”titleSmall.png”/>

<Title_text Color=”0xbbf7fb”/>

<Title Color=”0×153ee6″/>

<Wapbrowser_underline Color=”0×0000ff”/>

<Wapbrowser_tableborder Color=”0×0000ff”/>

</Sony_Ericsson_theme>

If you need to rename some of your files, then never forget to make change in this XML file too.. Otherwise, just replace the required files and don’t touch the XML file.. that’s safe if you are new to XML format :)

Now open the png image in GIMP and resize the image as that of the equivalent image in the theme.

Here the desktop.png file should be of size 128×110. You can resize your image in gimp by..

Image -> Scale Image ->
Then give Width as 128 and Height as 110

or just use the convert file if you want to write a shell script for the theme creation

convert -resize 128×110 source.png destination.png

This will take care of your resizing requirements :)

After that save that image as desktop.png .. Go on modifying these files till
you are satisfied.

Now create your theme by issuing this command.

tar cvf tux.thm *

Now let’s transfer the theme to K300i using the USB cable connected to our Gnu/Linux Machine.

obexftp –tty /dev/ttyUSB0 -p ./tux.thm Themes/tux.thm
Connecting…done
Sending “./tux.thm”…|done
Sending “Themes/tux.thm”… failed: Themes/tux.thm
(Don’t care the failed message.. )

Disconnecting…done

Save the theme in your mobile and apply it.. Now you have the cool tux theme in your mobile.

Posted by maxinbjohn at 05:48:53 | Permalink | No Comments »

Tuesday, March 4, 2008

Sending Linus.mp3 to K300i from Linux - The obexftp way

One of the most difficult things that I faced when connecting my Sony Ericsson K300i to the Gnu/Linux box was the difficulty in sending and receiving data from Linux to Mobile and vice versa. Today, I have managed to overcome that difficulty too.. Now my mobile is completely useful… (Atleast from the Gnu/Linux side :) )

First I need the obex installation in my system (Fedora core 6)
For that
yum install openobex

After the installation, connect the mobile phone using usb cable. Now dmesg shows that we have a new device called ‘/dev/ttyUSB0′.

Here are the following steps:

obexftp –tty /dev/ttyUSB0 -c . -l

This gives the following output..

Connecting…done
Sending “.”… failed: .
Receiving “(null)”… <?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE folder-listing SYSTEM “obex-folder-listing.dtd”>
<!–
XML Coder, May 24 2005, 21:06:32, (C) 2001 Sony Ericsson Mobile Communications AB
–>
<folder-listing version=”1.0″><folder name=”Pictures”/>
<folder name=”Sounds”/>
<folder name=”Themes”/>
<folder name=”Videos”/>
<folder name=”Other”/>
</folder-listing>
done
Disconnecting…done

Then download the Linus torvald’s voice

wget http://www.paul.sladen.org/pronunciation/torvalds-says-linux.mp3

Now push the mp3 to the mobile phone

obexftp –tty /dev/ttyUSB0 -p ./torvalds-says-linux.mp3 Sounds/linux.mp3

After about 5 seconds, your phone will prompt you to save the mp3 to phone memory. Now play the torvalds-says-linux.mp3
 
Now you have the voice of Linus in your mobile….. Cheers.. Wink

Posted by maxinbjohn at 08:58:25 | Permalink | No Comments »

Friday, February 22, 2008

Sony Ericsson K300i AT commands in Linux

I am always interested in using unconventional methods to control the mobile phone using linux. I found that the AT commands has immense potential to control the functioning of my K300i mobile. We can make phone calls, invoke apps and java applications in the phone, change the profile , enable or disable certain features like silent mode, read & send sms…… I have downloaded the AT commands list from http://developer.sonyericsson.com/getDocument.do?docId=65054 Now to send the AT commands, I need a terminal connection to phone. I love minicom, best terminal emulator in Linux. After connecting the k300i phone to the usb of the system using it’s usb cable, dmesg : usb 2-2: new full speed USB device using uhci_hcd and address 2 usb 2-2: configuration #1 chosen from 1 choice usbcore: registered new driver usbserial drivers/usb/serial/usb-serial.c: USB Serial support registered for generic usbcore: registered new driver usbserial_generic drivers/usb/serial/usb-serial.c: USB Serial Driver core drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303 pl2303 2-2:1.0: pl2303 converter detected usb 2-2: pl2303 converter now attached to ttyUSB0 usbcore: registered new driver pl2303 drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver Hmm .. the serial device is ttyUSB0… Then this should be the serial port setup in minicom : /dev/ttyUSB0 57600 8N1 Ok then I have configured minicom and logged on to K300i.. to check whether it is success or not , ATI K300 series OK It is OK.. or more than ok :).. the AT commads are working :) Then some more AT commands to test know more about it… Modifying the profile to enable alerts : AT+CVIB? +CVIB: 16 OK AT+CVIB=? +CVIB: (0-1,16) OK AT+CVIB=1 OK Profile Updated: HOME Modified … splashed on screen :) Showing the default language AT*ELAN? *ELAN: “en” Executing Java Apps T*EJAVA=? *EJAVA: 1 *EJAVA: 2,(1-4294967295) *EJAVA: 3,120 *EJAVA: 4,(1-4294967295) 0 Run a java application. The search path to the application must be provided in . 1 List installed java applications. No value on needed. 2 Delete a java application. The object id of the application must be provided in . 3 Install a java application. The search path to the application must be provided in . 4 Run an installed java application. The object id of the application must be provided in . *EJAVA: “Alert”,”Sun Microsystems, Inc.”,”1.0″,524298,10 *EJAVA: “Audio Player”,”Sun Microsystems, Inc.”,”2.0″,65542,6 *EJAVA: “Bouncing Ball”,”Sun Microsystems, Inc.”,”2.0″,196614,6 *EJAVA: “ChoiceGroup”,”Sun Microsystems, Inc.”,”1.0″,458762,10 *EJAVA: “Colors”,”Sun Microsystems, Inc.”,”2.0″,65541,5 *EJAVA: “Converter”,”Sony Ericsson”,”2.1.6″,65537,1 *EJAVA: “CustomItem”,”Sun Microsystems, Inc.”,”1.0″,65546,10 *EJAVA: “Darts”,”Sony Ericsson”,”0.0.3″,65538,2 *EJAVA: “Datagram Demo”,”Sun Microsystems, Inc.”,”1.0″,131083,11 *EJAVA: “DateField”,”Sun Microsystems, Inc.”,”1.0″,196618,10 *EJAVA: “FiveStones”,”Sony Ericsson Mobile Communications AB”,”1.2″,65539,3 *EJAVA: “FontTestlet”,”Sun Microsystems, Inc.”,”2.0″,327685,5 *EJAVA: “Gauge”,”Sun Microsystems, Inc.”,”1.0″,589834,10 *EJAVA: “HelloMIDlet”,”Vendor”,”1.0″,65548,12 *EJAVA: “Http”,”Sun Microsystems, Inc.”,”2.0″,393221,5 *EJAVA: “List”,”Sun Microsystems, Inc.”,”1.0″,393226,10 *EJAVA: “ManyBalls”,”Sun Microsystems, Inc.”,”2.0″,131077,5 *EJAVA: “Mascot Capsule V3 Demo”,”Hi Corp.”,”2.0″,65543,7 *EJAVA: “Mix Demo”,”Sun Microsystems, Inc.”,”2.0″,131078,6 *EJAVA: “PhotoAlbum”,”Sun Microsystems, Inc.”,”2.0″,65545,9 *EJAVA: “Properties”,”Sun Microsystems, Inc.”,”2.0″,458757,5 *EJAVA: “PushPuzzle”,”Sun Microsystems, Inc.”,”2.0″,131076,4 *EJAVA: “Socket Demo”,”Sun Microsystems, Inc.”,”1.0″,65547,11 *EJAVA: “Start”,”Sony Ericsson Mobile Communications AB”,”2.1.4″,65544,8 *EJAVA: “Stock”,”Sun Microsystems, Inc.”,”2.0″,262149,5 *EJAVA: “StringItem”,”Sun Microsystems, Inc.”,”1.0″,655370,10 *EJAVA: “TextBox”,”Sun Microsystems, Inc.”,”1.0″,327690,10 *EJAVA: “TextField”,”Sun Microsystems, Inc.”,”1.0″,262154,10 *EJAVA: “Ticker”,”Sun Microsystems, Inc.”,”1.0″,131082,10 *EJAVA: “Tickets”,”Sun Microsystems, Inc.”,”2.0″,196613,5 *EJAVA: “TilePuzzle”,”Sun Microsystems, Inc.”,”2.0″,65540,4 *EJAVA: “WormGame”,”Sun Microsystems, Inc.”,”2.0″,196612,4 To execute the Darts game in the mobile , type: AT*EJAVA=4,65538 and viola, I got to see the Darts game start executing in the phone :)
Posted by maxinbjohn at 05:24:00 | Permalink | No Comments »

Friday, February 8, 2008

Completing the circle of J2SE, J2ME and J2EE..

   I am happy to inform you all that my Sony Ericsson K300i now contains an application written by Me …. It is just a simple application created using the Netbeans with Mobility Pack. My gui application (FirstGUI) contains some text labels, one picture of a car and a blinking text part … Just like a hello world application just tell the whole world that I have got another computer to run my applications (or in technical words, J2ME application which runs on the MIDP 1.0 and CLDP 1.0 based JVM which runs on my  K300i mobile phone).
 Those who wish to run custom mobile applications in their mobiles can mail their requests to me from now onwards ….  The only sorrow that I have at present is that I had do all the development in the Windows XP. Presently if I want to run the Sony Ericsson Development suite on Linux, I need to use wine, which is again a dependency on Windows. So I have developed this application in Windows itself.  The  JAD s and JARs created by the Netbeans were transferred to the mobile using the Sony Ericsson USB adapter cable and software running Windows OS Cry

But I don’t wish to be depended on Windows…  My Mobile application development and deployment will be in Linux .. very soon …. This seems to be a promising link in that direction (http://developer.sonyericsson.com/thread.jspa?threadID=24249).

Posted by maxinbjohn at 07:02:05 | Permalink | No Comments »