Class AndroidUsingLinkProperties

  • All Implemented Interfaces:
    java.lang.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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getDnsServerAddresses()  
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.util.List<java.lang.String> getDnsServerAddresses()
        Specified by:
        getDnsServerAddresses in interface org.minidns.dnsserverlookup.DnsServerLookupMechanism
        Specified by:
        getDnsServerAddresses in class org.minidns.dnsserverlookup.AbstractDnsServerLookupMechanism