app/src/main/java/com/example/androidverifier/Verify.java
/**
     *
     * @param context
     * @return true if the hotspot is enable
     */
@param context
@return true if the hotspot is enable
@param context @return true if the hotspot is enable
public static Boolean isWifiHotspotEnabled(Context context) {
        WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
        Method[] methods = wifiManager.getClass().getDeclaredMethods();
        boolean isWifiAPenabled = false;
        for (Method method: methods) {
            if (method.getName().equals("isWifiApEnabled")) {
                try {
                    isWifiAPenabled = (boolean) method.invoke(wifiManager);
                } catch (IllegalArgumentException e) {
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                } catch (InvocationTargetException e) {
                    e.printStackTrace();
                }
            }
        }
        return isWifiAPenabled;
    }
public static Boolean isWifiHotspotEnabled ( Context context ) { WifiManager wifiManager = ( WifiManager ) context . getSystemService ( Context . WIFI_SERVICE ) ; Method [ ] methods = wifiManager . getClass ( ) . getDeclaredMethods ( ) ; boolean isWifiAPenabled = false ; for ( Method method : methods ) { if ( method . getName ( ) . equals ( "isWifiApEnabled" ) ) { try { isWifiAPenabled = ( boolean ) method . invoke ( wifiManager ) ; } catch ( IllegalArgumentException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } catch ( InvocationTargetException e ) { e . printStackTrace ( ) ; } } } return isWifiAPenabled ; }
@param context
 @return true if the hotspot is enable
@param context @return true if the hotspot is enable