2

We are developing a locked down "kiosk-style" Android app on a stock Samsung tablet, which is mounted in customer vehicles. We would like to be able to allow customers to edit their wifi settings, without giving them access to the rest of the Settings app (e.g. Launcher, accounts, etc)

We have been able to launch the Wifi Settings activity, but it allows the user to go into other areas.

I'm not sure whether it's possible to create a custom interface for connecting to wifi, but even if it were possible, this seems fragile and a lot of work for something quite simple.

Is there any way to solve this well?

aaaidan
  • 7,093
  • 8
  • 66
  • 102

5 Answers5

2

I would create a device policy controller app that is provisioned on the device as a device owner using Android Enterprise (Android for Work) APIs. https://developers.google.com/android/work/dpc/build-dpc

As a device owner, you can set your app in lock task mode which is generally used for kiosks. https://developer.android.com/work/cosu.html

Then, you can set user restrictions:
addUserRestriction api
user restrictions list
The user restrictions don't cover everything in the settings app, but the coverage is pretty good.

Then I would provision it using NFC or QR code reader from the Google Setup Wizard welcome screen. https://github.com/googlesamples/android-NfcProvisioning

You might want to also look at existing open source EMM/MDM implementations that already exist such as WSO2.

Other references:
How to enable task locking in Android 5.0 production devices
How to make sure there is only one app

Steve Miskovetz
  • 2,360
  • 13
  • 29
  • see if this link helps,https://www.42gears.com/blog/configure-wifi-settings-in-lockdown-mode-using-surelocksurefox/ – RPB Feb 23 '18 at 11:47
1

I was also working on Kiosk Type applications and we have to give options for Change wifi and Display Settings So we have used these commands on Button click for Wifi And Display Settings

btnWifiSetting.setOnClickListener {

            startActivityForResult( Intent(android.provider.Settings.ACTION_WIFI_SETTINGS), 0);
        }

And For Display Setting

btnDisplay.setOnClickListener {
            startActivityForResult(Intent(android.provider.Settings.ACTION_DISPLAY_SETTINGS),0)
        }

And you can also check the full list of Available Commands here

https://ourcodeworld.com/articles/read/318/how-to-open-android-settings-programmatically-with-java

Mudassir Khan
  • 1,714
  • 1
  • 20
  • 25
0

try LineAgeOS

https://lineageos.org/

Your requirement needs to access OS System level, this way you have access and customize the WIFI settings before releasing the phone itself

niXful-Autistic
  • 217
  • 1
  • 6
0

can you try this way.

WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
                if (wifiManager.isWifiEnabled()) {
                    wifiManager.setWifiEnabled(false);
                    Tools_WiFi.setImageResource(R.drawable.tool_wifi_off);
                } else {
                    wifiManager.setWifiEnabled(true);
                    Tools_WiFi.setImageResource(R.drawable.tool_wifi_on);
                }
Madhav Anadkat
  • 56
  • 1
  • 15
0

You can try this:

startActivityForResult(new Intent(Settings.ACTION_WIFI_SETTINGS), 0);

Hope it helps you.

GunSky7
  • 25
  • 8