Tutorials for simple Android search & what's necessary

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?


Asked by: Marcus898 | Posted: 20-01-2022






Answer 1

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.

Answered by: Victoria402 | Posted: 21-02-2022



Answer 2

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.

Answered by: Emma490 | Posted: 21-02-2022



Similar questions

android: any tutorials on creating menus for apps?

I need a very simple menu which probably contains only one or two items: settings/options, where pressing one of them should show some customer defined parameters (is it called dialog), e.g., number of results shown. Is there any good tutorial on creating such kind of menus? I've looked at the "notepad" example in android, it doesn't really help.


Does Google provide any Android tutorials that teach how to implement a Service?

Closed. This question does not meet Stack Overflow guid...


Tutorials for Flurry Analytics in Android ?

Closed. This question does not meet Stack Overflow guid...


How to read image's compress data (pixel data) from container file on Android? Are there tutorials for these?

File file = new File(fileName); Iterator iter = ImageIO.getImageReadersByFormatName("Reader"); ImageReader reader = (ImageReader) iter.next(); ImageReadParam param= reader.getDefaultReadParam(); ImageInputStream iis = ImageIO.createImageInputStream(myFile); reader.setInput(iis, false); BufferedImage myJpegImage = reader.read(0, param); How can i wr...


Are there any tutorials on how to create jpeg images or convert images into jpeg on Android?

1.myJpegFile = new File("images/jpegImage.jpg"); 2.output = new BufferedOutputStream(new FileOutputStream(myJpegFile)); 3.encoder = JPEGCodec.createJPEGEncoder(output); 4.encoder.encode(myJpegImage); Please could you give me the equivalent code for line no. 3 and 4 in Android?


Android NDK tutorials?

Are there any decent Android NDK examples and tutorials out there? Where can I find them? If there are any geared more specifically towards game engine development (as I am looking to convert mine over to android) that would be most helpful.


android - Good Custom View tutorials

So I want to create a view from scratch, I have a general idea on how to do it, but I would like to have some good reading on how to do it properly. Rather than reading the source code for a few days, I would like to find a good tutorial. The only ones I have located so far have been for extending subclasses of View, but I need to subclass View itself. If anyone knows of some good tutorials for this, some links would be g...


android - Are there any good Phonegap tutorials except for "Hello" stuff?


android - Contact Picker tutorials

Closed. This question does not meet Stack Overflow guid...


android - JUnit Tesing tutorials for newbies

Closed. This question does not meet Stack Overflow guid...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top