-3

I am trying to build app that help to post data to government site so that it will be easy for all.I am posting data form android phone but I think data does not get posted there. If there is empty page loaded then it gives message that Page has Expired. Can any body help? I can reward you if it succeeds. Its my emergency project.

Page url- "webrecharge.ntc.net.np"
posting url "http://webrecharge.ntc.net.np/Result.jsp"

Android posting code is

  String postData =
                    URLEncoder.encode("servicetype", "UTF-8") + "=" + URLEncoder.encode((params[0]), "UTF-8") + "&" +
                    URLEncoder.encode("mdn", "UTF-8") + "=" + URLEncoder.encode((params[1]), "UTF-8") + "&" +
                    URLEncoder.encode("pinno", "UTF-8") + "=" + URLEncoder.encode((params[2]), "UTF-8") + "&" +
                    URLEncoder.encode("captext", "UTF-8") + "=" + URLEncoder.encode(params[3], "UTF-8");

But i think it does not post properly. THanks

  • Try posting the data to your own hosting server first and check if the data is being posted successfully. or you can also post the data to localhost using emulator and localhost server on your computer. Lemme know if you face any issue performing these tasks. – TutorialsBee Apr 30 '17 at 08:12
  • yes the exact post method worked for user loggingIn in my website, The work here is of session I guess. Can you tell me some other ways> – hamrodoko1 doko Apr 30 '17 at 12:52
  • Yes you can create a session. Please check this out: http://stackoverflow.com/questions/11713926/using-php-sessions-with-my-android-application-to-login – TutorialsBee Apr 30 '17 at 14:40
  • Please upvote the comment if it helped :) – TutorialsBee Apr 30 '17 at 15:33

1 Answers1

0

Try this and letme know if it helps you

 BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(o, "UTF-8"));

        String postData = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(email, "UTF-8");
        writer.write(postData);
  writer.flush();
        writer.close();
        o.close();
        backresult = "";
      ...