Share My Creation 42Nurses - WebView HTML Form For Machine/Robot Control & Home Automation... Now Includes Voice Recognition

Hello Everyone

I believe this is only my second post and I have come here to contribute :)

Before I contribute, please allow me to say thank you to Erel for his [B4XPages] Bluetooth Chat Example, because without it, my contribution would not be possible. His example can be found here: https://www.b4x.com/android/forum/threads/b4xpages-bluetooth-chat-example.119014/

Now for the details... Ahhhh.... I will just summarize it :) Basically I took his chat example and added a WebView, along with WebViewExtras. In the WebView, I have an HTML form, supported and validated with JavaScript. Within the JavaScript, I utilize the member CallSub from the WebViewExtras library, to pass data back to the B4A app.

By altering the HTML, the HTML form, and the JavaScript, as well as perhaps adding additional CallSub calls, many things can be achieved and controlled with this example, very easily. It is intended for Bluetooth communication. I am using something very similar to this example application, to send commands to an RN-42 Bluetooth module, which passes those commands onto a Parallax Propeller uC, for machine control, and it does the job perfectly (so far :) ).

Anyhow, check it out, because it may help you find a solution. 42Nurses = RN-42 :)

EDIT: Please download the example in the following post, because it is better :)
 

Attachments

  • 42Nurses.zip
    13.5 KB · Views: 289
Last edited:

clueless

Member
Here is an updated version. I did not like the HTML source code to be included in the ControlPad.bas source code, so I added the HTML source code to the app as a file, named "source.htm", with the Files Manager. I then removed all the HTML source code from the "ControlPad.bas" file and altered my call to WebView.LoadHtml to the following:

B4X:
WebView1.LoadHtml(File.ReadString(File.DirAssets, "source.htm"))

So now the HTML code and file can be edited as a completely different entity.

EDIT: Please download the example several posts down instead of this one. Why? Because it is better :)
 

Attachments

  • 42Nurses.zip
    13.7 KB · Views: 257
Last edited:

clueless

Member
Once again, thank you Erel, but this time I thank you for your "Voice Recognition Example", which can be found here: https://www.b4x.com/android/forum/threads/voice-recognition-example.7317/

I have now added voice recognition to the 42Nurses example application, which entailed adding another CallSub from the WebViewExtras library, in the JavaScript and adding another HTML source file, as well as some other miscellaneous stuff. Of course the voice recognition part of this example is contingent upon your device being able to support it.

In operation, your voice is transformed into a text string, and then this text string is transmitted via Bluetooth :)

I hope you like the possibilities :)
 

Attachments

  • 42Nurses.zip
    15.1 KB · Views: 289
Top