Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
vh - 19 Mar 2007 11:38 GMT
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.
usenetuser@hotmail.co.uk - 19 Mar 2007 12:43 GMT
> 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
[quoted text clipped - 20 lines]
> 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.
vh - 20 Mar 2007 11:10 GMT
usenetuser@hotmail.co.uk wrote:
> On 19 Mar, 10:38, vh <v...@none.invalid> wrote:
>
[quoted text clipped - 26 lines]
> 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!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.