Class AndroidUsingLinkProperties
java.lang.Object
org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
org.minidns.dnsserverlookup.android21.AndroidUsingLinkProperties
- All Implemented Interfaces:
Comparable<org.minidns.dnsserverlookup.DnsServerLookupMechanism>,org.minidns.dnsserverlookup.DnsServerLookupMechanism
public class AndroidUsingLinkProperties
extends org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
A DNS server lookup mechanism using Android's Link Properties method available on Android API 21 or higher. Use
setup(Context) to setup this mechanism.
Requires the ACCESS_NETWORK_STATE permission.
-
Field Summary
Fields inherited from class org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionAndroidUsingLinkProperties(android.content.Context context) Construct this DNS server lookup mechanism. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AndroidUsingLinkPropertiessetup(android.content.Context context) Setup this DNS server lookup mechanism.Methods inherited from class org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
compareTo, getName, getPriority, toListOfStrings
-
Constructor Details
-
AndroidUsingLinkProperties
public AndroidUsingLinkProperties(android.content.Context context) Construct this DNS server lookup mechanism.- Parameters:
context- an Android context.
-
-
Method Details
-
setup
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
- Specified by:
getDnsServerAddressesin interfaceorg.minidns.dnsserverlookup.DnsServerLookupMechanism- Specified by:
getDnsServerAddressesin classorg.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism
-