Class AndroidUsingLinkProperties
- java.lang.Object
-
- org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
-
- org.minidns.dnsserverlookup.android21.AndroidUsingLinkProperties
-
- All Implemented Interfaces:
Comparable<DnsServerLookupMechanism>
,DnsServerLookupMechanism
public class AndroidUsingLinkProperties extends AbstractDnsServerLookupMechanism
A DNS server lookup mechanism using Android's Link Properties method available on Android API 21 or higher. Usesetup(Context)
to setup this mechanism.Requires the ACCESS_NETWORK_STATE permission.
-
-
Field Summary
-
Fields inherited from class org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
LOGGER
-
-
Constructor Summary
Constructors Constructor Description AndroidUsingLinkProperties(android.content.Context context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getDnsServerAddresses()
Returns a List of String representing ideally IP addresses.boolean
isAvailable()
static AndroidUsingLinkProperties
setup(android.content.Context context)
Setup this DNS server lookup mechanism.-
Methods inherited from class org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
compareTo, getName, getPriority, toListOfStrings
-
-
-
-
Constructor Detail
-
AndroidUsingLinkProperties
public AndroidUsingLinkProperties(android.content.Context context)
-
-
Method Detail
-
setup
public static AndroidUsingLinkProperties setup(android.content.Context context)
Setup this DNS server lookup mechanism. You need to invoke this method only once, ideally before you do your first DNS lookup.- Parameters:
context
- a Context instance.- Returns:
- the instance of the newly setup mechanism
-
isAvailable
public boolean isAvailable()
-
getDnsServerAddresses
public List<String> getDnsServerAddresses()
Description copied from interface:DnsServerLookupMechanism
Returns a List of String representing ideally IP addresses. The list must be modifiable.Note that the lookup mechanisms are not required to assure that only IP addresses are returned. This verification is performed in when using
DnsClient.findDNS()
.- Specified by:
getDnsServerAddresses
in interfaceDnsServerLookupMechanism
- Specified by:
getDnsServerAddresses
in classAbstractDnsServerLookupMechanism
- Returns:
- a List of Strings presenting hopefully IP addresses.
-
-