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

V

vh

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.
 
U

usenetuser

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.
 
V

vh

>
>
> 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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top