[F/OS] Network Tools Extension - To work with network

🌐 Network Tools

To work with network and usage

Previously NetworkUsage. With NetworkTools, you can get the data usage and packets of Wifi, Mobile data. Also, you can monitor or view the current data traffic as formatted ( 1.5Mbps etc.,. ) or you can calculate them by logic or parse it yourself. I documented the blocks and usages of them. From v1.6, you can get usage and packets of a specific app by it’s package name.


🧩 Blocks

General

Doesn’t require any permissions ( and Usage Access too )

component_event

download ~ number - float ( or string if formatted )
upload ~ number - float ( or string if formatted )

This event is triggered when the Traffic changes ( Doesn’t consume data to determine usage ). This shows the current data transfer speed of the system.

Note : You need to initialize it first

component_method

type ~ Data type ( Property )

Use this to initialize TrafficMeasurer and start it ( has event ).

image
Can be used to Pause, Resume, Stop the background thread ( TrafficChanged event ).

Note : You can’t use this blocks before Initializing. If used, will throw error

image

type ~ Data type ( Property )

Can be used to get the amount of Packets Uploaded/Downloaded.

image
type ~ Data type ( Property )
formatted ~ boolean

You can use this method blocks to return the amount of data used.
Formatted value returns formatted string value ( 1.5GB etc., )

Note : Use ReturnBits property if you want to return bits instead of bytes

component_method(1)

bytes ~ string ( double )
useBits ~ boolean

Takes only bytes as input ( not bits ). But, you can then convert it to bits if you want. Eg. If you input 1 byte with useBits as true. It will return 8 b.


App Specific

Requires USAGE ACCESS PERMISSION

component_event(1)

package Name ~ string
upload ~ number ( string if formatted )
download ~ number ( string if formatted )
uploadPackets ~ int
downoadPackets ~ int

Note : Use ReturnBits property if you want to return bits instead of bytes

component_event(2)

package Name ~ string

Fired when the package provided isn’t installed/not found.

component_method

Returns true if app has Usage Access Permission Granted

component_method(1)

Use ths block to open the settings if Usage Access Permission is not Granted

component_method(2)

package Name ~ string ( Will fire Package Not Found if any error occurs )
formatted ~ boolean
type ~ Data type ( Property )

Will fire GotPackageStats if succeeds.

Note :
DataAll will be used if Android version is below Marshmallow ( sdk 23 )

DataWifi will be used if Android version is above Q ( sdk 29 )

This restrictions are made due to api changes ( sdk 23 ) and privacy reasons ( sdk 29 )

Use ReturnBits property if you want to return bits instead of bytes


Property Blocks

image
Type ~ boolean

Determines whether the output of current traffic is formatted ( Human readable, 1.5Mbps etc., ).

image
Type ~ boolean

Determines whether the data is returned as either Bytes or Bits. If you set formatted too… The formatted data will be Kilobits, Megabits, Gigabits
instead of Kilobytes, Megabytes and Gigabytes.


1 Byte = 8 Bits ( So, the data output may vary by a large difference )

image
Type ~ boolean

To get usage of a particular Data Source ( Can be used in DataMeasure, GetDownload, GetUploaded, GetDownloadPackets, GetUploadPackets )


Test App Screenshots

📂 Downloads

What’s new in v1.6 :-

  • Get usage by package
  • Uses READ_PHONE_STATE , PACKAGE_USAGE_STATS,QUERY_ALL_PACKAGES permissions
  • Added DataWifi property to get Wifi usage separately
  • Fixed minor bugs/errors

Files

Extension ( v1.6 ) :com.jaxparrow.networkusage.aix (19.5 KB)

Test Apk : Network_Tools.apk (5.4 MB)

Test Aia : Network_Tools.aia (38.8 KB)

Older Versions

Check Github Releases for releases after v1.0

v1.0 ( Appybuilder IDE )
Aix :com.appybuilder.jackandrichardjunior.Networkstats.aix (5.9 KB)
Test App : NetworkStatsTest.apk (5.2 MB)


ℹ️ Open-source and credits

@Taifun for their TaifunPM extension ( used in Test Apk )

Now, rebuilt with Rush.

This extension is now open-sourced and you can contribute to this extension by forking and creating a pull request.

Code snippets from internet ( stackoverflow )

Network Traffic Measuring : https://stackoverflow.com/a/53539175/13639399

Get Usage by Package : https://stackoverflow.com/a/29084035/13639399

25 Likes

You mean speed tester

1 Like

No. The amount of data used.

2 Likes

Is there any method to detect amount data used by specific app?? (It have to give me total data used by Teams app, whatsapp,…Etc)

2 Likes

Sure, I will add… Thanks for your suggestion.

2 Likes

Sounds good. Happy and waiting to see your update. I tested it and working so fo good.

2 Likes

Hi,

I too need to know the speeds of current app. What is the status on this? Thank you :slight_smile:

1 Like

@Jaxparrow can i use this and show my users how much they spend there data from my app???

1 Like

I am working on that update to get usage as per app. Sure, will update it once I finish.

3 Likes

I am planning to add that too. Sure, will add them soon.

2 Likes

Thanks for your suggestion. I added the ability to get the current data traffic. Sure, will implement for app specific too. You can download the updated one in the first post.

I tried to implement app specific usage and It doesn’t seem to give positive output. Sure, I will take a look at that after some time. Thanks for your replies and suggestions.

Great extension broo

can you add an option of getting traffic upload and download data in bytes.?

1 Like

Thanks for your reply… :heart:


It’s possible if you set this property to false. But, you cannot get formatted and bytes data at the same time. You can then do logical operations like comparing current speed. But, If you want to show it to user as formatted ( Mbps/Gbps etc.,. ) You can use this block to format bytes into human readable format and show them in lables etc.,.

image

1 Like

Waiting for the update
Thanks, great extension

1 Like

Network Tools v1.6

Screenshot


( List view with image ) Used Taifun’s TaifunPM to get packages list

What’s new

  • Get usage by package
  • Uses READ_PHONE_STATE , PACKAGE_USAGE_STATS,QUERY_ALL_PACKAGES permissions
  • Added DataWifi property to get Wifi usage separately
  • Fixed minor bugs/errors

Downlods

Extension ( v1.6 ) :com.jaxparrow.networkusage.aix (19.5 KB)

Test Apk : Network_Tools.apk (5.4 MB)

Test Aia : Network_Tools.aia (38.8 KB)

Check first post for more info and documentation of updated blocks.

5 Likes

2 posts were split to a new topic: How to ad load more system in app with taifun file extension