Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

"Kiosk" mode with OF

$
0
0

Thanks for your answers...

Fresla : I've tested some of them, found only one that seems to work on a Kindle 5 but it is restricted of some kind of web browsing only (and I want to restrict it to an app), and the license cost is 50$ per device

Tallavi : I tried to follow the guide you provided - I'm not very comfortable with Java development - I added the required new Java classes from the guide but at some point it seems that the default OfApp behaviour needs to be modified which is far beyond my skills :wink:

The guide's author declare its app class like this

public class AppContext extends Application {

	private AppContext instance;
	private PowerManager.WakeLock wakeLock;
	private OnScreenOffReceiver onScreenOffReceiver;

	@Override
	public void onCreate() {
		super.onCreate();
		instance = this;
		registerKioskModeScreenOffReceiver();
		startKioskService();
	}

	private void startKioskService() { // ... and this method
		startService(new Intent(this, KioskService.class));
	}

	private void registerKioskModeScreenOffReceiver() {
		// register screen off receiver
		final IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
		onScreenOffReceiver = new OnScreenOffReceiver();
		registerReceiver(onScreenOffReceiver, filter);
	}

	public PowerManager.WakeLock getWakeLock() {
		if (wakeLock == null) {
			// lazy loading: first call, create wakeLock via PowerManager.
			PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
			wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
					| PowerManager.ACQUIRE_CAUSES_WAKEUP, "wakeup");
		}
		return wakeLock;
	}

}

I really wonder how this code can be plugged in OF android...


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>