CircleToSearch with multi search engine support for all android
Kotlin
Image Search Architecture
Overview
This app captures a screenshot, lets the user draw a region, crops the bitmap, and uploads it to multiple reverse image search providers. The results page is displayed inside a WebView with JavaScript and DOM storage enabled.
Flow
- Capture screenshot and display in
OverlayActivity. - User draws a region; the stroke’s bounding box becomes the selection.
- Crop the screenshot to the selection using
ImageUtils.cropBitmap. - Upload the cropped bitmap via
ImageSearchUploaderto the chosen provider. - If the chosen provider fails, try other providers as fallback.
- Load the returned results URL in
WebView.
Engines
- Google Lens:
POST https://lens.google.com/uploadfieldencoded_image. Response may be HTML with JS challenge. Parser detectslocation.replaceor noscript fallback link. - Bing Visual Search:
POST https://www.bing.com/images/visualsearch/uploadfieldimage. Redirect URL found inLocationheader. - Yandex Images:
POST https://yandex.com/images-searchfieldupfile. Redirect URL found inLocationheader. - TinEye:
POST https://tineye.com/searchfieldimage. Redirect viaLocationheader.
Error Handling
- Each uploader logs status codes and parsing paths.
- On upload failure or missing redirect, fallback tries other engines automatically.
WebViewis configured withjavaScriptEnabledanddomStorageEnabledto handle provider pages.
Logging
- Cropping rect and cropped size logged.
- Upload response codes, redirect parsing steps, and fallback decisions logged.
Performance
- Images resized to max side 1024px before upload; JPEG quality 85.
- Upload timeouts set to 15s.
Compatibility
- UI and interactions preserved.
- Engine list expanded with TinEye; existing selections continue to work.