Hello,

Yes this is possible.

First read here    :
http://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG


code samples are here :
http://www.gauntface.co.uk/blog/2010/04/14/using-android-headset-buttons-earphone-buttons/

Hope this help,
Fred

On 16 December 2012 22:50, Mark Murphy <[email protected]> wrote:

> I would assume that AudioRecord would handle that scenario, though I
> have not tried it:
>
> http://developer.android.com/reference/android/media/AudioRecord.html
>
> On Sun, Dec 16, 2012 at 5:40 PM, Caio Ricci <[email protected]> wrote:
> > I've done a lot of research on this, but I still don't understand it
> > completely. I want to use the audio jack to detect if this pedal, ( or
> any
> > other of these on off pedals) is pressed or not. I tried it on my Linux
> > machine and simply reading the sound card file I was able to see some
> input.
> > But I don't know how to do that on the device. I assume that it's
> possible
> > because i see things like the square reader(https://squareup.com/reader)
> and
> > what i'm aiming for is much simpler than that.
> >
> > I just don't know how to begin. Any suggestions?
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Här kan du ställa och svara på frågor om applikationsutveckling på
> Android: http://www.andglobe.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Sent from an Ubuntu Desktop.

Ubuntu Speech 
input<https://play.google.com/store/apps/details?id=com.nds.ubuntuspeechinput>is
now available on Google Play, along with Magnetic
Door Alarm 
app<https://play.google.com/store/apps/details?id=com.nds.magneticdooralarm>
.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to