0

I am trying to post data to the server in the following manner from Android.

    Uri uri = Uri.parse(URL_STRING);
    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    startActivity(intent);

The URL_STRING when executed from the browser is posting the data. Through app it is not working. Where I am going wrong?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Sriram Nadiminti
  • 107
  • 2
  • 12
  • That is not posting data to server that is just opening a link using the browsers in the android device! – Xenolion Oct 28 '17 at 15:16
  • in the URL_STRING, I am constructing all the data required as well. In the same browser, if I manually enter the URL_STRING, it works. So I need a method to transfer the URL_STRING to the browser in such a way it opens the browser and later closes it. (The closing part is still not tried :-)) – Sriram Nadiminti Oct 28 '17 at 15:19
  • So it is the HTTP GET request??? – Xenolion Oct 28 '17 at 15:21
  • HTTP PUT request; a form with 4 fields and if entered in sequence, takes the data and records – Sriram Nadiminti Oct 28 '17 at 15:22
  • Found the solution. in https://stackoverflow.com/questions/5489086/open-an-url-in-android-browser-avoid-multiple-tabs. This way, solved both problems. This question can be closed. – Sriram Nadiminti Oct 31 '17 at 03:47
  • Congratz I am glad you solved the problem **Happy Coding!**. – Xenolion Oct 31 '17 at 09:35

0 Answers0