I'd like to write an app that monitors incoming SMS and notify me on the watch if the content of SMS contains a predefined text (e.g. "go home").
I know I can use the notification API to add an event. It will vibrate and show a small app icon on the watch. What if I want to use control API to flash LED and show the whole text and an image on the watch when it receives the SMS, how should I do?
It's very similar to the "Call handling" add-on. Can Sony open the source of "Call handling" for reference?
I think you have two options. Either, as you say, 1) implement an extension that uses both the notification API and the control API. Or 2) just implement a control extension.
For 1), you could add a custom action that starts your control extension using the START_REQUEST intent below. See the doAction1 method in the SampleNotificationExtension code. This would mean that a standard notification will be shown on the watch, then you will be able to present a custom view to the user, if the user clicks the custom action button.
And for 2), implement your functionality completely as a control extension and request for it to be started when you get the SMSs that is found by your filter. Drawback is that you need to present the SMS text yourself, which in case 1) is done by the framework for you.
START_REQUEST-intent example:
Intent intent = new Intent(Control.Intents.CONTROL_START_REQUEST_INTENT);
intent.putExtra(Control.Intents.EXTRA_AEA_PACKAGE_NAME, "your.package.name");
intent.setPackage(hostAppPackageName);
sendBroadcast(intent, Registration.HOSTAPP_PERMISSION);
Related
I am making a System which uses Bluetooth. But Bixby does not have Bluetooth API. So My plan was using Android Application and it catches notification then, send data by BlueTooth. But I recognize there is no Notification API in Bixby too.
So... Is there any idea to make a notification push by Bixby?
This feature is rather advanced. Here are some information that might help you.
Bixby is not allowed to edit contact or calendar other than using the already existing built-in capsule. Utterance example "add a meeting at 2 pm" would work fine already. There is no standard library for that.
If by "notification" you mean the pop up notification, there is a way to do so, but not directly from Bixby. The notification is an Android App notification that must sent by Android App. For example, let's call it MyEventApp and say you also have a MyCapsule. It is possible in MyCapsule using a deep link to request MyEventApp for a certain action (in this case, send notification or maybe schedule one)
For how to use deep link in Bixby please read https://bixbydevelopers.com/dev/docs/reference/type/result-view.app-launch as a starting point. There is also a github sample capsule.
The format for deep link (the payload-uri key in Bixby) depends on the MyEventApp and it's part of developer's responsibility to get the format correctly.
Please read carefully regarding https://bixbydevelopers.com/dev/docs/dev-guide/design-guides/design-principles.app-punch-out-policies Or your capsule submission might be rejected.
I'm developing a little app which needs to start a simple call and send some DTMF tones.
By searching on the net i found that the correct way for doing it should be the following:
Intent i = new Intent("android.intent.action.CALL",
Uri.parse("tel://" + number + "," + dtmfTones));
Now, my problems are 2:
I need to shut down the call after tones are sent.
If possible I would like not to open the default dialer.
My app only needs to perform the call and send the tones, so the user has nothing to do nor interact with and that's why I don't need to open the dialer, it can also be done in background. Is there a way to do those things?
Thanks all and sorry for my not perfect english.
EDIT1: I tryed this method and I performed a call to another mobile number I have under control. The tones are sent and you can listen them without any problem.
EDIT2: i found also some apps which uses an unusual sequence of "#", ",", ".". but it is still not working, any idea?
I tryed to perform the same call to the house number which has to reply (it's a security system) but it doesn't recognize them. I don't know what I'm missing.
I want to build an application that will serve contents to other applications.
Take as an example:
Using the native Messaging app to attach an image from my provider.
In order to be a provider, I have registered some intent filters to do that. I use the ACTION_GET_CONTENT with image/ MIME types.*
I noticed that in some devices this works as expected, picking the application from the list in the "complete action using" dialog.
However, some manufacturers, apparently seem to not comply with the Google "recommendations".
How can we register for the ones that don't?
I assume that some of them use implicit intent calls, is it possible to intercept also?
On the other side, if these intents are made explicitly, is it possible to "intercept" them and present the "complete action using" dialog?
1) If your question is "how to intercept intents with different (non standard names)" you can use the intent intercept app to find out the required intent-settings.
2) if your question is "how to intercept activities which were not made for being intercepted" i am affraid you cannt.
i used the (1) approach to find out how to intercept googles-android-2.2-calendar-show-event that is officially not supported in version prior to 4.0 but works (at least on my handset).
i have the (2) issue with googles-android-4.4-calendar-show-event" which should be interceptable but is not. it is interceptable interceptable in versions prior to 4.4.
Android's Intent class provides an API called setSelector. I am trying to understand it from the example given in the documentation.
I want to ask that why did Android need to add this API ? What was breaking in Intent before this API ?
My understanding from reading the references is that the problem this API is intending to solve is where you want to send a launcher intent for an app that meets some general restrictions. Say you want to match all apps that open .mp3 files, but you don't want to actually open an mp3 file, you just want to launch an app that supports that. In that case, you could create a generic ACTION_MAIN, CATEGORY_LAUNCHER intent, and set the selector to an intent with an mp3 mime type or data URI.
Before this API there would be no way to do that - if you wanted to target an app that supports opening mp3s, you would have to send an intent for an mp3, which could either cause music to start playing, or cause the music player to throw an error. Also, depending on the music player's launch mode, the launcher intent may return to an existing instance of the music player, while the mp3 intent might create a new one.
According to my understanding, it gives choice to user which intent he wants to select. In that documentation they have given that it gives selection of intents whether user wants to open app's main activity or wants to launch any diff app/activity other than user's app. This is what i understood from that documentation. Check this links for your reference : https://code.google.com/p/android/issues/detail?id=67162 & http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4_r1/android/content/Intent.java#Intent.setSelector%28android.content.Intent%29
As part of the free SmartWatch promotion I got a watch from Sony and have published an app for it. It is called SoundCheck and is found through the LiveWare Manager on the Google Play Market. A customer recently sent email for support. They installed Sound Check but did not see it on the watch since widgets are not enabled by default when they are installed. Is there any way to programmatically enable a widget when an app is installed? It might be nice for users if the widget was enabled by default rather than force them to navigate through the LiveWare manager to find the setting. This would be quite helpful for "widget-only" apps like Sound Check that do not have a control extension.
This week I created a pro version of my SmartWatch app to actually change the values displayed by the widget. Is it possible to open a control extension from a widget extension? Here is the use case. Short taps navigate through different screens of the widget. I want to use the long tap event type on the widget to open the 'editing' function in the control extension. Is this possible?
Thanks in advance for your help with these questions.
The question of how to enable a widget programmatically is still open. Here is code to open the control from a widget. This answer helped:
How should I do to start SmartWatch Extension from the program code?
if (type == Widget.Intents.EVENT_TYPE_SHORT_TAP) {
updateWidget();
} else {
//this code will launch the control and allow the user to change volume settings?
Intent intent = new Intent(Control.Intents.CONTROL_START_REQUEST_INTENT);
intent.putExtra(Control.Intents.EXTRA_AEA_PACKAGE_NAME, "com.mezcode.soundcheckpro");
intent.setPackage(mHostAppPackageName);
mContext.sendBroadcast(intent, Registration.HOSTAPP_PERMISSION);
}