Sunday, January 01, 2006

The problem with Sony MP3 players is that the software is not intuitive and buggy. The Disc2Phone application included with my Sony Ericsson W800i fails to copy audio tracks to the phone properly. I was looking for a way to use Winamp or iTunes to manage the MP3s on the phone. As it turned out, I was able to do it with iTunes. 

I was able to wrap it all up in a small C# program. Download it from here . Update : this now also deletes files on the phone that are not in the play list, keeping it completely in sync. It only deletes files inside the MP3 directory, so dont put anything else in there :)

Instructions:
1. Install all of the requirements.
2. Download the setup and install.
3. Start iTunes, if it is not started the program will start it for you, but be patient.
4. Select the playlist you want to synch with the phone. It is better to create a new playlist like "W800i List" and add your tracks to this.
5. Click on the Synch button to start synchronising.
6. This takes a while. You can speed up the copy process by using a Memory Stick reader, which is faster than going through the USB data cable. Take the memory stick out of the phone, put it in the reader, plug the reader in and synch.

Disclaimer: Use the program at your own risk. This program is un-supported and I will not be held for any damages, liabilities, warranties, natural disasters and if your dog eats it. However, feel free to report bugs and features.

Requirements:

.Net 2.0 Framework
iTunes 6.0

How it all works

When plugged in to the computer,the phone is bacially a Mass Storage Device just like any other USB flash drive. The Memory Stick on the phone contains a directory "MP3". All that needs to be done is to copy the MP3s to this folder. Use the System.IO.DriveInfo.GetDrives() method of the DriveInfo class in .Net 2.0  to get an array of DriveInfo objects representing all the drives on the computer. Iterate through this array to check for removable drives using the DriveInfo.DriveType property and then check for drives that have a "MP3" directory in the root. Use the DriveInfo.IsReady to check if the removable disc is ready.

The next step is to copy only the MP3s in a specific iTunes playlist. iTunes has an exellent COM interface. To program against this in C#, add a COM reference to the "iTunes 1.6 Type Library". iTunes is started by;

itunesApp = new iTunesAppClass();

Use the iTunesAppClass to get the collection of playlists;

playlistCollection = itunesApp.LibrarySource.Playlists;

You can then get a specific playlist, like the playlist you want to synch the phone with;

playListToSynch = playlistCollection.get_ItemByName("W800i");

The playlist will have a collection of IITFileOrCDTrack objects. Each IITFileOrCDTrack object has  Artist,Album and Location properties. The Location property gives the physical location of the audio track on the computer. This is used to copy the track to the phone. Iterate through the tracks in the playlist and copy the files to the phone. Thats all there is to it. With this technique it is possible to use iTunes with other USB type devices that play MP3's.

The next step is to improve the synch functionality, right now it is just a one way copy process. Update : This functionality is now included. 

 

Sunday, January 01, 2006 10:51:49 AM (GMT Standard Time, UTC+00:00)  #    Comments [8]  | 
 Friday, December 30, 2005

This should apply for the K750i as well. The w800i phone has a built-in POP email client. GMail uses SSL for both POP and SMTP e-mail transfers.  The w800i has support for SSL/TLS in its mail client.

However, the phone does not come with two root certificates required to get Gmail to work. Gmail uses two different certificates on pop.gmail.com and smtp.gmail.com, and each of these certificates are issued by two certification authorities. The trick to get gmail to work is simply install the root certificates of these two CAs. These are Thawte and Equifax.

To get the root certificates, open the Certificates manager in Windows XP or 2000 ( open a blank Microsoft Management Console , by typing mmc at the command prompt, and then add the Certificates snap-in). In the certificates tree, under Trusted Root Certification Authorities , find the certificate for Equifax Secure Certification Authority and Thawte Premium Server CA.

Now, export each of these certificates in turn as a DER encoded binary X.509 certificate. Send these two files via a bluetooth or infrared link (does not work when the files are copied using file manager ). The phone will prompt to accept the certificates and you are good to go :).

Gmail also has a mobile interface at http://m.gmail.com, but this is not good enough to compose emails.

Friday, December 30, 2005 6:23:18 PM (GMT Standard Time, UTC+00:00)  #    Comments [5]  | 
 Wednesday, December 28, 2005

While working with the System.Timers.Timer class last week, I found that the timer_elapsed method is not synchronized, i.e the event is fired without waiting for the completion of the previous invocation.

Say for example you have a method that pulls up the latest records from a table and do some processing. The timer event can fire while you are doing this processing and have still not marked the records as processed. The safe way is to wrap the code in the timer_elapsed event inside a lock statement.

Wednesday, December 28, 2005 10:36:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Sunday, December 04, 2005

I was reading a blog post on blogs.msdn.com about why each version of VS is tied to a version of the runtime, and the reasons why multiple versions of the runtime are not supported. Anyways I can't find the link :).

For VS 2005, an add-in is under development to build under 1.1.  Targetting the latest version of  .Net is viable for server side projects (ASP .Net etc..). However, for client applications this is not always possible.  The majority of Windows computers will now have the 1.1 Framework, so applications can be deployed without worrying too much about distributing a 20 MB runtime. It will probably take about 6 months to a year for the same thing to happen to the 2.0 Framework. Untill then, those developing for 1.1 are still stuck with an IDE that rewrites code, makes controls disappear and other magical stuff that makes one tear their hair out.

On the same topic, where can I find statistics on what percentage of Windows machines have what version of the runtime. Internet Explorer sends the .Net version on the UA string, so it might be possible to measure the usage of 2.0 versus 1.1 This should be easy for MS to pull up from their web server logs and publish the stats :)..

 

Sunday, December 04, 2005 10:57:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Monday, November 21, 2005

I now work for 4D Telecom. Today was my first day at work, and the better part of the day was spent getting the grand tour and getting introduced to almost everyone (and the server room). The rest of the day was spent trying to figure out some code written for a IVR (Interactive Voice Response System). My co-workers are varied, unlike the pure developers only environments I've worked in before.

More later...

Monday, November 21, 2005 8:00:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Friday, November 11, 2005

For all of you ( like me) who were frustrated a bit with the new web project system in VS 2005, this add-in resolves some of those issues.

This uses creates a Msbuild  file to give more fliexibility with deploying web projects.

Single assembly for the whole app, with a name of your choice, versioning, assemblies for each directory. Anyways, much more control over the build process.

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

Friday, November 11, 2005 10:19:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
 Thursday, November 10, 2005

Via http://blogs.msdn.com/jomo_fisher/archive/2005/04/22/410903.aspx

(1)   Copy this MSBuild targets file to “C:\program files\msbuild\CrossCompile.CSharp.targets

(2)   Create a new C# project somewhere called MyApp.

(3)   Use notepad to edit MyApp.csproj. Replace the entire <Import> tag with

  <Import Project="$(MSBuildExtensionsPath)\CrossCompile.CSharp.targets" />

(4)   When prompted, reload the project. You’ll have to answer a security dialog.

(5)   In VS, click the drop-down that says ‘Any CPU’ and select ‘Configuration Manager’

(6)   Under Active Solution Platform, select <New…>

(7)   Select ‘.NET 1.1’ (pretty cool, eh?) and press OK.

(8)   Build and notice error about System.Collections.Generic. This means its working because generics aren’t supported in 1.1.

(9)   Open Program.cs and delete the line:

using System.Collections.Generic;

     And rebuild.

Thursday, November 10, 2005 6:17:06 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Tuesday, November 01, 2005

and removing it kills Windows.

From the Register,

"Sysinternals' Mark Russinovich has performed an analysis of the copy restriction measures deployed by Sony Music on its latest CDs: which he bluntly calls it a 'root kit'. Using conventional tools to remove Sony's digital media malware will leave ordinary users with a dead Windows systems.

While the Sony CDs play fine on Red Book audio devices such as standard consumer electronics CD players, when they're played on a Windows PC the software forces playback through a bundled media player, and restricts how many digital copies can be made from Windows."

Avoid Sony CDs.. if you can.. scary stuff.

Tuesday, November 01, 2005 12:12:46 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |