aanagan
aanagan

Reputation: 1

how to perform Android Call php function from server(10.0.2.2)?

With reference to this link open a url on click of ok button in android

i want to call php function in my xampp server by the builder button click "ok"

Upvotes: 0

Views: 1051

Answers (1)

Al Kafri Firas
Al Kafri Firas

Reputation: 333

Uri uri = Uri.parse("10.0.2.2/sth.php?runFunction=true");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

PHP:

<?php 
if($_GET["runFunction"] == true){
    myFunction();
}

function myFunction(){
    ...
}
?>

Upvotes: 1

Related Questions