iOS Question how to use timer for http job?

Baris Karadeniz

Active Member
Licensed User
I want to use timer for http job. For example I will set it to 5 seconds and http job will be done every 5 seconds if I enable timer. If I disable timer http job will stop. How can I do this?

B4X:
Dim Job1 As HttpJob
      Job1.Initialize("MyJob", Me)
      Job1.Download2("http://www.xxx.com/yyy.php", Array As String("x", "y"))

Sub JobDone (Job As HttpJob)
    Log("Job completed: " & Job.Success)
    Job.Release
End Sub
 

tufanv

Expert
Licensed User
Longtime User
When you type timer1. And click on initialize for example you can see the example.

While initializing you must set the interval. Later you can changw it via timer1.interval = 1000

1000means 1 second. You must set 5000 for 5 seconds. Later under sub timer1_tick tou can type what you want. Tou can use b4x object browser to help yourself or use the beginners guide as donmanfred suggested
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
Thanks tufanv. I searched the beginners guide again and I saw. I think I did something wrong when I searched the beginners guide first time.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…