J2ME: allowing for "Allow HTTP traffic?" confirmation when doinga connection timeout mechanism

Discussion in 'Java' started by vh, Mar 19, 2007.

  1. vh

    vh Guest

    I'm using threading in a J2ME app to allow a timeout on an attempt to
    connect to server. However, I'm having an issue with the usual
    confirmation the user gets on first connection attempt: you know, the
    message that say something like "This application would like to send
    HTTP traffic. Allow this?" The problem is that I have no idea of how
    long the user takes to read this message before hitting "ok", so my
    connection timeout could timeout before the user has even hit ok and
    before any connection attempt has been made!

    Is there any callback available so that I know when the user has
    actually hit 'ok'?

    My current workaround is to make a dummy first connection to a bad
    address, e.g. "http://x", just to get the user to hit 'ok' and get that
    out of the way before making my proper connection attempt.
    Is there a better way though? This technique makes an attempted DNS
    lookup which wastes a little time.

    Thanks.


    N.B.
    I'm aware that in some cases the user can have a preference set so that
    the HTTP traffic alert happens before *every* server communication, but
    I'm ignoring this case for the moment.
     
    vh, Mar 19, 2007
    #1
    1. Advertising

  2. vh

    Guest

    Re: J2ME: allowing for "Allow HTTP traffic?" confirmation when doing a connection timeout mechanism

    On 19 Mar, 10:38, vh <> wrote:
    > I'm using threading in a J2ME app to allow a timeout on an attempt to
    > connect to server. However, I'm having an issue with the usual
    > confirmation the user gets on first connection attempt: you know, the
    > message that say something like "This application would like to send
    > HTTP traffic. Allow this?" The problem is that I have no idea of how
    > long the user takes to read this message before hitting "ok", so my
    > connection timeout could timeout before the user has even hit ok and
    > before any connection attempt has been made!
    >
    > Is there any callback available so that I know when the user has
    > actually hit 'ok'?
    >
    > My current workaround is to make a dummy first connection to a bad
    > address, e.g. "http://x", just to get the user to hit 'ok' and get that
    > out of the way before making my proper connection attempt.
    > Is there a better way though? This technique makes an attempted DNS
    > lookup which wastes a little time.
    >
    > Thanks.
    >
    > N.B.
    > I'm aware that in some cases the user can have a preference set so that
    > the HTTP traffic alert happens before *every* server communication, but
    > I'm ignoring this case for the moment.


    I think you'll find that the execution of your app will be suspended
    by the hardware's OS/JRE while awaiting a response by the user to the
    question.
     
    , Mar 19, 2007
    #2
    1. Advertising

  3. vh

    vh Guest

    wrote:
    > On 19 Mar, 10:38, vh <> wrote:
    >
    >>I'm using threading in a J2ME app to allow a timeout on an attempt to
    >>connect to server. However, I'm having an issue with the usual
    >>confirmation the user gets on first connection attempt: you know, the
    >>message that say something like "This application would like to send
    >>HTTP traffic. Allow this?" The problem is that I have no idea of how
    >>long the user takes to read this message before hitting "ok", so my
    >>connection timeout could timeout before the user has even hit ok and
    >>before any connection attempt has been made!
    >>
    >>Is there any callback available so that I know when the user has
    >>actually hit 'ok'?
    >>
    >>My current workaround is to make a dummy first connection to a bad
    >>address, e.g. "http://x", just to get the user to hit 'ok' and get that
    >>out of the way before making my proper connection attempt.
    >>Is there a better way though? This technique makes an attempted DNS
    >>lookup which wastes a little time.
    >>
    >>Thanks.
    >>
    >>N.B.
    >>I'm aware that in some cases the user can have a preference set so that
    >>the HTTP traffic alert happens before *every* server communication, but
    >>I'm ignoring this case for the moment.

    >
    >
    > I think you'll find that the execution of your app will be suspended
    > by the hardware's OS/JRE while awaiting a response by the user to the
    > question.


    It's a nice concept, but by now I'm all too used to the non-standard way
    real phones handle foregrounded OS events - i.e. some devices will call
    pauseApp, others won't, and there is also a wonderful plethora of
    behaviours seen regarding the calling of startApp too....

    I will check out how feasible this seems though (and post back any
    results), thanks for the idea!
     
    vh, Mar 20, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guoqi Zheng
    Replies:
    4
    Views:
    13,038
    Guoqi Zheng
    Jun 3, 2004
  2. MattB

    Better timeout mechanism?

    MattB, Aug 30, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    425
    MattB
    Aug 31, 2006
  3. no`name`
    Replies:
    1
    Views:
    232
    Rob Williscroft
    May 29, 2007
  4. shmuel witman

    Connection timeout (connection closing after 100 sec )

    shmuel witman, Dec 4, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    820
    shmuel witman
    Dec 6, 2005
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,293
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page