wait for

  1. N

    Android Question CallSubDelayed to service with no result

    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)...
  2. K

    Android Question B4X do something if Wait For takes long

    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...
  3. Fr Simon Rundell

    B4J Question Jsch Synchronous FileDownload

    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...
  4. carlos7000

    Android Question It is possible to wait for a B4XPages page to disappear? {Solved]

    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 =...
  5. K

    Android Question Wait For with While (httpjob)

    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)...
  6. a.consorti

    B4J Question wait for and api response

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

    Wish [IDE, ResumableSub] Wait For a non-resumable sub should throw warning.

    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...
  8. epiCode

    Android Question Wait for Response

    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...
  9. O

    Android Question Need help with Wait For

    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...
  10. M

    Android Question How to call Wait For correctly with WebViewExtras

    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...
  11. L

    Android Question Problem with "wait for": Activity_resume is called before Activity_create finishes

    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...
  12. M

    Android Question [B4X_Pages] Runtime Permission inside Classes (Wait For)

    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...
  13. cheveguerra

    Android Question Is it possible to use DBRequestManager wth "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)...
  14. Oscarin

    Android Question Wait for, need help on how to use it

    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...
  15. epiCode

    Android Question Clarification: Resumable Subs

    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...
  16. jroriz

    B4J Question [SOLVED] Sub that became resumablesub

    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...
  17. rtek1000

    B4J Question DoEvents alternative

    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...
  18. yo3ggx

    Android Question Wait For with Astream

    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...
  19. D

    Android Question Problem with Try Catch and Wait for

    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...
  20. C

    Wish Autocomplete Event names with Wait For

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