The data input is my laptops touchpad, because sneaky elves have hidden my joystick/gamepad  !

At first I thought the keyboard & touchpad did not work, but it turns out they will emit data if the java app has "focus" - to have focus I started the old GUIService ...  Can't seem to get rid of the thing :P

Peppexhio

7 years 4 months ago

Hi GroG, how can I send data from my app Android (built with appinventor) to Python script on Mrl ? I have to send some number, not char.

Hi Peppexhio,

Any service exposes all its methods through the web api.  You can use http requests, or websockets.

This page describes it 

http://myrobotlab.org/content/myrobotlab-api 

You can also send parameters to the method python's   methodExec

This method takes an object array, so you it must be a POST and not a simple GET.

If Android appinventor can make a post - it should be possible.
The example below is done with Postman and will invoke a 2 parameter method called 'parm2' if defined in python.

e.g.

def parm2(p1, p2):
   print('p1 is ', p1)
   print('p2 is ', p2)