I'm using in the app
setWifiApEnabled()
from Hidden API (access by reflection). In some older phone it´s working (also with Samsung Galaxy S3, some phones with 4.4,...) but I tested it with Samsung Galaxy S5 and I get
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
...
I'm using similar code like there Android 2.2 wifi hotspot API or How and what to set to Android WifiConfiguration.preSharedKey to connect to the WPA2 PSK WiFi network but It´s a little old code.
Do you have experience with it? What do you suggest?
P.S. it's not working also in some Android 4.4 devices (but I don't get InvocationTargetException).