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.
Related
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.
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.
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.
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.
I have a ListView, as well as a refreshListFromDB(String searchKeywords) method which updates the adapter.
I'd like to implement search, where pressing the search key on my device will pop up the standard search box (and on-screen keyboard if required), and pass the result (onKeyDown) to refreshListFromDB() - or is this considered bad UI design?
Search is a complex beast, so can anyone recommend any bare-bones examples? I don't want to use global QSB, as it's not relavent for my type of app. Do I really need to get into Intents, searchable XML, new activities, content providers etc?
I'd like to implement search, where
pressing the search key on my device
will pop up the standard search box
(and on-screen keyboard if required),
and pass the result (onKeyDown) to
refreshListFromDB() - or is this
considered bad UI design?
I don't know about "bad UI design", but the standard search box doesn't do what you say you want it to do.
Search is a complex beast, so can
anyone recommend any bare-bones
examples?
I used to have a bare-bones example, but that was before QSB, which added another pile of bones on top of the bones I had. You can still look at the larger pile of bones here, and the pieces you seek are described in (ahem) a book.
Do I really need to get into Intents,
searchable XML, new activities,
content providers etc?
To use the "standard search box", you need the first two in your list, and possibly the third depending on how you want to do it. I have both reused existing activities and created new ones in my search experiments. You will not need a content provider, though.
You could also have a look at the Searchable Dictionary Sample Application that comes with the SDK, although I think this does integrate with the Quick Search Box.