-
Notifications
You must be signed in to change notification settings - Fork 127
getIP package
Federico Dossena edited this page Sep 12, 2019
·
1 revision
Implements IP and ISP info fetching over an existing Connection. Creates a new Thread to do it. Starts immediately (no need to call start()
).
Constructor:
public GetIP(Connection c, String path, boolean isp, String distance)
-
c
: the instance of Connection to be used -
path
: path on the server where the IP and ISP info can be fetched -
isp
: if set to true, it will fetch ISP info, otherwise it will only fetch the IP address -
distance
: ifisp
is set to true, this specifies how the distance should be measured-
SpeedtestConfig.DISTANCE_NO
: do not calculate distance -
SpeedtestConfig.DISTANCE_KM
: kilometers -
SpeedtestConfig.DISTANCE_MILES
: miles
-
Callbacks:
-
onDataReceived(String data)
: if the operation succedes, this is called with a JSON string representing the result (seegetIP.php
implementation detalis for more information) -
onError(String err)
: if the operation fails, this is called with an error message