Android Question Code never going to JobDone

malcfreem

Member
Licensed User
Longtime User
Hi.
I have an app and, when it starts up, I want to check that there is an Internet connection (either wifi or 3g). I used Erel's suggestion of downloading a web page. I put the code into a new project and it worked fine. When I ported the exact same code into my app's code, it never calls JobDone. Is it maybe because of the threads? The library references are identical in both projects

Here is a section of my code...


Sub Process_Globals

DimThread1AsThread'ignore => ignore warning of this line

DimThread2AsThread'ignore => ignore warning of this line

(etc)



Sub Activity_Create(FirstTime AsBoolean)

Dim job AsHttpJob

job.Initialize("j", Me)

job.Download("http://www.ladsbooks.co.uk/index.htm")

spinnerMap.initialize

Thread1.Initialise("Thread1")

Thread2.Initialise("Thread2")

File.Delete(File.DirInternal, "FDiOffers.db") ' only for testing

'check if the database already exists

IfFile.Exists(File.DirInternal, "FDiOffers.db") = FalseThen

'if not, initialize it

SQL1.Initialize(File.DirInternal, "FDiOffers.db", True)

'and create it

CreateDataBase

Else

'if yes, initialize it

SQL1.Initialize(File.DirInternal, "FDiOffers.db", True)

EndIf





Timer1.Initialize("Timer1",4000)

Timer2.Initialize("Timer2",300000)

Timer3.Initialize("Timer3",60000)

Timer1.Enabled=True

Timer2.Enabled=False

Timer3.Enabled=False

Activity.RemoveAllViews

svLay="BrowseRedeem"

Activity.LoadLayout(svLay)

End Sub





Sub JobDone(job AsHttpJob)

If job.Success Then

Msgbox("Connection","Yes")

Else

Msgbox("No connection","No")

EndIf

job.Release

End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…