Insert App option to call logs - android

I am developing an App that need to have an option or should i say a link when user gets the properties or menu list from call logs i.e when a user long press on an entry in call logs of phone. I have trying for hours now but not getting any useful information in internet. Please help.

Adding options to context menus of other apps is really not possible. For your example specifically if you see the Contacts app over there is made by Samsung and this may vary for other OEMs and it is totally up to them how they decide to design their user interactions within their apps.
Another point to this discussion can be related to apps like WhatsApp whose options (like calling) appear in the Phone app itself. This is because it has registered itself as having that ability in its <intent-filter> and the Phone app itself shows all apps with that ability. However, you cannot decide what options the default Phone app shows.

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

Google home to send card to the Google Home app

I made a small Google Home App and my service returns a response with a SimpleMessage + Card.
It works perfectly when running the app in the console.actions.google.com simulator. I get the card all good.
But when I test talking to the Google Home, it only sends the text, no trace of the Cards anywhere.
However If i talk to the Google home app on my phone, it does send the card correctly.
Is there something to enable to be able to receive cards sent by Google Home? Is it possible at all?
There is no way to make cards that were sent while the user is talking via Google Home visible, but there are several techniques that you, as a developer, can use if cards are necessary.
First of all - good design suggests that cards should be use to supplement the conversation, not be the focus of the conversation. Make sure the voice conversation itself is important and use the visual elements only when necessary. If your action is overly visual - it may be better suited as a mobile or web app, rather than an Action.
If your device requires a screen, then you can set this in the Action Console when you configure your question. This will, however, prevent it from being used on a Google Home device.
If you don't want to go this route, and want to allow it to be used on a smart speaker, but still take advantage of a screen where it is available, you have a few options.
First is that you can just send the cards. As you've discovered, they won't show up, but they won't cause any problems.
If you want to act slightly differently if a screen is available, you can check for the surface capabilities that the user's Assistant is capable of at that moment. If you're using the node.js library, you can have a command such as
let hasScreen = app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)
to determine if a screen is available and take action based on the variable hasScreen. If you're using JSON, you need to check the array at surface.capabilities or data.google.surface.capabilities to see if "actions.capability.SCREEN_OUTPUT" is one of the available surfaces.
If not, and you get to a point in the conversation where you feel you need to send a visual result, you can also request to continue the conversation on a device that does support screen output.
First, you'll need to make sure that they have a screen available. You'll do this with the node.js library with something like
const screenAvailable = app.hasAvailableSurfaceCapabilities(app.SurfaceCapabilities.SCREEN_OUTPUT);
or by checking the availableSurfaces.capabilities or data.google.availableSurfaces.capabilities parameters in JSON.
If one is available, you can request to continue the conversation there with something like
app.askForNewSurface(context, notif, [app.SurfaceCapabilities.SCREEN_OUTPUT]);
where context is the message that will be said on the Google Home, and notif is the notification that will appear on their mobile device (for example) to let them continue the conversation. If using JSON, you'll need to use a actions.intent.NEW_SURFACE next intent.
Either way, the user will get a notification on their mobile device. Selecting the notification will start up the Assistant on that device and your Action will be called again with parameters that let you check if they are on the new surface. If so - you can send the card.

Installing multiple apps inside a master app in android and showing only master app

This is the first question I am asking on stack overflow so go easy on me.
I have been assigned the task of building a large android app and I have thought of the following architecture owing to the large size of the app:
There will be a master app that user will download from the play store and this app will have symbols of multiple apps which user will have to download when she will use it for the first time. And only those sub-apps will run which user will use at the particular instant.
The problem is that I don't want to show the sub-apps in the user phone i.e. I want to hide all those small apps and want to show only the master app.
Is it possible? I am not able to find anything on Google.
There are two main places where apps show up: the home screen (particularly its launcher), and the Settings app.
You cannot hide these "smaller apps" from the user with respect to the Settings app.
However, you do not necessarily have to have an activity in those "smaller apps" that has the MAIN/LAUNCHER <intent-filter>. In that case, the home screen's launcher will not show any icons for those "smaller apps".
Your "master app" would need to know how to start some activity associated with each "smaller app", such as via a custom category (instead of android.intent.category.LAUNCHER use com.kia.intent.category.SMALL_APP_LAUNCHER or something).

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.

Prevent Android application from starting

I have read many question about whether it is possible to prevent an Android application from starting, but all of the answers seem to be "no, you cannot".
The idea is very simple: we want the user to be able to use a restrited set of applications that will be preinstalled on his mobile device. If the user tries to start a non authorized application, he will be prompted with a dialog asking for a PIN. If he enters the right PIN, then he will be able to run the application. Otherwise, the application will not be run.
As I said before, all the answers that I could find out there fall into two categories: "you can't do that" and "you can do that by writting your own launcher application".
However, I have seen applications such as ZDBox, which allow you to do just that. That is, with ZDBox you can define "non authorized" apps, in such a way that if the user tries to start one of them, he will need to enter a PIN to actually start the app. If he fails to provide one, the app will not start. The funny thing is that ZDBox does not require root access to do this.
So my question is, how can we prevent other apps from starting, just as ZDBox does?
Option 1
All the examples I've seen involve running your app as a Launcher/Home Screen replacement. This is how all the child lock style apps I've used work. This has the advantage
Pressing Home button doesn't leave the app
You have control of app launching
You can check out the android Launcher2 code to see how the Android launcher works. https://android.googlesource.com/platform/packages/apps/Launcher2.git
Option 2
There does look to be one alternative that I can see. In that you can try and read the logcat entries to detect when a blacklisted app is launched or brought to foreground and then launch your app over the top.
Similar to how they detect an app launch in How to detect when the user launches another app? (Android)

Categories

Resources