Tuesday, January 29, 2008

Android Radio Logger: The code is here

You may be wondering how to obtain incoming and outgoing voice and sms events data, mainly the phone number.
Well, finally you can download the code for this workaround from http://codtech.com/downloads/AndroidRadioLogger.zip
A quick and dirty solution, to keep you concentrated on the application being developed and not on how to hack android.

Run Radio Logger, and if you get the error

java.io.FileNotFoundException: /tmp/radio

don't forget to obtain a shell in the emulator running

adb shell

and once in the emulator prompt run

# cat /dev/log/radio > /tmp/radio & ### note the final ampersand

and eventually re-launch the Radio Logger application again.

When this application is running you will be able to see small notification windows at the bottom right of the screen indicating the GSM event detected, actually incoming and outgoing voice and sms, as is showed in the video. Other events should be easily added.

As always, comments are gladly welcome.

7 comments:

Gabor Paller said...

Another, more well-behaving approach:

http://mylifewithandroid.blogspot.com/2008/01/phonecalls.html

Diego Torres Milano said...

Definitely yours is a much more well-behaving approach and the only one that should be used in the future, when we have information about all the classes in for example android.telephony.gsm.
I'm only providing this as a workaround to the problem you've already mentioned of not being able to obtain the number until the state changed to IDLE.

Thanks for your comment.

I am you said...

For clarification - when you say 'incoming/outgoing voice and sms data' you are referring to just the number and not the media correct?

thanks for your work!

Diego Torres Milano said...

You are completely right, it's call data not media and intended for android pre 1.0.

Ena said...

could u forward me complete code for new sdk (1.0)..

Unknown said...

I m getting this error in shal prompt
plz help me

# cat /dev/log/radio > /temp/radio & ### note the final ampersand
cat /dev/log/radio > /temp/radio & ### note the final ampersand
cannot create /temp/radio: directory nonexistent
[7] Done(2) cat /dev/log/radio >/temp/radio

Unknown said...

could u forward me complete code for new sdk (1.0)..