// Path: app/src/main/java/wseemann/media/romote/model/ClientScanResult.java
// public class ClientScanResult {
//     private String IpAddr;
//     private String HWAddr;
//     private String Device;
//     private boolean isReachable;
// 
//     public ClientScanResult(String ipAddr, String hWAddr, String device, boolean isReachable) {
//         super();
//         this.IpAddr = ipAddr;
//         this.HWAddr = hWAddr;
//         this.Device = device;
//         this.isReachable = isReachable;
//     }
// 
//     public String getIpAddr() {
//         return IpAddr;
//     }
// 
//     public void setIpAddr(String ipAddr) {
//         IpAddr = ipAddr;
//     }
// 
//     public String getHWAddr() {
//         return HWAddr;
//     }
// 
//     public void setHWAddr(String hWAddr) {
//         HWAddr = hWAddr;
//     }
// 
//     public String getDevice() {
//         return Device;
//     }
// 
//     public void setDevice(String device) {
//         Device = device;
//     }
// 
//     public boolean isReachable() {
//         return isReachable;
//     }
// 
//     public void setReachable(boolean isReachable) {
//         this.isReachable = isReachable;
//     }
// }
// 
// Path: app/src/main/java/wseemann/media/romote/utils/Constants.java
// public enum WIFI_AP_STATE {
//     WIFI_AP_STATE_DISABLING,
//     WIFI_AP_STATE_DISABLED,
//     WIFI_AP_STATE_ENABLING,
//     WIFI_AP_STATE_ENABLED,
//     WIFI_AP_STATE_FAILED
// }


import android.util.Log;
import wseemann.media.romote.model.ClientScanResult;
import wseemann.media.romote.utils.Constants.WIFI_AP_STATE;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;
        try {
            Method method = mWifiManager.getClass().getMethod("getWifiApConfiguration");
            return (WifiConfiguration) method.invoke(mWifiManager);
        } catch (Exception e) {
            Log.e(this.getClass().toString(), "", e);
            return null;
        }
    }

    /**
     * Sets the Wi-Fi AP Configuration.
     *
     * @return {@code true} if the operation succeeded, {@code false} otherwise
     */
    public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
        try {
            Method method = mWifiManager.getClass().getMethod("setWifiApConfiguration", WifiConfiguration.class);
            return (Boolean) method.invoke(mWifiManager, wifiConfig);
        } catch (Exception e) {
            Log.e(this.getClass().toString(), "", e);
            return false;
        }
    }

    /**
     * Gets a list of the clients connected to the Hotspot, reachable timeout is 300
     *
     * @param onlyReachables  {@code false} if the list should contain unreachable (probably disconnected) clients, {@code true} otherwise
     * @param finishListener, Interface called when the scan method finishes
     */
// Path: app/src/main/java/wseemann/media/romote/model/ClientScanResult.java
// public class ClientScanResult {
//     private String IpAddr;
//     private String HWAddr;
//     private String Device;
//     private boolean isReachable;
// 
//     public ClientScanResult(String ipAddr, String hWAddr, String device, boolean isReachable) {
//         super();
//         this.IpAddr = ipAddr;
//         this.HWAddr = hWAddr;
//         this.Device = device;
//         this.isReachable = isReachable;
//     }
// 
//     public String getIpAddr() {
//         return IpAddr;
//     }
// 
//     public void setIpAddr(String ipAddr) {
//         IpAddr = ipAddr;
//     }
// 
//     public String getHWAddr() {
//         return HWAddr;
//     }
// 
//     public void setHWAddr(String hWAddr) {
//         HWAddr = hWAddr;
//     }
// 
//     public String getDevice() {
//         return Device;
//     }
// 
//     public void setDevice(String device) {
//         Device = device;
//     }
// 
//     public boolean isReachable() {
//         return isReachable;
//     }
// 
//     public void setReachable(boolean isReachable) {
//         this.isReachable = isReachable;
//     }
// }
// 
// Path: app/src/main/java/wseemann/media/romote/utils/Constants.java
// public enum WIFI_AP_STATE {
//     WIFI_AP_STATE_DISABLING,
//     WIFI_AP_STATE_DISABLED,
//     WIFI_AP_STATE_ENABLING,
//     WIFI_AP_STATE_ENABLED,
//     WIFI_AP_STATE_FAILED
// }


// Path: app/src/main/java/wseemann/media/romote/utils/WifiApManager.java
import android.util.Log;
import wseemann.media.romote.model.ClientScanResult;
import wseemann.media.romote.utils.Constants.WIFI_AP_STATE;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;

        try {
            Method method = mWifiManager.getClass().getMethod("getWifiApConfiguration");
            return (WifiConfiguration) method.invoke(mWifiManager);
        } catch (Exception e) {
            Log.e(this.getClass().toString(), "", e);
            return null;
        }
    }

    /**
     * Sets the Wi-Fi AP Configuration.
     *
     * @return {@code true} if the operation succeeded, {@code false} otherwise
     */
    public boolean setWifiApConfiguration(WifiConfiguration wifiConfig) {
        try {
            Method method = mWifiManager.getClass().getMethod("setWifiApConfiguration", WifiConfiguration.class);
            return (Boolean) method.invoke(mWifiManager, wifiConfig);
        } catch (Exception e) {
            Log.e(this.getClass().toString(), "", e);
            return false;
        }
    }

    /**
     * Gets a list of the clients connected to the Hotspot, reachable timeout is 300
     *
     * @param onlyReachables  {@code false} if the list should contain unreachable (probably disconnected) clients, {@code true} otherwise
     * @param finishListener, Interface called when the scan method finishes
     */
    public ArrayList<ClientScanResult> getClientList(boolean onlyReachables) {