wait for

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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)...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. A

    Android Question Wait For with OkHTTPUtils2 and CallSubDelayed

    Hi, I have a question. I created a small project (see the attachment) where I tried to learn how to work with a subject. I created a class where I put all the logic -the main procedure in this class calls a private sub that sends request to the server Sub Class_Globals Public FacilityID...
  15. stingrae

    Android Question Http Job Wait For Hangs

    Hi, I can't seem to figure this out. When I call the following code, it hangs on the Wait For: Dim strThisURL As String = "URL of my API" Dim j As HttpJob j.Initialize("" , Me) j.Download(strThisURL) Wait For (j) JobDone(j As HttpJob) ' Hangs Here Dim MyDataList As List Dim...
  16. behnam_tr

    B4J Question how use "wait for" to check file existing

    hi i creat a pdf file in my b4j app using printhtml and jshell and i save that in my app folder then i upload to myhost after runing jshell complet event i use sleep(4000) then file is ready for upload.... now i want to use "wait for" instead of sleep to checking file exist without using sleep...
  17. LucaMs

    B4A Class [B4X][B4XLib] WaitForWithTimeout --> TimeoutHandler

    I have read many times the request for a "Wait For" with the addition of a timeout. This class is an attempt to implement that functionality. It is a B4X class, in the sense that it can be used with B4A, B4J and B4i; after all it uses only one B4XView which is completely optional and almost...
  18. avalle

    B4J Question [Server] Wait For a SQLite data to change

    Hi, I understand how to use Wait For in a B4J Server Handler. However I have no idea how to pause a server handler class waiting for some data in a SQLite database to change. Anyone so kind to help? Thanks Andrea
  19. ALBRECHT

    Android Question [Solved] Job with wait for into a class

    Hello, I have a lot of sub routines that execute some poststrings actions with an ASP API. So i have put the whole in a separate Code Module , like for example sending email directly via the API (its more simpler and lighter for the app) : Sub SendAnEmail(QSTT As String, QSMESS As String...
  20. S

    Android Question Multiple Runtime Permissions / Wait For.. Complete not working? RESOLVED

    I am trying to update an app that was based on the old Bluetooth example so may not take advantage of all the latest developments in program structure. I do not write programs for B4A very often as I mostly have to use Embedded C or design electronics. My apps are used to support our embedded...
Top