Android Question Sending Data From B4A to thingstospeak

microbox

Active Member
Licensed User
Longtime User
Hello everyone, just want to ask if it is possible to create an application on B4a that can send data to thingspeak? I'm aware that using arduino is possible but in my case I want to use my app B4A in sending data, I hope this can be possible.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

microbox

Active Member
Licensed User
Longtime User
I need to update the channel with a parameter, I tried this way
B4X:
nc2 = nc2+1 
job1.PostString("https://api.thingspeak.com/update?","api_key=JODU2H2LYNPU6XXX&field2= '"& nc2 & "'")
but no luck with the above code...the code below works
B4X:
job1.PostString("https://api.thingspeak.com/update?","api_key=JODU2H2LYNPU6XXX&field1=200")
Hope anyone can tell what I'm missing..

Thanks for the time,
microbox
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Try it this way if nc2 is just an integer.

B4X:
job1.PostString("https://api.thingspeak.com/update?","api_key=JODU2H2LYNPU6XXX&field2= "& nc2 )

Make sure that it is not a mistake that you used one time field1 (works) and field2 (does not work)
 
Upvote 0
Top