so, i've made html page contains two radio buttons named on and off below:
<input type="radio" name="args" value="on">turn led on. <input type="radio" name="args" value="off">turn led off.
and, below 2 buttons submit button code is:
<input type="submit" value="do it!">
this simple setup inside form, code is:
<form action="https://api.particle.io/v1/devices/your-device-id-goes-here/led?access_token=your-access-token-goes-here" method="post">
please ignore url put in there.
so, is, when select radio button corresponding on, , hit submit(named : it!), turns on led on particle photon.
so want is, make android app follows:
1) create two buttons 1 on , 1 off
(i can create them in xml using android studio , know java part, not know how combine html , java part)
2) when of buttons pressed, corresponding command should passed url, , on doing so, particle photon device act accordingly.
note using post in html
well, can achieve same result implementing web page directly in board (like arduino , on).
if want use android app shouldn't use html page, should develop app sends html post (or it) server. in case, suggest using json format. in simple guide wrote find details how implement app turns on , off remote led connected arduino. more or less looking for. hope helps you.
Comments
Post a Comment