So I'm trying to implement a custom +1 button in an android app.
I have the standard PlusOneButton working - it shows the number of +1's but I can't read the number from it. And the PlusClient doesn't seem to have the ability to tell me the number. I tried Google+ REST API but it doesn't have this functionality either.
I know there's some hack that could get the number over a POST call but that already stopped working once and I can't rely on non-official stuff.
So: is there any way to get this number through the standard google-play-services.jar?
Also: is there a way to activate a hidden PlusOneButton when the user clicks my custom button? .performClick() doesn't work.
Thanks.
Related
Instead of saying "OK Google", I would like to open Google Assistant by clicking on a button in my own app.
So when in my app that button has been clicked, the user doesn't need to say "Ok Google". They will just simply press the button, then Google Assistant will start and then they can say whatever they want to say. Is that possible?
The activity action android.intent.action.VOICE_ASSIST can be used to search on the internet for specific keywords. For example, it can be said "What's the current date?", then this page will be opened, and the current date will also be spoken. Or you can ask anything. As long as Wikipedia is first listed on Google, a brief summary of Wikipedia's content will be spoken. If there is no answer from Wikipedia or from Google itself, the entry will be searched on the search engine of Google, but there is silence.
This is how it should be used:
Intent googleAssistant = new Intent("android.intent.action.VOICE_ASSIST");
startActivity(googleAssistant);
You can also use other actions. For instance com.google.android.gms.actions.SEARCH_ACTION, if you want to search for a place or android.intent.action.SET_ALARM to set an alarm.
However, this will not be the best answer since it will not work exactly the same as Google Assistant. So the entertainment part (e.g. "Tell me a joke") cannot be used.
References
Voice Actions Guide (Google Assistant)
List of Android Actions
As I see, a way to show default emojis on android is by using the following on an input text.
android:inputType="textMultiLine|textShortMessage"
When I search, I can't find a way to do this through Java. What I want to make happen is that when the soft keyboard is open, have the user tab a button to switch between emoji view and normal keyboard view.
Custom Emoji Keyboard.
I've already implemented this, but it would be much better to and lighter to use Emojis already on the device for post kik-kat.
Google does switch between this views.
On Google Allo, pressing the emoji icon inside the editText switch views.
TextView
Using TextView's input type does not contain what you want...
Keyboards
Seems you can show the user a list of available keyboards. (the ones that are available on that device)
And with that, see if it has an Emoji Key Board available. But needs at least Android 4.1 it seems.
Force Part of Key Board
Not possible as far as I can see. You can disable them, it seems.
*I would love to show how to do this, it looks like a neat thing to be able to do. But my google-fu does not show anything close :(
After trying for a while I didn't achieved this goal even injecting a keyevent.
Looking in Google Allo, that looks as a custom implementation. I have switftkey themed keyboard and on KitKat Moto G (1st gen) it's very remarkeable. I tested also on a Marshmallow Moto G (2nd gen) with native keyboard, but contracted, and you can see that isn't the real soft keyboard :
I think there is no way to achieve this without a custom emoji's implementation.
Maybe this will help you:
https://blog.swiftkey.com/tech-blog-android-input-method-subtypes/
There is something like an Emoji Subtype as you can see following the link below.
public static RichInputMethodSubtype getEmojiSubtype()
https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java
I want to make the first suggested line for every AutoCompleteTextView be what the user has currently typed, similar to how google search bar works in smartphones. How can this be achieved?
you have to store the value that user typed in sqlite or shared preferences first.
Then you can filter the value based on user's new search...
Take a look at this link: it uses a web service to load data
http://makovkastar.github.io/blog/2014/04/12/android-autocompletetextview-with-suggestions-from-a-web-service/
I have an idea for my application, but I don't how to go about implementing it. Basically, I have a chat application, but you're able to tell the application whether it's a happy or sad message. I drew it out to hopefully make it easier for you to understand. Can anyone provide me with any insight on creating this kind of effect?
Step one (Hidden):
Step two (User clicks face):
Step three (user clicks face and it disappears):
Try this library.
Tutorial here - http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
Library here - https://github.com/lorensiuswlt/NewQuickAction
Use QuickActionController. Find the source of the Control at https://github.com/lorensiuswlt/NewQuickAction.
You just need to shift the position of display towards the right at quickaction UI class. Your requirement will be met.
What is the purpose of onSearchRequested()? I am referring to here: http://developer.android.com/reference/android/app/Activity.html#onSearchRequested%28%29
The following is stated: "You can override this function to force global search, e.g. in response to a dedicated search key, or to block search entirely (by simply returning false)." Specifically, what does the bolded piece mean? Does it not mean that we are able to disable this button? I just had a heated discussion at: Android - How to disable Search button, how to implement onSearchRequested()?
As you can see, Phil is suggesting that I have to go the other route. My questions are: can JUST this function be used to disable the search button completely? Can just this function be used without having to disable this button from the dialog builder? What did google meant with the above quoted statement? Thank you for your time.
You should be able to disable the search button using it, i would think google mean that you can block someone trying to search from within your app( IE skipping a progress dialog)
but since most android phones don't come with search buttons anymore, its not a very used function.
and yes you should be able to disable it on the fly without going through the dialog builder.
Swift