Im developing a an android application which is for rooted device.My app is a system app. In the my app i need to all user to input the router ssid,password so that i need to make connection to the router via wifi.
For this im using requestNetowrk method .(android.net.ConnectivityManager.reqeustNetwor(NetworkRequest,NetworkCallback,Timeout)).
It is connected,But after exiting from app the connection lost. How to make the connection remains persist after exiting the app.That i am not needed app level connection and needed device level connection. How to achieve this.
The following are the configurations i used in my app Android 10 & it is system app.
You can use
addNetwork(WifiConfiguration config)
fromWifiManager
class.This API is used for persistent connection in Pre-Android Q version. From Android Q it is deprecated, but the deprecation is exempted for Device Owner (DO), Profile Owner (PO) and system apps.
From Android Docs