How to run a 3rd party app in 'Kiosk Mode' - android

Does anyone know how to launch a 3rd party app in 'Kiosk Mode' i.e. to disable the System Bars, Home button, Back button etc while the app is running?
I'm writing an app from which the user can launch Skype to make a video call.
I want both my app and Skype to run in Kiosk Mode.
I have managed to get my app running in Kiosk Mode, but I can't work out how to control the system buttons when Skype is running.
Within my app, I achieve it by doing things like setting my app as the Home app, overriding 'OnWindowFocusChange' etc. There are a lot of articles on the web about how to do this kind of thing, but they all seem to be based on the assumption it's your own app you want to 'kiosk'
For what it's worth, I launch Skype with:
Uri uri = Uri.parse("skype:echo123?call&video=true");
Intent intent = new Intent("android.intent.action.VIEW", uri);
startActivity(intent);
I know it's possible to kiosk external applications because SureLock does it.
Any thoughts greatly appreciated.
Thanks
Damian.

Related

How can I launch a Samsung home screen shortcut via Tasker?

My security company's mobile app (CPI inTouch) allows me to create "scenes" which trigger multiple actions at the same time with a press of one button (e.g. disarming the alarm and unlocking the smart lock on my door). I've also added shortcuts to each of the scenes on my home screen (on my Samsung Galaxy Note9, if that's relevant) so I can launch a scene via the shortcut without having to go into the app itself.
However, having just purchased Tasker, I'd like to trigger the shortcut (or the activity in the app itself) programmatically in a Tasker profile or some other automation app. I've tried plenty of apps that allow you to trigger a shortcut based on an event, but none have these particular shortcuts in the list of available ones. I read that I should be able to use a Send Intent task in Tasker to do this, but I don't know what the intent string would be or where to find it.
In case you can suggest a different way to achieve this, the main use case so far is to have my alarm system automatically disarmed when my phone's morning alarm goes off.
First thing to check would be...
create new task to Launch App,
find your CPI app and if it has a "+" in top right corner of app icon you can long press it to reveal a list of activities.
if your app does not offer those options...
The Tasker dev also has a group of plugins under the AutoApps group, there is one called AutoShortcut that launches shortcuts.
edit: there are apps such as APK Analyzer that can show you the activities and services inside an app and whether or not they can receive intents from external apps.

Can I build an app that interacts with another app that I don't own?

New here. I still didn't decide which technology I'll use to make this app, but the main feature is basically this:
There's app A and app B (I don't own any of these);
My app (C) needs only one role: when I login on app A it'll logout on app B and when I login on app B it'll logout on app A.
Note: Forcing app A or B to close will not logout or in.
Anyone knows a way to develop this? The app is supposed to be available on Android and iOS, I was planning to use nativescript.
Any help will be appreciated! Thanks,
Diogo
Unfortunately not because every app run in its specific sand box for security reasons. The only way to do something like that it is using broadcasts intents but the apps A and B should already be prepared to respond to a intent to log out and send a broadcast when log in. Probably it doesn't happen.
In iOS, this won't happen as every app is running on different sandbox and there is no relation between two sandboxes.
Thank you for all your answers. Very useful. Can I use an app to close and open others? For example, If I open Spotify it automatically closes YouTube music using my app. This way would only have to do with the smartphone or tablet.

How to block or hide app access on Android?

I want to know from your experience what are the best practices for remotely block/hide Android App?
With iOS you can hide certain (or all) apps with iOS profile and push the profile to iOS using MDM Server (if iOS in supervised mode)
Some people suggest creating an android app that monitors the foreground app and creates an overlay on top of it. do you think about this?
Let me tell you briefly about this because i did these type of things in past.
We can hide only our app in user mobile,we can't hide other apps in user mobile but we can block any app in user mobile. For this you can use any way either statically or dynamically(via server)
Now the question is how ? So here is the answer
You need to run background and foreground both service. Now detect the app (package). It means you need to detect whether app is in foreground or in background.
So if the app is in foreground then you need to close/block the app.
Now the another question is how we can close/block the app ?
Suppose you want to close/block Facebook app in user mobile then use condition like
if (packagename.equals("com.facebook.katana"){
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
}
You need to use above code in service. Service will detect continuously whether Facebook app is in foreground or not. You can use timer or thread for this.
As soon as the service gets the Facebook Open then service will fire intent to Home Screen.
Above is the best possible way to close/ block the apps.
Thanks!
Do you plan to use it on your own devices?
If so, you can create an app that will be started when you boot the device that will control running tasks. And when you detect the app you wish to kill, the service will kill it. You can create remotely configuration about which apps you blacklist using Firebase RemoteConfig functionality. https://firebase.google.com/docs/remote-config/

how to simulate a button click on an app icon/shortcut

I wonder how it is possible to simulate a button click to launch an app through its shortcut? I have seen automation apps such as Automagic (perhaps also Tasker) do this.
Are they using AccessibilityServices? If yes, how would I call such a shortcut -do I use "performGlobalAction()"?
Edit:
What I really after is to emulate/simulate a click on a button or a shortcut which apps such as Tasker can do. For instance, Google Assistant cannot be opened programatically (see How to start Google Assistant programatically?) due to permission denail. However, it can be opened by clicking on a shortcut on the screen opened according to the following instructions: https://www.ytechb.com/how-to-get-google-assistant-on-any-android-lollipop-device-without-root/
With Tasker I can then add an action which opens this shortcut. Now I am wondering how Tasker does this programatically.
You can launch another android app by using an Intent. To get the launch intent for another application you can use the
Context.getPackageManager().getLaunchIntentForPackage(String packagename);
If this is not null, then the app is installed on the device and you can launch it. If you want to get a list of other apps on the device you can use
Context.getPackageManager().queryIntentActivities(Intent intent, int flags);
You can find more information of these by looking at the PackageManager Docs

How to know if my app has been launched by Ok Google for a fully hands-free interaction

I would like to know when my app has been launched by voice control ("Ok Google, launch MyApp") in order to present the users a different activity where they can interact using their voice.
The idea is "if the user launches the app using the Ok Google command, he probably wants a hands-free interaction".
Is there a way to know it? Intent categories and flags don't seem helpful.

Categories

Resources