Package com.pubmatic.sdk.common.utility
Class POBLocationDetector
-
- All Implemented Interfaces:
-
android.location.LocationListener
public class POBLocationDetector implements LocationListener
ThPMLocationDetector is Utility class used to detect device location
-
-
Constructor Summary
Constructors Constructor Description POBLocationDetector(Context appContext)Constructs POBLocationDetector by initializing app context
-
Method Summary
Modifier and Type Method Description LocationgetLocation()Method is used to get location on the basic of LocationProvider(GPS, Network) AddressgetAddress()Given a Location, return a country code. StringgetISOAlpha2CountryCode()Given a Location, return a country code. voidonLocationChanged(@NonNull() Location location)voidonStatusChanged(String provider, int status, Bundle extras)voidonProviderEnabled(@NonNull() String provider)voidonProviderDisabled(@NonNull() String provider)voidsetLocationUpdateIntervalInMs(long locationUpdateIntervalInMs)Method to set update time interval -
-
Constructor Detail
-
POBLocationDetector
POBLocationDetector(Context appContext)
Constructs POBLocationDetector by initializing app context- Parameters:
appContext- instance of application context
-
-
Method Detail
-
getLocation
@Nullable() Location getLocation()
Method is used to get location on the basic of LocationProvider(GPS, Network)
- Returns:
instance of Location class
-
getAddress
@Nullable() Address getAddress()
Given a Location, return a country code.
- Returns:
the ISO 3166-1 two letter country code
-
getISOAlpha2CountryCode
@Nullable() String getISOAlpha2CountryCode()
Given a Location, return a country code.
- Returns:
the ISO 3166-1 two letter country code
-
onLocationChanged
void onLocationChanged(@NonNull() Location location)
-
onStatusChanged
void onStatusChanged(String provider, int status, Bundle extras)
-
onProviderEnabled
void onProviderEnabled(@NonNull() String provider)
-
onProviderDisabled
void onProviderDisabled(@NonNull() String provider)
-
setLocationUpdateIntervalInMs
void setLocationUpdateIntervalInMs(long locationUpdateIntervalInMs)
Method to set update time interval
- Parameters:
locationUpdateIntervalInMs- time interval to get location
-
-
-
-