Friends... I have an idea to attach the compass sensor (HIMC5883L) with my android smartphone using arduino, but I don't clearly know how to do this. I mean I want to make an OTG compass for smartphone for map navigation etc.(Many Smartphones have compass but mine have not). If anyone had do this or know how to do this, please guide me. Thanks!
A cheaply available USB OTG adapter cable (ask eBay) will connect the Arduino to the phone.
You can then connect the compass sensor to your Arduino and write a sketch to retrieve the data from it and send it through the USB serial connection.
Then you need to write some software for the phone to receive and interpret the serial data and display it as a compass. That is unless you are happy just to have a simple text display (like the Arduino's Serial Monitor) with the compass information showing in it, in which case there is off-the-shelf software that would do that (search Play)