I need to generate pulses to create a frequency from my android device (to communicate to arduino via the audio jack, but this is not important).
Natively, java allows us to do that as explained here.
Unfortunately this is impossible to do via javascript, so I need to run this native code in my app through Javascript.
I'm a complete ignorant about "running Java from JS", so, can you suggest me a tutorial where to learn from, or help me somehow?
Asked
Active
Viewed 5,428 times
1

BenMorel
- 34,448
- 50
- 182
- 322
-
Take a look at [http://stackoverflow.com/questions/11609326/how-can-i-call-native-functions-in-phonegap-through-javascript/11610435#11610435](http://stackoverflow.com/questions/11609326/how-can-i-call-native-functions-in-phonegap-through-javascript/11610435#11610435) – leocl1 Sep 15 '13 at 09:06
1 Answers
2
You need to write an Android plugin for this, Phonegap Android Plugin is the phonegap API documentation for writing a plugin. You need to call your Android Plugin through JavaScript.
Here is a Sample PhoneGap plugin for Android

Ashok
- 1,251
- 11
- 19