Controlling Electromagnet Via USB
This may be overkill for what you want, but Microchip do an Accessory development starter kit for Android.



With that you can create anything you like to interface with your Android phone.  You can even use Arduino shields with it!

To this you would need to add something to actually drive the electromagnet.  You might like to check out the many tutorials online about interfacing motors and solenoids to the Arduino, as the same applies to this board.

Most commonly either a transistor, or transistor pair (known as a Darlington Pair) is used, depending on power requirements.  These are also available in an IC form, such as the popular ULN2003 chip with 7 Darlington Pairs in it.

I have created an Arduino shield that contains an 8-channel Darlington IC, the ULN2803, which you can etch yourself using Toner Transfer.  The details on it are here. 

Shameless self promotion there :)