Google search without the google search bar - java

I'm closing in on the ending stages of my application and ran into an unfamiliar problem. I was able to get a google search bar implemented into my application, however the search bar itself is not needed. When the user makes a selection from pre-selected items listed, I need it to send to google search engine without actually having the search bar on the application. Can anyone give me direction on this matter? Thanks you for your help

Use can just define the url like this, where X is the search.
https://www.google.se/search?q=X

You can just search directly via google REST API.
using something like this:
GET https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures
heres more information:
https://developers.google.com/custom-search/json-api/v1/using_rest

Just attach whatever it is you want the user to get search results for to the end of https://www.google.com/#q=
So if you want them to search for "butts", it'd be https://www.google.com/#q=butts

Yes! you can use EditText in your activity , then you can implements as google search bar , it is all possible by using Implicit Intent
In MainActivity :
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);String urlString= editTextID.getText().toString();
intent.putExtra(SearchManager.QUERY, urkString);
startActivity(intent);
i hope its helpful for everyone!!!!

Related

Execute Google Assistant programmatically

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

Add additional suggestion at top of AutoCompleteText suggestions

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/

Android action bar search view disable auto suggestions

I am using search view in action bar . My search is working perfectly in application. But just one problem. When ever i type a word. I see some device specific search suggestions pop up appear below my search view. I don't want these suggestions. I don't want any suggestions at all. Any help?
i had same problem that was solved this way:
if you are using
searchManager.getSearchablesInGlobalSearch();
than just delete this line it will work fine..

how to get a blank canvas on which I can write using stylus

I am creating a service application where in the person who uses the service fills his data and signs it
Now I want to create a blank page where I can take the signature of the client on the TAB itself. So please help to do this.How can I implement it.
I have refereed to this http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-Creating.html link but some how I am not able to work with it.
Please help.Thanks
You can do it using GestureOverlayView. Example in the links: http://www.intertech.com/Blog/android-gestureoverlayview-to-capture-a-quick-signature-or-drawing/
Specifically, create a GestureOverlayView in your layout xml file, then in your Activity class capture the gesture and save it as bitmap image.
Go through the developer API if you want to have specific function for your page, especially for events like Gesturing or Gesture Finish : http://developer.android.com/reference/android/gesture/GestureOverlayView.html
Hope that helps

What is the purpose of onSearchRequested()?

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

Categories

Resources