×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    159

    facing some problem during getting the httpconnection response

    hi..I am working on nokia sdk2.0 using lwuit1.5 .now my problem is that when i start my aap control goes to webservice i used the following code for getting url hit response
    Code:
     String url="http://tandonindia.com/check.php?user=1";
                 HttpConnection httpConnection = (HttpConnection)Connector.open( url.trim() );
                 int code=httpConnection.getResponseCode();
                 System.out.println("code............"+code);
    when control comes to second line in code a dialog open for permission "yes " and "no "

    when i select no my app does't update. After this i use refresh code in my aap when i select refresh button
    same above code is used ,when control comes to second time no dialog open for permission that time it gives the "NO" response by default...
    please help me why control does't create permission dialog second time also...

  2. #2
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: facing some problem during getting the httpconnection response

    Hi

    AFAIK , Thats how J2ME works.If you deny a permission once, it will assume that the permission is denied all the time till the app is restarted.If you want to get a confirmation from the user whether to access net or not, do it via code yourself.The permission dialog is not suited for that.The user should always click yes in that.

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    686

    Re: facing some problem during getting the httpconnection response

    Just to add to the point mentioned above, you can try/catch the SecurityException that is being thrown when you are trying to connect to your webservice and notify the user that the app needs internet to work and if he clicked No then internet will not work until he restarts the app or something like that.
    Heard of DVLUP? Join here

  4. #4
    Registered User
    Join Date
    May 2013
    Posts
    159

    Re: facing some problem during getting the httpconnection response

    thanks for reply

Similar Threads

  1. How to restrict httpconnection response data?
    By maniohile in forum Mobile Java General
    Replies: 3
    Last Post: 2011-04-12, 09:48
  2. There's no response from server using HttpConnection
    By lisabel in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-01-20, 22:19
  3. No Response-Data by use HttpConnection.openDataInputStream()
    By Herbutinde in forum Mobile Java General
    Replies: 2
    Last Post: 2009-08-27, 06:42
  4. HttpConnection allow other http response codes
    By aquaUrge in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2009-06-25, 11:24
  5. Problems getting response from Wap apn proxy using httpConnection
    By prafulla.prashant in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2007-05-17, 13:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×