Skip to content

Forward search queries to websites or other Apps.

Hi all,

I would like to propose a new feature for the search in fdroidclient.

The feature I have added allows the user to forward search queries to external sites or apps, for example to Google Play or the web browser.

The intention behind the feature was that getting "No applications were found matching ..." as the only search result is somewhat disappointing. Especially, when you know that the app your are looking for exists (within F-Droid?). Since the search function in the client is not really intelligent (no offence 😉) it also does not return any results when one misspells an app's name or is searching by a keyword that is not present in the database. While enabling the search to handle typos in the query should be possible to some extend, making the search "intelligent" and return correct results for keywords that are not part of title or description is somewhere close to impossible. At least without a much bigger knowledge base...

Therefore, integrating an option that lets the user select an external search would improve the user experience (no more "No app"-one-ways) while keeping changes to the code relatively small.

Destination of a forwarded search can be any URI in which the search query is part of the URI (e.g. the query string).

Note: The code is already working (as in: it does what I expect it to do and does not break anything else) but there are still unnecessary debug outputs, etc included and the code itself could be cleaned up a bit. Maybe some wired error cases are not handled (I did not find any while clicking around...)

But since I don't really know when I will find time to finish it, I decided to open a merge request as long as it is in sync and can be merged in cleanly.


Changes to the user interface

  • New menu item "Manage external search sites"
  • Management Activity for the search sites, it allows defining new sites, editing existing ones and deleting them
  • Added tabs to the SearchResult Activity. The first tab is the "normal" list of search results, the second one the list of external sites.

Changes in the code

I tried to stay as close as possible to the style and structure of the existing code and to reuse as much as possible. Some parts of the existing code I copied into the new classes to allow independent changes. Some functions I factored out into the Utils class.

I reused the TabManager for the tabs in the search results. This change also required a new TabSelectionListener interface, that is now used by the FDroid main app and the SearchResults.

External search sites are managed in a new database table "fdroid_external_search". An initial set of search sites (Google Search, Play Store, Amazon Store, DuckDuckGo) is added initially to the database.

The Database version in the code is set to 52, the code assumes 52 to be the version that introduced this feature.

Edit: reduced image size and moved them out of the text

results_external_tab_small results_no_apps_small complete_action_small menu_item_small edit_site_small

Merge request reports