getIP package - librespeed/speedtest-android GitHub Wiki
GetIP
class
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 usedpath
: path on the server where the IP and ISP info can be fetchedisp
: if set to true, it will fetch ISP info, otherwise it will only fetch the IP addressdistance
: ifisp
is set to true, this specifies how the distance should be measuredSpeedtestConfig.DISTANCE_NO
: do not calculate distanceSpeedtestConfig.DISTANCE_KM
: kilometersSpeedtestConfig.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