Hello to all!
I am a big fan of "Wait For" thing. I like asynchronous events so I use them most of the times, but I have a question. I know by a variable, "CurrentActivity", in Starter (service) which activity is active (yes, I do not write in B4XPages, I can not move my project, as it is huge)...
Hello everyone!
I have created an app that akes lot's of API Calls. Some times the connection to the server isn't easy, so the app has to wait. This is why I have added a Loading Indicator for the user to know that everything works fine, they just have to wait a few seconds.
Nevertheless, the...
I have a project building an automatic backup downloading tool in B4J but have hit a major snag...
The App contains a B4XTable with information about a download enabling a login to a given server and a path from which it pulls the latest (backup) file and saves it.
To pull the given file, I...
Hello, I would like to know if it is possible to wait for a B4XPages (QrCode Reader) page to finish and then obtain the result.
The first thing I do is load the page that reads in qrcode
Private Sub ButtonQrOrigen_Click
B4XPages.ShowPage("Qr Code Reader")
Dim Resultado As String =...
Hello Everyone!
I have a LogIn page with a LogIn button.
When the button is pressed, an http job gets initialized and after that I use a wait for statement until the job is completed, like so:
j.Initialize("", Me)
j.PostString(link, m.As(JSON).ToCompactString)...
Hi guys! How are you,
I state that I'm new to B4J and, despite my many attempts and various readings, I can't do something that should be simple.
In practice I have created a web portal in B4J and I manage the various pages through the handlers. So far, so good.
The problem arises when I...
For Each TotalPlayer As String In TS.Players
Dim Sum As Int = SumAll(TotalPlayer, TS.Multiplier)
Wait For (SumAll(TotalPlayer, TS.Multiplier)) Complete (Sum As Int) 'This should throw a waring but doesn't and thus breaks program flow.
Dim SB As StringBuilder...
I am calling a sub called ShowDialog from multiple places in code. Message1 is string Variable.
Intended outcome:
My code should display Dialog and wait for either ok or cancel.
Current scenario:
Dialog is shown but code moves on to Additional Code
Would be really nice if anyone can share or...
Hi, all. I was trying the following codes to learn Wait For and Sleep. However, I always failed to get the output right.
The code is like this:
'main
sub activity_create
p1
p2
end sub
private sub p1
log("p1 started")
Wait For p2
log("p1 ended") 'It seems that this line of...
To all the friendly Anywhere Experts:
If make the following call using WebViewExtras:
wvx.ExecuteJavascript(wvYBiRead, "B4A.CallSub('getElmTopHeightText', true, document.getElementById('v1').offsetTop")
In the sub "getElmTopHeightText" I am setting some Global variables.
How do I use...
Hello all,
I am writing an app which uses MQTT, and I find a problem with "wait for".
In an activity "info" I must collect several data from MQTT: every datum is asked for by publishing a topic and waiting for the reply. I would like to write several lines like:
Sub Activity_Create(FirstTime...
Hi everyone,
I'm moving part of my code done in a B4XPage into a Standard Class.
In this code i've a Runtime Permission CheckAndRequest that requires the "Wait For" block
Private Sub BeginBLEscan
rp_ble.CheckAndRequest(rp_ble.PERMISSION_ACCESS_FINE_LOCATION)
Wait For...
Hi everybody,
I am trying to get some data from a server with a DBRequest using the DBRequestManager library and wait for the answer to do something else in the same sub when the answer returns:
cmd.Initialize
cmd.Name = "update_usr"
cmd.Parameters = Array As Object(tempUsr)...
Hi, I am using this tutorial on how to connect to MySQL DB
https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/
But I have a problem because I need to wait for the query to finish before proceeding on to the next process.
I send a SELECT * FROM and I need to...
Small clarification needed regarding Resumable Sub/Wait for Event consumption
I have a sub called TTSCompleted which is called by a lib
in main code I use the following statement
Wait for TTSCompleted
When the event happens "Wait for" apparently resumes but the Sub TTSCompleted is not...
Well, I have (had) a simple sub that returns a value.
This sub will now use the shell, so it has become a resumablesub.
It so happens that I call these sub from various points in my project, and now each sub that calls this resumablesub will also become a resumablesub, forcing me to also...
I saw a recommendation not to use DoEvents:
Source: https://www.b4x.com/android/forum/threads/doevents-alternative.68918/#post-437288
But the window freezes if you don't use something to wait a while. And Windows O.S. notifies you that the window is not responding.
I managed to read...
Hello everybody.
I have the following situation. I'm sending some data over usb serial and I have to wait for an answer from the other party (a hardware device) before sending data again.
I want to use Wait For with AsyncStream, but there are situations when the other party does not answer at...
Hi, Guys
I appear to have a problem when I insert a resummable sub, within a try/catch block i.e.
' This will work Ok if the is error in DoSomething() - '
Try
a = DoSomething(...)
Catch
Log(LastException) ' Catch works and traps the error
End Try
' However if DoSomething() returns...
Hi,
I had a bad time searching for a bug where the program logic hung. It turned out I wrote
Wait For Msgbox_Respond (...)
instead of
Wait For Msgbox_Result (...)
Same problem when I used
Wait For JobComplete ...
instead of
Wait For JobDone ...
The problem is that neither the IDE nor the...