1. Download our Official Android App: Forums for Android!

Apps Please help, login to https webside..

Discussion in 'Android Development' started by Lucius1972, Sep 21, 2011.

  1. Lucius1972

    Lucius1972 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Sep 21, 2011

    Sep 21, 2011
    2
    0
    5
    Hi all,

    I am trying to login to the followig webside https://access.kpn.com/CAUT/AuthenticationServlet.
    I already searched different forums but i can`t seem to get to work, could somebody please help me?

    Here is my code so far:
    Code (Text):
    1.  
    2.  
    3. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public
    4. [/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] AndroidLogin [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extends[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Activity [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]implements[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] OnClickListener {[/SIZE]
    5.  
    6. [LEFT][SIZE=2]Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ok[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]back[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]exit[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
    7. [SIZE=2]TextView [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
    8. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]url[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
    9. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String [/SIZE][U][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]password[/COLOR][/SIZE][/COLOR][/SIZE][/U][SIZE=2];[/SIZE]
    10. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Object [/SIZE][U][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]cookies[/COLOR][/SIZE][/COLOR][/SIZE][/U][SIZE=2];[/SIZE]
    11. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][U][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]isAuthenticated[/COLOR][/SIZE][/COLOR][/SIZE][/U][SIZE=2];[/SIZE][/LEFT]
    12.  
    13. [LEFT][SIZE=2][COLOR=#3f5fbf][SIZE=2][COLOR=#3f5fbf]/** Called when the activity is first created. */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f5fbf]
    14. [/COLOR][/SIZE][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#646464]
    15. [/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreate(Bundle savedInstanceState) {[/SIZE]
    16. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].onCreate(savedInstanceState);[/SIZE]
    17. [SIZE=2]setContentView(R.layout.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]main[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
    18.  
    19. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Login button clicked[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    20. [/COLOR][/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ok[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (Button)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]btn_login[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
    21. [SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ok[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE][/LEFT]
    22.  
    23. [LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (TextView)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]lbl_result[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
    24.  
    25. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    26.  
    27. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] postLoginData() {[/SIZE]
    28. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Create a new HttpClient and Post Header[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    29. [/COLOR][/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]url[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"https://access.kpn.com"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE][/LEFT]
    30.  
    31. [LEFT][SIZE=2]HttpClient httpclient = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] DefaultHttpClient();[/SIZE]
    32. [SIZE=2]HttpPost httppost = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] HttpPost([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]url[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"/CAUT/AuthenticationServlet"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE][/LEFT]
    33.  
    34. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Add user name and password[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    35. [/COLOR][/SIZE][SIZE=2]EditText uname = (EditText)findViewById(R.id.[/LEFT]
    36. [/LEFT]
    37. [/SIZE][LEFT][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]txt_username[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
    38. [LEFT][SIZE=2]String username = uname.getText().toString();[/SIZE][/LEFT]
    39.  
    40. [LEFT][SIZE=2]EditText pword = (EditText)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]txt_password[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
    41. [SIZE=2]String password = pword.getText().toString();[/SIZE][/LEFT]
    42.  
    43. [LEFT][SIZE=2]ArrayList<BasicNameValuePair> pairs = [/SIZE][B][U][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/U][/B][U][SIZE=2] ArrayList()[/SIZE][/U][SIZE=2];[/SIZE]
    44. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"username"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], username));[/SIZE]
    45. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"password"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], password));[/SIZE]
    46. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"destination"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]url[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"/Exchange/"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    47. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"flags"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"0"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    48. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"SubmitCreds"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Log+On"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    49. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"forcedownlevel"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"0"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE]
    50. [SIZE=2]pairs.add([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BasicNameValuePair([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"trusted"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"0"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]));[/SIZE][/LEFT]
    51.  
    52. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE][/LEFT]
    53.  
    54. [LEFT][SIZE=2]UrlEncodedFormEntity p_entity = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] UrlEncodedFormEntity(pairs);[/SIZE][/LEFT]
    55.  
    56.  
    57. [LEFT][SIZE=2][COLOR=#3f5fbf][SIZE=2][COLOR=#3f5fbf]/** Assign the POST data to the entity */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f5fbf][/LEFT]
    58. [/COLOR][/SIZE]
    59. [LEFT][SIZE=2]httppost.setEntity(p_entity);[/SIZE][/LEFT]
    60.  
    61.  
    62. [LEFT][SIZE=2][COLOR=#3f5fbf][SIZE=2][COLOR=#3f5fbf]/** Perform the actual HTTP POST */[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f5fbf][/LEFT]
    63. [/COLOR][/SIZE]
    64. [LEFT][SIZE=2]HttpResponse response = httpclient.execute(httppost);[/SIZE][/LEFT]
    65.  
    66. [LEFT][SIZE=2]HttpEntity [U]entity[/U] = response.getEntity();[/SIZE][/LEFT]
    67.  
    68. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] status_code = response.getStatusLine().getStatusCode();[/SIZE][/LEFT]
    69.  
    70. [LEFT][SIZE=2]String str = inputStreamToString(response.getEntity().getContent()).toString();[/SIZE]
    71. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//Log.w("SENCIDE", [U]str[/U]);[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
    72. [/COLOR][/SIZE]
    73. [LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText(str); [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// show result[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
    74. [/COLOR][/SIZE]
    75. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]cookies[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = ((AbstractHttpClient) httpclient).getCookieStore();[/SIZE][/LEFT]
    76.  
    77. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (status_code >= 300) {[/SIZE][/LEFT]
    78.  
    79. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]isAuthenticated[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]false[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
    80.  
    81. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
    82.  
    83. [LEFT][SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE][/LEFT]
    84.  
    85. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]isAuthenticated[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
    86.  
    87. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE][/LEFT]
    88.  
    89. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    90.  
    91. [LEFT][SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (UnsupportedEncodingException uee) {[/SIZE][/LEFT]
    92.  
    93. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [U]Woops[/U][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
    94. [/COLOR][/SIZE]
    95. [LEFT][SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (IOException ioe) {[/SIZE][/LEFT]
    96.  
    97. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [U]Woops[/U][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][/LEFT]
    98. [/COLOR][/SIZE]
    99. [LEFT][SIZE=2]}[/SIZE][/LEFT]
    100.  
    101. [LEFT][SIZE=2]} [/SIZE][/LEFT]
    102.  
    103. [LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] StringBuilder inputStreamToString(InputStream is) {[/SIZE]
    104. [SIZE=2]String line = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
    105. [SIZE=2]StringBuilder total = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] StringBuilder();[/SIZE]
    106. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Wrap a BufferedReader around the InputStream[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    107. [/COLOR][/SIZE][SIZE=2]BufferedReader rd = [/LEFT]
    108. [/LEFT]
    109. [/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] BufferedReader([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] InputStreamReader(is));[/SIZE]
    110. [LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Read response until the end[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    111. [/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
    112. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]while[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ((line = rd.readLine()) != [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]) { [/SIZE]
    113. [SIZE=2]total.append(line); [/SIZE]
    114. [SIZE=2]}[/SIZE]
    115. [SIZE=2]} [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (IOException e) {[/SIZE]
    116. [SIZE=2]e.printStackTrace();[/SIZE]
    117. [SIZE=2]}[/SIZE]
    118. [SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Return full string[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
    119. [/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] total;[/SIZE]
    120. [SIZE=2]}[/SIZE][/LEFT]
    121.  
    122. [LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#646464]
    123. [/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onClick(View view) {[/SIZE]
    124. [B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](view == [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ok[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]){[/SIZE]
    125. [SIZE=2]postLoginData();[/SIZE]
    126. [SIZE=2]}[/SIZE]
    127. [SIZE=2]}[/SIZE][/LEFT]
    128.  
    129.  
    Thank you very much.
    Krgds,
    Lucius
    [/LEFT]
     

    Advertisement

  2. Lucius1972

    Lucius1972 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Sep 21, 2011

    Sep 21, 2011
    2
    0
    5
    Dear All,

    Is there no one who can help??
    If i execute my code, it only returns the html code of the login page.
    First i need to know how i can determine if i am logged in correctly.
    I can see that already many people asked about this, with the same issue on this forum but until now i could not find a solution.
    Is this realy such a difficult topic?

    Thank you in advance.
    Krgds,
    Lucius
     

Share This Page

Loading...