B4A Library WaitForInternet - Best way to check the internet connection

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Imagine you have in a company connected to internet behind a firewall and with a captive portal (to put your username and password to connect, like a Mac Donald´s connection for example).

When you connect you can´t navigate to others urls without pass the authentication screen, right?

So, the android interpret this connection like "CONNECTED" but you don´t! You just connected to WIFI.

And to connect others URL´s you need to pass this authentication, and then you can...

and the PING method allow you to check if you REALLY is the internet!
 

Rusty

Well-Known Member
Licensed User
Longtime User
Aha! Now I get it
Thanks!
I'll purchase your lib right now.
Good work Alberto!
Rusty
 

Rusty

Well-Known Member
Licensed User
Longtime User
Alberto,
I purchased your library from your Visual Net Store
Order #223
How do I download the production library?
Rusty
 

Rusty

Well-Known Member
Licensed User
Longtime User
I received "Your order is complete"...Order @223, which is a receipt. No URL or link (other than my email address)
I received "Welcome to Visual Net Store"...thanks for creating an account.
That's all.
No links to download or anything else...
Rusty

Paypal indicates that you have already been paid...
 

Rusty

Well-Known Member
Licensed User
Longtime User
Alberto,
I received the zip file you sent me, but it contains a demo library and the compiled program will not allow a ping.
Can you advise?
Rusty
 

coslad

Well-Known Member
Licensed User
Longtime User
Hi Alberto

i want to try your lib , where can i download 1.02 Version ? the url :

http://worknhouse.com/store/product/waitforinternet-best-way-to-check-the-internet-connection/


is down , and at the first post there is the V 1.01 .

i tried the 1.01 but it come out this error :

B4X:
Network WIFI connected
WifiAvailable:true
WifiConnected:true
Ping not available in Demo Version.** DONATIONWARE **
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x8000010 (has extras) } in com.visualnet.waitforinternet$1@4307d550
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:773)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:175)
    at android.app.ActivityThread.main(ActivityThread.java:5279)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at com.visualnet.waitforinternet$1.onReceive(waitforinternet.java:176)
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:763)
    ... 9 more
Thanks
 
Last edited:

coslad

Well-Known Member
Licensed User
Longtime User
Ciao Alberto

even with 1.02V i got the same error :

B4X:
** Service (comunicazione) Start **
Network WIFI connected
WifiAvailable:true
WifiConnected:true
Ping not available in Demo Version.** DONATIONWARE **
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x8000010 (has extras) } in com.visualnet.waitforinternet$1@4307c758
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:773)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:175)
    at android.app.ActivityThread.main(ActivityThread.java:5279)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at com.android.internal.os.LoggingPrintStream.println(LoggingPrintStream.java:298)
    at com.visualnet.waitforinternet$1.onReceive(waitforinternet.java:199)
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:763)
    ... 9 more

my is a Samsung tablet without 3G module.
 

coslad

Well-Known Member
Licensed User
Longtime User
Albe' !!

The same app running well on a S6 , but if i run it on a device without 3g it crash , i'll try some update but i don't think it is the problem.
 

Peekay

Active Member
Licensed User
Longtime User
Alberto, where can I download the latest version?

Thanks
PK
 

Peekay

Active Member
Licensed User
Longtime User
Alberto,

Thanks so much. I downloaded the version for 4.99 pound, which is more than enough for me, thanks.
Must I pose questions to your message box directly?
Must I also have your layout as a sort of settings panel in my app, or must I only use the code for it?

PK
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I tried your demo on a Samsung Galaxy Tab A7 (SM-T500) Tablet and got the following results



The problem is the device does have a WiFi IP (connected to the router using WiFi) but the Router has NO Internet connection - My internet is down right now.

ALSO: The Tablet does NOT have Mobile/3G just WiFi

IS the only way to know for sure if connected is to use the version that pings?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…