locked
Send response from Asp.net Page to Android application RRS feed

  • Question

  • User-1106261384 posted

    Hello All,

    I have created one aspx page which is called from android application successfully.

    I want to send a response of Boolean value back to the android application after processing some data from this aspx page. Currently it is showing the aspx page content like follows in android application as a response.

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Recharge App</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>

    </div>
    </form>
    </body>
    </html>

    Can any one help me on this?

    Thanks in advance.

    Tuesday, April 2, 2013 6:59 AM

Answers

  • User-1106261384 posted

    Thanks for your reply Danny117.

    I found the solution on - http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/

    This is the perfect example to call a aspx page from Android application and give response from aspx page.

    Its returning String value not the boolean, but solves my problem. Great Work by Steve Loper

    In this code instead of 

    Response.Headers.Add("AustinAndroidReturn","YourReturnValue")

    add follwing code

    if (response.containsHeader("AustinAndroidReturn"))
    strMessage=((Header)response.getHeaders("AustinAndroidReturn")[0]).getValue();
    else
    {
    strmessage = "No response";
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 3, 2013 9:18 AM

All replies

  • User1747761241 posted

    There are many ways android can interact with the web.  Two that come to mind that could receive a response from a asp.net web page are.

    1.  http client 
    2.  input stream on the url and a xmlpullparser

     

    Tuesday, April 2, 2013 7:35 AM
  • User-1106261384 posted

    Thanks for your reply Danny117.

    I found the solution on - http://steveloper.com/how-to-call-an-asp-net-web-page-from-android/

    This is the perfect example to call a aspx page from Android application and give response from aspx page.

    Its returning String value not the boolean, but solves my problem. Great Work by Steve Loper

    In this code instead of 

    Response.Headers.Add("AustinAndroidReturn","YourReturnValue")

    add follwing code

    if (response.containsHeader("AustinAndroidReturn"))
    strMessage=((Header)response.getHeaders("AustinAndroidReturn")[0]).getValue();
    else
    {
    strmessage = "No response";
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 3, 2013 9:18 AM