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

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.

Related

How to make an app lock application with pattern,or password

i'm working on applocker application, i have listed all the apps with app icon ,app name and a checkbox to select the app ,now my requirement is when user checks the checkbox, app should be locked with a pin or pattern. I have given the usage access permission. now, how can i achieve the remaining process like monitoring apps, to show the pattern screen.
Your best shot at this would be to build a custom launcher app.
Then you have control over which apps the user sees, and how to open them. You can implement this pattern/password logic by yourself before opening the apps, and have another activity with the list of apps and checkboxes.
As a starting point, take a look at some open source android launchers like Lawnchair

How to determine which Apps are launched most by the user?

I am trying to build a sort of launcher.
I would like to have the possibility to present to the user the apps he uses most.
Is there any way to determine which Apps are launched more often by the user?
I am not aware of any system "counter" that does that, and I have found nothing in the documentation and in SO.
There is no way to get this information from the OS, because of privacy concerns. You can start collecting this information when people install your launcher and start using to launch apps, because you'll know which apps they start, but you have to start with some common list of apps initially, which likely will be useless to your users. You can also import their current home screen from the Launcher (and TouchWiz, and HTC Sense), but that does not scale easily for all possible launchers people might be currently using (Nova, GO Launcher, Facebook Home, and so on).
If you are creating an Android launcher, then you are responsible for displaying the android Applications installed and while clicking on the application icon that you listed, you are the one who is opening up the clicked app. So you can keep the count whenever you open a particular app and do accordingly.
Whenever you open an application, just save an open counter against the application package name of the app that you opened.

Android: Prevent users from launching apps or using the OS

Is it possible to have an application run on a device in such a way that it is the only application that can ever run and also prevent the user from using the operating system at all? Tapping on the Home key or Back button would not exit the application and allow the user to have access to anything. If the device boots up, only this application would run.
This would be desirable in situations where devices are installed at a business for point of sales purpose or possibly where the device acts like a terminal in public places.
You can achieve what you're describing by writing your app to replace the home screen (Launcher). From there, you control what other apps will run.
The Android SDK has a working Launcher project you can start from.
Be careful to allow some method of running a more powerful app (even if it's just enabling ADB access) -- otherwise you could leave your device in a state of needing a factory reset before it can be modified.
Yes, you can override the back and home button behaviour.
Start app, override all buttons, and the user cant exit the app, evil, but should work in your scenario.
info here

Android: How to control the home button

We're trying to provide an application to the mentally and physically handicapped daughter of my neighbor that let's her use an Android tablet as a Talker, i.e., she presses a few big buttons and the devices generates speech. The application is basically a WebView and an additional object in Javascript used to perform and control the speech generation, plus some logic to handle the orientation changes. Html files are generated offline for her specific layout of the talking items. We've also added some music playing and picture viewing facilities to make the device more appealing to her.
Problem is that the home button brings her back into the madness of the Android launcher screen, and that on the test device (Archos 70) the home button is not a physical button but rather shown on the touch screen itself, making it too easy to accidentally hit it.
So I'd like to return to the Android launcher only by pressing a sequence home, back, home with no other action in between.
Can I achieve this by making my application itself the launcher? How can I then get back to the original launcher upon the home, back, home sequence? It seems that this goes deep into the innards of Android, huh?
The only clue I found so far is Overriding Home button for a Car Home replacement app, but this is rated -1 and reported to work in the emulator only. Also I doubt if I could completely abandon the original launcher, as otherwise there is no access anymore to e.g. the USB mass device control to allow new HTML files to be downloaded, the application to be killed and restarted, and so forth.
I'm willing to go for a kludge as well. Maybe a background service could be started that would bring the application to the front again as necessary?
The Home button cannot be overriden. You can write an application that responds to the home intent (that's what a launcher does) but that's all.
Can I achieve this by making my application itself the launcher? How can I then get back to the original launcher upon the home, back, home sequence? It seems that this goes deep into the innards of Android, huh?
Yes. Not too deep into the
innards. You can manually start a launcher by specifying the component, note that this may vary from device to device and user to user, if you're just using this privately you could hard code it, but if you release it you must allow the user to specify their real home app.
/* This should come from a preference that let's the user select an activity that can handle the HOME intent */
String packageName = "com.android.launcher";
String packageClass = "com.android.launcher2.Launcher";
Intent home_intent = new Intent(Intent.ACTION_MAIN);
home_intent.addCategory(Intent.CATEGORY_HOME);
home_intent.setComponent(new ComponentName(packageName, packageClass));
home_intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
/* Here you should catch the exception when the launcher has been uninstalled, and let the user save themselves by opening the Market or an app list or something. Users sometimes use root apps to uninstall the system launcher, so your fake launcher is all that is left. Might as well give the poor user a hand. */
startActivity(home_intent);
Detecting home/back/home is a bit awkard because home won't come as a onKeyEvent but instead as a new intent. Simply long-pressing the back button then display a prompt is probably a safe/good approach.

Android phone as a dedicated device

We want to use Android mobile for dedicated application. Can somebody suggest how can we make it happen.
Here are the requirement:
The phone when started, should launch our application., so the user cannot launch any other application. The application will be a 1D barcode reader.
The application should be live as long as the phone is up and running, user cannot close the application at all.
Thanks for your help.
Regards,
Manish
Android after boot is complete sends a bradcast intent:
android.intent.action.BOOT_COMPLETED
if you listen for this intent, you can launch a service that in turn launch your activity.
In the Activity you have to take care of the user's interactions that explicitly close the activity, like home button, back button and camera button press.
Setting your activity to be full-screen also should prevent the user to use the notification bar to interact with notification like those from market-app that can close your activity.
Finally, your activity can be killed by the system by various and uncatchable reasons: in those cases, the service that first launched your Activity comes in handy, as it can periodically monitor the general state of the application and relaunch components as needed.
Check out the new Android Enterprise solutions for your use case.
https://developers.google.com/android/work/overview
Its well documented. You can either use
Android Management API to provision the devices and apply policies to the device which will be applied to the device using Android's Device Policy Controller (DPC) or,
Use Google Play EMM API and develop your custom DPC
It depends upon your use-case really, but the first solution set should serve your purpose
I'm afraid there's no single answer to this, but you need to work on multiple fronts.
One of these fronts is preventing user from running other applications: for this there are applications sold on Android Market that can put other apps of your choosing behind passcode.
You need to combine this with automatic launch, but I don't yet know how to do that.

Categories

Resources