How to ping a site

lock255

Well-Known Member
Licensed User
Longtime User
Hi I am creating a program that does ping a website, so what I need is:
1) Know whether the site is online
2) the IP address of the server
If someone helps me I'd be really grateful. I just started programming with B4A, so I ask you spieghermi things in a simple and step by step.
 

lock255

Well-Known Member
Licensed User
Longtime User
Thank you all for the help, the only step is how to establish by ping if a website is up or down. Anyone is capable of it?
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
i have 2 phones one rooted the other not,and ping runs in both.i do ping for see devices in wifi network and runs ok
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
yes, editing the manifest now it works in release also. Thanks Erel (and everybody).
Marco
 
Upvote 0

lock255

Well-Known Member
Licensed User
Longtime User
The Ping now works fine, but I want to understand how to determine whether a website is up or down?
 
Upvote 0

lock255

Well-Known Member
Licensed User
Longtime User
You can search for it, type httputils2 up in the SEARCH box and you'll find it.

I managed to do just that:
B4X:
Sub Check_Click
MainUrl= "http://www." & LinkSito.Text
   PreviewWeb.LoadUrl(MainUrl)
   Dim job As HttpJob
   job.Initialize("Main page", Me)
   job.Download(MainUrl)
End Sub


I do not know how to let him know if the download page has been done (so the site is up) or it is not possible to download (when the site is down).
 
Upvote 0

lock255

Well-Known Member
Licensed User
Longtime User
Erel the PreviewWeb does not give me problems, I can not write the statement that allows you to check if the page download is successful or not.
 
Upvote 0

lock255

Well-Known Member
Licensed User
Longtime User
Any chance you could post your completed program? THANKS! :sign0060:

Unfortunately I can not publish the full code, but you can safely write it if you follow the previous comments. If you have any difficulty sonoa your disposal!
 
Upvote 0
Top