derohimat / KioskMode-Android

Screen Pinning Android Lollipop with enable Device Administrator without Root needed
72 stars 22 forks source link

Some issues #1

Closed ravenet closed 6 years ago

ravenet commented 7 years ago

Hi, You have done a nice job and there are a few issues.

  1. after come back from second screen, I can access status bar
  2. from that I can access other settings and all apps that I need even I can delete you app

So I need those activities would be blocked can you help . Thank you

derohimat commented 7 years ago

You must set your app as Device Owner (without Google Account Signed In)

Screen Pinning Android Lollipop without Rooting set Your App as Admin/Owner, please open terminal

adb shell dpm set-device-owner net.derohimat.kioskmodesample/.AdminReceiver
ravenet commented 7 years ago

Hi,

I need to install in the actual device so I don't think I can access the terminal.

any other way. Thanks

derohimat commented 7 years ago

@ravenet for access terminal and execute that command you can access from your laptop, and access devices via ADB

hzshang commented 6 years ago

@derohimat I install app and then run code in Android Studio shell

 adb shell dpm set-device-owner net.derohimat.kioskmodesample/.AdminReceiver

but it throws error

Not allowed to set the device owner because there are already some accounts on the device

Can you help me? My android is 7.0,Thanks

RaziaSandhu commented 6 years ago

Not working always gives error even after factory reset. 'Not allowed to set the device owner because there are already some accounts on the device'

derohimat commented 6 years ago

@hzshang @RaziaSandhu it's because your phone actually already has device owner, you must remove it before run the command

derohimat commented 6 years ago

https://stackoverflow.com/questions/26561029/android-uninstall-device-administrator-using-adb

RaziaSandhu commented 6 years ago

I've tried all these solution but no success. I have no accounts and device admin is unchecked in settings.

RaziaSandhu commented 6 years ago

This code worked perfectly on rooted device, but not on simple devices.

derohimat commented 6 years ago

this is a reference, hope it will help you @RaziaSandhu since android 5.0 :

Android 5.0 Lollipop introduced two new ways to configure Android devices for a single purpose:

  1. With app pinning, the device user can temporarily pin specific apps to the screen.

  2. With lock task mode, a user can’t escape the app and the Home and Recents buttons are hidden. Additionally, lock task mode gives the IT administrator a more robust way to manage COSU devices, as discussed below.

detail from here.

https://developer.android.com/work/cosu.html#pinning

and here some reference too https://sdgsystems.com/blog/implementing-kiosk-mode-android-part-3-android-lollipop

RaziaSandhu commented 6 years ago

Need to root the device first?

RaziaSandhu commented 6 years ago

Thank you so much, it works without rooting. https://sdgsystems.com/blog/implementing-kiosk-mode-android-part-3-android-lollipop
this link helped me.

derohimat commented 6 years ago

@RaziaSandhu no need to rooting first. Just follow step by step.

OK, you are wellcome