Home Automation based on Arduino Ethernet shield, Arduino Uno using Android App

My project is Smart Room based on Arduino using android studio. Project scope is to control room appliances like fan, door, light. I have completed all the code as below and connected Arduino Uno with Arduino Ethernet shield. connection between android Studio and Arduino is thru IPV4 address of router. just for test I have connected A LED light with pin 9 and GND of Ethernet shield and tried to switch ON/OFF the light but dose not work. and there is no ERRORS while compiling both Arduino and ethernet shield.

Code for Arduino

#include <SPI.h>
#include <Ethernet.h>
#include<Servo.h>
//new #include<Servo.h>
// new Servo myServo
Servo myServo;

//light pin9
//fan pi22
//garage door pin24

// Set the MAC address
int pos=0;
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};
//78-31-C1-C5-3D-C8
// Set the IP address
IPAddress ip(192, 168, 1, 3);

// Start a server at port 80 (http)
EthernetServer server(80);

void setup() {

// Open serial communications
Serial.begin(9600);

// start the Ethernet connection and the server
Ethernet.begin(mac, ip);
server.begin();

// Pin 22 - 24 output (leds)
pinMode(22, OUTPUT);
pinMode(9, OUTPUT);

myServo.attach(24);
//new myServo.attach(24);

}

void loop() {
// Check if client connected
EthernetClient client = server.available();

if (client) { // If there is a client...
boolean currentLineIsBlank = true;
String buffer = ""; // A buffer for the GET request

while (client.connected()) {

if (client.available()) {
char c = client.read();// Read the data of the client
buffer += c; // Store the data in a buffer

if (c == '\n' && currentLineIsBlank) {// if 2x new line ==> Request ended

// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println(); // Blank line ==> end response
break;
}
if (c == '\n') { // if New line
currentLineIsBlank = true;
buffer = ""; // Clear buffer
}

else if (c == '\r') { // If cariage return...

if(buffer.indexOf("GET /?led2=1")>=0) { // If led2 = 1
digitalWrite(22, HIGH); // led 2 > on
}

if(buffer.indexOf("GET /?led2=0")>=0) { // If led2 = 0
digitalWrite(22, LOW); // led 2 > off
}

if(buffer.indexOf("GET /?led3=1")>=0) { // If led3 = 1 for light
digitalWrite(9, HIGH); // led 3 > on
}

if(buffer.indexOf("GET /?led3=0")>=0) { // If led3 = 0
digitalWrite(9, LOW); // led 3 > off
}

//new

if (buffer.indexOf("GET /?led1=1")>=0) {
for (pos = 0; pos < 105; pos += 3) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
if (buffer.indexOf("GET /?led1=0")>=0) {
for (pos = 105; pos >= 0; pos -= 3) // goes from 180 degrees to 0 degrees
{
myServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
// end new

//Read in the buffer if there was send "GET /?message=..."

if(buffer.indexOf("GET /?message=")>=0) {

if(buffer.indexOf("switch on the light")>=0) {
digitalWrite(9, HIGH);

}

if(buffer.indexOf("switch on the fan")>=0) {
digitalWrite(22, HIGH);
}

if(buffer.indexOf("open the garage")>=0){

for (pos = 0; pos < 105; pos += 3) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

if(buffer.indexOf("switch off the light")>=0) {
digitalWrite(9, LOW);
}
if(buffer.indexOf("switch off the fan")>=0) {
digitalWrite(22, LOW);

}

if(buffer.indexOf("close the garage")>=0){
for (pos = 105; pos >= 0; pos -= 3) // goes from 180 degrees to 0 degrees
{
myServo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

}

}

} //else closed

else {
currentLineIsBlank = false;
}
}
}
delay(1);
client.stop();
}
}