arduino android ethernet shield

Hello

Where can i find some goodinstruction for implementing a android app with arduino/ethernetshield?

Just want to send a post html towards the arduino to activate some I/0.

The read the post, this i already tried this with the streaam functions in.arduino, and this looks fine. But to send the post html.... I tried some examples but no luck sofar...

Well, you probably could run web server code on the arduino and supply a page to the android browser that has post html in it. Any reason you want to make a POST request to the arduino instead of a GET request?

hello,

see arduino small test program to handle the POST request from a webpage. I didn’t test the header, because i receive twice a header from the page and icon…

I just want to create a android small app that can send the same post data towards the arduino…
i also included the android file, but it seems that it isn’t correct because the program terminate just before it start the post execution…i got this from the next site Android HTTP POST & GET Example

thx…

public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

}

public void onClickSendButton(View view){

Button kurt =(Button) findViewById(R.id.SendButton);
kurt.setText(“aaa”);
sendhttp();
//finish();
}

//@Override
private void sendhttp(){

HttpClient httpclient = new DefaultHttpClient();

HttpPost httppost = new HttpPost(“192.168.1.100”);
try {

List nameValuePairs = new ArrayList(2);

nameValuePairs.add(new BasicNameValuePair(“pinD8”,“1”));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

HttpResponse response =
httpclient.execute(httppost);
}

catch (ClientProtocolException e) {

}
catch (IOException e) {

}
}
}

Serving_Web_Pages_Using_Forms_Post_Kurt_03_02_2015.ino (3.39 KB)

Kurtwerbrouck:
Where can i find some goodinstruction for implementing a android app with arduino/ethernetshield?

Just want to send a post html towards the arduino to activate some I/0.

All Android phones have a WWW browser by default.

So you can easily use your WWW browser as "the app" of your choice for the Android phone!

And you can use a "web server" code for the Arduino.

I think the code from this page will do the job.

Unfortunately the author of that 'instructables' has created a program that will run on an Arduino "MEGA 2560" board only, because he wastes a lot of RAM.

Are you planning to use an Arduino MEGA?
Then you can use the code from that page directly.

Otherwise (for an UNO or so) you'd have to change the code a bit.