I am looking in Google Assistant for Voice Action. So I started with android.intent.action.SET_ALARM action. When I run the application for the first time and went to Google Assistant- "Okay Google. Set alarm for 10 o clock". For that voice input Google have prompted two apps as follows,
Clock Application
Set Alarm Sample (My Application with set alarm action)
So, I selected my application and I got time and minute as well in getIntent().
My problem here is, When I say "Okay Google. Set Alarm for 10 o clock" for the next time. It is not showing those two apps like first time. It is directly launching last selected default app.
How to reset this preference?
You can go into the settings for your app. There should be a section for App Defaults. You can clear defaults and you'll get that prompt again.
Finally, I found out the answer on my own.
Long click the Action in Google assistance conversation page say for example "Set alarm for 10 o clock". Just long click this sentence. You could see following options,
Edit query
Delete Group
Just click "Edit query", it will redirect to next page. There google assistance will displays list of application receives "Set Alarm" Action. From there you can change the application you want to receive Set Alarm action.
I found another way. After asking Google assistant to set the alarm, I saw options at the bottom of the screen to set an alarm, reminder, etc. I pressed the option to set alarm. Then it prompted me with what time to set and showed the clock icon. I clicked on the icon of the clock it prompted me with selecting which clock to use.
Just say "Set Alarm" without telling the time. It will ask you the time. In that screen, it will show you the app it will be using to set the alarm. Click on that and change it.
Hope this is what you are looking for.
I wrongly chose Firefox for query "show me shopping list", which opens up shopping list.google in a browser. The following solution worked for me:
Query again the action you'd like to change
Scroll up for historical queries to see a tile where the action is mentioned.
Historical queries should be visible differently than the most recent one and the action is "detached" in the conversation balloon.
Simply tap the action section of the balloon. It will prompt to choose default application and a checkbox to remember the choice should be accessible.
Reset of the OS default setting does not have any impact. There are no default apps settings for different actions in the Google app settings, nor Assistant preferences.
Hope this helps you.
Related
I'm trying to handle a click event on the clock on the Settings Pane. I'm sort of confused on the terminology which isn't helping, but here's a screenshot:
I've got an app that I'm developing (If you're curious it's here: https://play.google.com/store/apps/details?id=com.fric.beethovenalarmclock&hl=en)
Anyhow, I'm really not sure what the button does. The default behavior seems to create a new alarm using the stock Google alarm clock. When I set an alarm on my app, though, it launches the intent for the wake screen. I'd like to be able to choose which activity in my app to launch, depending on whether sound is playing, or an alarm is set.
I couldn't find any documentation anywhere on what this button is or how to handle a click on it.
Thanks in advance!
Note: I haven't coded anything but looking for a structure/keywords or ideas how it can be achieved.
Use Case:
I have an activity which basically shows some display/data/or does some operation etc when opened manually from button click, notification click etc. Now I want to display the same stuff when a particular condition is satisfied [like my geo location matches that I force to be my home or user home].
1. without user clicking any notification,
2. without opening the activity,
3. without clicking buttons, and
4. without opening the app.
So in short, I want my app to be launched when I am home or reach a geo fence, is it achievable?
I am aware of Pending Intents, but seems they need the activity to be opened once and register the intent, let me know if this is the only way to go.
Kindly help!
when a particular condition is satisfied
This is not possible in general. For example, Android has nothing built-in with the ability to do something automatically based upon when your neighbor's cousin's daughter posts something on Stack Overflow. Even though that is a particular condition that could be satisfied, Android does not know your neighbor, nor your neighbor's relatives, nor the neighbor's cousin's children, nor the online actions of your neighbor's cousin's daughter.
There are specific things that Android can handle that offer the ability to give you control for related conditions, such as AlarmManager for getting control at certain points in time, or JobScheduler for getting control periodically when the environment is proper (e.g., we have connectivity and are on a charger).
Your question uses a geofence as an example. The Play Services SDK offers geofence APIs that you can use, that can give you control when the user enters a particular region.
I want my app to be launched when I am home or reach a geo fence, is it achievable?
You are welcome to call those geofence APIs, providing a PendingIntent that points to a WakefulBroadcastReceiver, which in turn points to an IntentService, where you can go do something.
If by "my app is launched", you mean bring up one of your activities, while that is technically possible using an activity PendingIntent, you may make your users very unhappy for interrupting what they are doing (e.g., collecting Pokémon). Please consider using a Notification instead.
I am aware of Pending Intents, but seems they need the activity to be opened once and register the intent
Nothing of your app will ever run until the user manually runs your app (e.g., taps on your home screen launcher icon) or until something else uses an explicit Intent to start one of your components. At that point, you can call the geofence APIs, assuming that you somehow know where the user's home is.
Most likely, you need the user to spend time in the activity simply to collect the data from the user about where they want the geofences to be established.
Being an amateur user, I just stick to basic operations on tasker like creating a zooper widget and toggling settings, running ussd. But I was thinking about interacting with output of the ussd code, I don't know if it is possible but I hope someone can clarify me on this..
I run the code ##4636## very often to force WCDMA through the test menu, it takes two clicks after dialing the code, 1. Tapping "Phone information" which is the first option.
2. Scrolling down a bit and opening a list named "set preferred network type" where I can select WCDMA ONLY.
Now can this whole thing be automated.
Note: The normal system settings where simply selecting carrier mode or toggling it through tasker doesn't work as I think my phone automatically switches the network to EDGE as soon as I enter my room and I must do this toggle manually through test menu(##4636##) even if the usual system settings say it's in 3g.
Thanks in advance..
To open the hidden menu, use following intent:
action: android.intent.action.MAIN
package: com.android.settings
class: com.android.settings.TestingSettings
and for clicking items I would highly recommend using AutoInput, as it gives you far more control than built-in tasker functions. It also has a very user-friendly "Easy Setup", that basically walks you through what (and) where needs to be clicked, based on either coordinates, id, label or position :)
So in case of selecting "phone information" using AutoInput:
add new tasker action
select plug-in
select AutoInput
select AutoInput Action
select Easy Setup to be guided through, or in Manual Setup enter following
Action: click
field type: list
field position: 1
and similarly for next items :)
I am trying to make an app where the user is shown a list of installed applications, each one in a separate check box. If an app is checked, and then later opened, how can I trigger an event when the app that the user selected is opened. I am a complete novice in this area, therefore code or tutorials would be appreciated, as I don't know where to start.
You want to use PackageManager getInstalledApplications() or getInstalledPackages() to get a list of installed apps.
I don't understand the following part of your question:
If an app is checked, and then later opened, how can I trigger an event when the app that the user selected is opened.
It sounds like you want to open the exact app which the user opens but that's probably not what you mean.
I am getting problem in my app .where i need to mark the particular Settings I have used the following code:
startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));
Its open the setting page but it does not mark the particular Entities.How could i get the automark option Could anybody help me out!!#Thanks
this is not possible, unless you have the rights and access the setting directly (not with an intent, but with the Settings class), and even though, I'm not sure you can.
What you can do is what google maps does. When your app starts, check if the gps is enabled, if it is not, display an alert notifying the user, with a button to quit the app, and a button to go to the settings screen. When the user comes back from Settings screen, test again.
If the action that you are trying to do was allowed then users would be very mad if some application would turn on their wireless connection or even worse the GPS sensor.
This change is available to change only by the user him self. So as mentioned the most you can do in case you need Internet connection or GPS sensor available is to present a user with the relevant message and fire an intent that will take them to the settings screen to change this setting them self.