Connect Spark core with Android App made in Appinventor

HI Jozef

Sorry to hear you are still having trouble. I am also sorry for the delay in response.
Ok, lets get you started with this. Try flashing this firmware on your spark

//Initialize
define ON 1
define OFF 0

int Pin0 = D0; //Define your pin

int OUT1State = 0; //This variable maintains the current state of the Pin0

void setup() {
pinMode(Pin0,OUTPUT);

Spark.function("pin0", OUT0); //This is the function that gets executed when there is a matching API request

// Initialize low
digitalWrite(Pin1, LOW);

}

void loop(){ //nothing ot do here
}

int OUT0() {
if(OUT0State == OFF) {
//Make high
digitalWrite(Pin0, HIGH);
OUT0State = ON; // Out 0 set high
return 200; // This SHOULD be checked in the app
}
else {
digitalWrite(Pin0, LOW);
OUT0State = OFF; // Out 0 set to low
return 200; // This SHOULD be checked in the app
}

}

Now, you can call the pin0 function (which maps to OUT0) over the internet by making a HTTP post request using cURL or something similar. If you have mac, you can open a terminal window and test it out directly. The HTTP post request looks something like this:

"https://api.spark.io/v1/devices/CORE_ID/pin0 -d access_token=ACCESS_TOKEN"

Put values for CORE_ID and ACCESS_TOKEN

You cannot test this url using chrome as that's not how a post request is made. If you have a iphone, you can use iCURL app to do this. I have detailed the process here:

Hope this helps.