I am working on an app for Android OS. There is one thing, I do not know how to do.
I need to send information to PHP web service (which I have created).
My question (first is easier, but I did not find any answer).
I have found somewhere this
HttpPost httppost = new HttpPost(address);
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
It works, because address includes the GET information. I would like to ask, how, or where to put $_POST information.
I mean, in PHP I will check if (isset($_POST[‘name’]) – so where to put that “name”??
I have one php where i am checking which post is set.
My second question is, I would like to send information to PHP web which is like Object.
Student student = new Student (String name, .. );
Class class = new Class(long id, String name, int floor, List<Students>);
I would like to send to php service the “class” object, which contains list of objects.
I was thinking, I can send the class attributes and than the list as some other post (just an array of students for example).
I don’t know much JSON, but I think, it will be something with it.
To answer your first question
add the variables and their values like this
got it.
Sorry but i don’t know the answer to the second question.. 🙁