B4A Library NetworkClass

Network Connection Class Wrap based on this from Facebook for the B4A community.


The library listens to the current network traffic in your app and then categorizes the user's internet connection quality with one of following values Poor, Moderate, Good and Excellent.

v0.02 - Added Sample Start and Stop

v0.03 - Lib Update

The Network Connection Class library now takes care of spikes using a moving average
of the incoming samples, and also applies some hysteresis (both with a minimum
number of samples and amount the average has to cross a boundary before triggering.
 

Attachments

  • jsr305-1.3.9.jar
    32.2 KB · Views: 171
  • Example2.zip
    207.5 KB · Views: 175
  • libv3.zip
    14.3 KB · Views: 147
  • networkclass.jar
    15.8 KB · Views: 158
  • networkclass.xml
    1.8 KB · Views: 192
  • Example2.zip
    207.5 KB · Views: 159
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Network Connection Class Wrap based on this from Facebook for the B4A community.


The library listens to the current network traffic in your app and then categorizes the user's internet connection quality with one of following values Poor, Moderate, Good and Excellent.
very interesting
 

MarcoRome

Expert
Licensed User
Longtime User
I think that it is in the correct place.

So yes. when i was see the message is only:

Network Connection Class Wrap based on this from Facebook for the B4A community.

upload_2017-9-4_8-48-54.png
 

Daniel-White

Active Member
Licensed User
Longtime User
Hi, Jamie.

I noticed, it is only working the first time, when I press by the second time the button, does not show the toast message, neither work the first attempts with long click to show the bandwidth. I tested in two phones.
 

monic

Active Member
Licensed User
Longtime User
I Have another example/lib to try and I will try and give a better explanation.

The library listen's to network activity, it does this either by sampling data and then returning a value and/or bandwidth changes that occur.

When you clicked the button it was right as it sampled data and displayed the toast message and then went quiet listening for a sizable data sample to occur such as video or images to be downloaded, the long click was getting the last known value that was sampled manually.

I've included in the new example two button one that will download a 2.5 Mb image and sampling the network and then raise a event with the value.

Try switching between WiFi and 3/4G and re-sample/ wait for event raise and the see results. This library only measure data and doesn't know if the network is offline which I suppose should but handled separate.

I've included the debug version so you can see the events. New Example first post.
 

Attachments

  • networkclass_debug.zip
    27.3 KB · Views: 148
Last edited:
Top