Repository navigation
Description
Problem
ShareDing accepts links from other apps via the Android Share menu (ACTION_SEND), but it is not registered to receive the web-link ACTION_VIEW intents used by “Open with”. A caller that offers only link opening cannot hand a URL to ShareDing through that path.
Proposal
Add a separate Android entry point for ACTION_VIEW on http and https, alongside the existing Share and Direct Share targets. Choosing ShareDing for a link should save the URL as a bookmark, as Share does today, not render the web page or turn ShareDing into a browser.
Take the URL from the intent's data URI, validate it and strip known tracking parameters via Urls.bookmark, then reuse AppContainer.queueLink. Save locally first, without a title, show the existing result message, and return to the caller. Do not open the Add Bookmark form, load the target page as part of the handoff, or request a change to the user's default browser. Existing bookmark sync (including short-link handling) is unchanged.
A matching ACTION_VIEW filter alone does not prove that a user can select ShareDing: Android's routing rules send generic web intents for unapproved domains to the default browser on Android 12 and later. Verify the actual selection flow on-device. If Android does not offer a usable selection path without changing the default browser, document that limitation before shipping; a package-targeted test alone is not evidence of chooser availability.
Release candidate and device verification
The owner requested merging and publishing an RC now. Verification of the system chooser and default-browser routing on Android 10 and a current Android version is deferred to the installable RC; the initial emulator instrumentation attempt stopped before assertions. ShareDing 0.5.0-rc.1 is published with the implementation from #58. Keep this issue open to record device results.
Acceptance
- From another Android app that uses the system's app selection for a web link, selecting ShareDing passes the URL to the save flow. Verify HTTP and HTTPS, and record the observed selection behavior on Android 10 and a current supported Android version (including what happens on an ordinary tap with another browser set as default).
- Opening
https://example.com/article?id=7&utm_source=test#sectionthrough ShareDing queues onlyhttps://example.com/article?id=7#section. It works offline and with no server configured, does not open the Add Bookmark form, and gives the same result feedback as Share. A repeat reportsAlready in queuewithout adding a second row. - An unsupported scheme, malformed URL, or missing data URI does not create a bookmark. The incoming intent does not read Share extras as a substitute for its data URI.
- The existing single
text/plainShare target and Direct Share behavior remain unchanged. Add Android intent regression tests covering the new entry point, validation, and queue behavior; add R35 and its verification scenario and test references to the spec, and document the user-visible entry point and any platform limitation in the README.
Code (main at e8c79a75e69378757e3ce31626a413f049f549d2)
app/src/main/AndroidManifest.xml:16and:27— the launcher and the existingtext/plainShare entry point; neither declaresACTION_VIEW.app/src/main/java/org/evsyukov/shareding/ShareActivity.kt:68and:77— Share parses its own intent and then calls the common queue path.app/src/main/java/org/evsyukov/shareding/ShareDingApplication.kt:90—queueLinksaves locally and returns the common result message.app/src/main/java/org/evsyukov/shareding/network/LinkdingApi.kt:45and:51— useUrls.bookmarkon the full data URI;Urls.sharedTextis for extracting a URL out of shared text.app/src/androidTest/java/org/evsyukov/shareding/ShareIntentTest.kt:90— existing assertion for exactly one Share target.docs/specs/share-to-linkding.md:13and:44— R1 and R33 describe the existing Share and Direct Share behavior to preserve.
Activity