Implement QSB like suggestions in android app - android

I need to give a search box in my android app. As the user starts typing in the search text, I need to show him relevant suggestions. (As we see in the google-search widget on the home screen. If we see from the logs, com.android.quicksearchbox/.SearchActivity is started with android.search.action.GLOBAL_SEARCH intent and it searches in following: corpora:[web, apps, com.android.contacts/.activities.PeopleActivity]).
Only thing is I need the suggestions to be displayed from the web & my application DB.
Any idea how to implement this ? Do I need to implement my own SuggestionsProvider or can I directly use the native implementation? If so, how?

I think i figure it out myself.
Went through Searchable Dictionary code & QuickSearchBox code in android source.
Need two start 2 activities in a background thread. One will search for the search-term in my DB & other will search the same in Google. All the results will be seen in the suggestion list.
Google Suggest API provides suggestions as the user enters the text.

Related

How to make text input with dropdown suggestions using Flutter

I have just begun using Flutter to create a mobile app.
The first thing I need the app to do is to take an Address/location as input from the user.
I would like to use a text input field that once you start typing it suggests locations based on the google place API.
Sadly there is no widget to enable this out of the box, but it shouldn't be so hard to do. Google's places API returns results based on any text input, so you can just keep sending keystrokes until the user sees (and selects) their desired location. I've got the API working already.
Now I'm struggling with how to build the front end experience.
I was hoping to have a drop-down text field, but I'm not finding anything similar in the widget library.
My next best idea was an input field with a DropdownButton class next to it. I want to make the DropdownButton invisible (0 width) but programmatically make it drop down once the user begins typing.
Sadly I don't see any way to control the visibility of the Dropdown List, so I'm not sure this will work.
Does anyone have any better ideas?
Image of what I have so far but obviously this is not optimal:
It's probably late for an answer but I'll still post this in case anyone else is still curious about this.
If you have the API wired up then what might prove useful is this third-party package.
It's called Flutter Typeahead.
It's a generic input with dropdowns and the data can come from any API and not just the Google Places API.

Searching within my own application

So im building an Android application and want to include a search feature to let users use it instead of having to look through the apps many activities and pages. Cant seem to find any info on the best way to do this anywhere else. Thanks in advance
Ok so im building an app that will serve as a game guide for a popular PS3 game. Within the app will be many subjects and topics and i would like to give users the ooption to just use a search bar on the main screen of the app to search throughout the entire application and then provide them with a list of results that are clickable and take them directly to the chosen activity or place in the application. (Say it was an app for making whiskey, i would want them to be able to search on the main page for Jack Daniels instead of hitting buttons that navigate from Mainpage>American Whiskey's>Bourbon>Jack Daniels. )

Implementation of Search Dialog

I am developing an android app which requires search functionality.
My app contains action bar and I have search button on it. On click of search button, I want search dialog to appear on top and do some search for me.
I need help in implementing this.
I tried the Google I/O sched project, but its too complex for me.
Can anybody help me develop a simple search dialog.
Also, I want the search to have 2 search options.
I have 2 different lists containing different data. So, I want to make search on both these lists but separately.
Check out this twitter app, the search bar has 2 options, it can search from tweets or people, I want some thing like thatA.
Any help is appreciated.
Thanks
Just go through these two links they will give a basic idea of how to add a searching functionality in your application.The idea can then be extended to have search based on two buttons.
http://shapingclouds.com/2009/10/19/how-add-searchmanager-quick-search-to-your-android-application/
http://developer.android.com/guide/topics/search/search-dialog.html
After you have done with above two links go through these links.They will give you idea of Twitter application's search.You can then extend the idea to create your own search functionality.
http://www.vogella.de/blog/2010/02/15/twitter-android/
I hope this may help you.

Disable recent query suggestions in Android's global Quick Search Box?

I've implemented a ContentProvider to add custom suggestions to my applications Quick Search Box. It works great within my app. However I also included it into the global search and it works different there. Whenever I start a search in the global search and I select one of my suggestions, this suggestion is saved and presented the next time I open the global search. What I don't like is that my current suggestions are below the ones I clicked before.
Is there a way to disable this behavior?
I am currently thinking of integrating recent suggestions in my ContentProvider to provide both - recent and custom suggestions. Though I am afraid this will result in having the same suggestions twice - first from the global search and then from my ContentProvider...
Any advice?
I think you could try to create a custom SearchRecentSuggestionsProvider as described here.
From in there, simply return an empty cursor or null.
To answer my own question, it is possible by providing the SUGGEST_NEVER_MAKE_SHORTCUT value in the SUGGEST_COLUMN_SHORTCUT_ID column.
As usual this is described in the Android developer documentation here.

Android - custom quick search box

If you using Twitter for Android you can see that clicking on phone's hard search button brings fully customized quick search-like control. Now I'm not saying that it IS stock Android customized quick search but how would one build something like that?
I want quick search box behavior but I also want add some additional selectors (think Firefox search where on the left there's a dropdown to select search engine)
I suspect that clicking search brings another activity that just looks like a quick search. Now I know how to trigger search activity from the quick search but how to intercept quick box call and display your activity instead?
Where would I start with something like that? Any hints and pointers will be greatly appreciated
With no screenshot, I can't help terribly much, since I don't use the official Twitter app (I'm a Seesmic guy), so I don't quite know what you are talking about.
You can override onSearchRequested() to get control when the user requests a search in your activity. Return true to say you're handling the search yourself. Along the way, pop up whatever you like to allow the user to do a search.

Categories

Resources