3

I've done quite a bit of searching on this but haven't found anything.

I have an idea for an app to control a device, that would need to connect through the headphone cable.

Is it possible to send signals through the headphone socket?

athor
  • 6,848
  • 2
  • 34
  • 37

2 Answers2

0

Arbitrary data can be played out audio jack using Media Player with a raw resource. The signal would be limited by the bandwidth of the particular device, for example between 20 Hz and 16 KHz.

David J. Liszewski
  • 10,959
  • 6
  • 44
  • 57
  • So would it be possible to control a slr camera like this? I.E my Canon uses a 2.5mm jack for the remote shutter – athor Dec 02 '10 at 04:34
0

use AudioManager

AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);

http://developer.android.com/reference/android/media/AudioManager.html

Then you can setWiredHeadsetOn(true) or if it won't work play with setMode

Alex Volovoy
  • 67,778
  • 13
  • 73
  • 54