How to create a ping testing app in sketchware Tutorial to display real time ping?
Hi there today in this tutorial I will show you how you can make an app to test live ping of your network using sketchware
In this tutorial we will create the variables, apk extractor components and more blocks systematically to avoid confusion.
Remember that you need to do the same as I do to avoid crash or malfunctioning of your app.
So let’s get started.
Step No. 1 :
In your main.xml view drag and drop a Linear(V) and make it’s height and width set to match parent
And gravity to center_horizontal and center_vertical.
Now drag and drop a ImageView and make it’s height and width set to 150px
And scale type to Center_Inside.
Drag and drop a TextView and set it’s text to ___ms and text size to 16px and make the text to bold.
Over all it should look like this
Remember it’s upto you how you change your apps design.
Step No. 2 :
Let’s Create the variables first.
We need two variables
1. Create a Boolean variable called start
2. Create a Number variable called ping
Step No. 3 :
In this step we will create all the components.
1. Create a RequestNetwork component called ping_tester
2. Create a timer component called time
Step No. 4 :
Now create a more block called repeat
And define the more block as shown in the picture.
Blocks used here are : If block, start block(Boolean), RequestNetwork__start network request to method get to url https://www.google.com with tag A , timer block, increae number block, and the repeat block itself. Remember the order, otherwise app will hang and crash.
Step No. 5 :
Now go to the On create Event
And add blocks as follows
RequestNetwork get url with tag
And the repeat block (more block)
Step No. 6 :
Now add two events for the RequestNetwork component called RequestNetwork onResponse and RequestNetwork onErrorResponse.
1. Define the RequestNetwork onResponse block As follows
2. Define the RequestNetwork onErrorResponse as follows