# Android share target - alternative implementation

**URL:** https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994
**Category:** Tricks & Techniques
**Created:** [August 6, 2025, 1:04pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994 "2025-08-06T13:04:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lutzky](https://community.silverbullet.md/user_avatar/community.silverbullet.md/lutzky/32/624_2.png) [@lutzky](https://community.silverbullet.md/u/lutzky)
#### Post date: [August 6, 2025, 1:04pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/1 "2025-08-06T13:04:17Z")

</div>

I want to add SilverBullet as a “share” target on Android. This would allow me to send it pages I’m looking at, notes from chats, and others. I’ve requested a native PWA implementation in [#1090](https://github.com/silverbulletmd/silverbullet/issues/1090), but in the meantime I found an alternative.

[https://http-shortcuts.rmy.ch/](https://http-shortcuts.rmy.ch/) is an Android app that lets you set up a custom share target which sends an HTTP request. My config:

- Basic request is PUT to `https://my.sb.instance/Inbox/{dateSlashTime}.md`
  - `dateSlashTime` is a global variable (you can define it from the “basic request” dialog) of type Timestamp, with format `yyyy-MM-dd/HH-mm-ss`.
  - Altogether, this makes it compatible with the built-in “quick note” syntax.

- Request headers is `X-Sync-Mode` set to `true`, a la [https://silverbullet.md/HTTP%20API](https://silverbullet.md/HTTP%20API)
- Request body has `Content-Type` set to `text/markdown`, and request body set to `{quickNoteContents}`
  - `quickNoteContents is a `Text input`global variable, with Multiline enabled,`Allow Receiving Value from Share Dialogue`enabled, and`Data to Receive from Sharing`set to`Text only`.

- Authentication is set to `Bearer Authentication`, configured with `SB_AUTH_TOKEN` a la [https://silverbullet.md/Install/Configuration#Authentication](https://silverbullet.md/Install/Configuration#Authentication)
- Response Handling is set to display a Toast Popup

And that’s basically it! Now I can either go to HTTP shortcut directly from the app, from its shortcut menu (holding the app icon on the homescreen), or I can use the Share button in app to send a quick note to silverbullet.

To make these useful, I also have a bit of space lua; `inbox.notes()` shows everything from the inbox (I have this on my index page), and because I often just delete these notes directly from my mobile, I also automatically show a `Page: Delete` bottom on them.

```lua
function inbox.notes()
  local res = template.each(query[[
    from index.tag "page"
    where string.startsWith(name, "Inbox/")
  ]], template.new[==[
**[[${name}|${string.sub(name,7)}]]** - ![[${name}]]
]==])
  if some(res) then
    return [==[# Inbox notes
]==] .. string.trimEnd(res)
  else
    return ""
  end
end

local inboxBottomTemplate = template.new[==[This is an inbox page
]==]

local function inboxBottomWidget()
  if not string.startsWith(editor.getCurrentPage(), "Inbox/") then
    return nil
  end
  return widgets.commandButton("Delete this note", "Page: Delete")
end
  
event.listen {
  name = "hooks:renderBottomWidgets",
  run = inboxBottomWidget
}

```

---

<div class="post-metadata">

### Author: ![dklawren](https://community.silverbullet.md/user_avatar/community.silverbullet.md/dklawren/32/14_2.png) [@dklawren](https://community.silverbullet.md/u/dklawren)
#### Post date: [August 6, 2025, 3:23pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/2 "2025-08-06T15:23:37Z")

</div>

Thank you for this howto. This is one feature that I have been missing or a while although I did see the HTTP Shortcuts app, I never got around to trying it out. I have now set it up using your pointers and works great. Thanks again.

---

<div class="post-metadata">

### Author: ![ajain](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@ajain](https://community.silverbullet.md/u/ajain)
#### Post date: [August 8, 2025, 9:17am UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/3 "2025-08-08T09:17:38Z")

</div>

I really love this idea.

> [@lutzky](#):
>
> ```auto
> local function inboxBottomWidget()
> if not string.startsWith(editor.getCurrentPage(), "Inbox/") then
> return nil
> end
> return widgets.commandButton("Delete this note", "Page: Delete")
> end
> 
> ```

How do you get the command button to render?  
For me using this code results in the following output:  
 ![image](https://community.silverbullet.md/uploads/default/original/2X/0/04164eb06821e8e419591198a7b5cea2842ce9a0.png)

---

<div class="post-metadata">

### Author: ![lutzky](https://community.silverbullet.md/user_avatar/community.silverbullet.md/lutzky/32/624_2.png) [@lutzky](https://community.silverbullet.md/u/lutzky)
#### Post date: [August 8, 2025, 8:59pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/4 "2025-08-08T20:59:40Z")

</div>

Not sure why that doesn’t work for you. Try simply doing `${widgets.commandButton("Page: Delete")}`, that should work on silverbullet v2.

---

<div class="post-metadata">

### Author: ![ajain](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@ajain](https://community.silverbullet.md/u/ajain)
#### Post date: [August 11, 2025, 6:03am UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/5 "2025-08-11T06:03:16Z")

</div>

Hmmm. Just adding the command button works for me.  
Weird.

---

<div class="post-metadata">

### Author: ![schroederc](https://community.silverbullet.md/user_avatar/community.silverbullet.md/schroederc/32/3545_2.png) [@schroederc](https://community.silverbullet.md/u/schroederc)
#### Post date: [May 23, 2026, 8:40pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/6 "2026-05-23T20:40:27Z")

</div>

I really appreciated this tip. Thanks! It works fantastically!

The only thing that I added was a "Run on Success" script to open up the page immediately:

```javascript
openUrl('https://my.sb.instance/Inbox/' + getVariable('dateSlashTime'))

```

---

<div class="post-metadata">

### Author: ![jmfayard](https://community.silverbullet.md/user_avatar/community.silverbullet.md/jmfayard/32/3770_2.png) [@jmfayard](https://community.silverbullet.md/u/jmfayard)
#### Post date: [August 22, 2026, 8:56pm UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/7 "2026-08-22T20:56:39Z")

</div>

> [@lutzky](#):
>
> - Basic request is PUT to `https://my.sb.instance/Inbox/{dateSlashTime}.md`

Hello, with that URL I got an HTTP 401

It's missing /.fs per [HTTP%20API](https://silverbullet.md/HTTP%20API)

The corrected URL is:

PUT [https://my.sb.instance/.fs/Inbox/{dateSlashTime}.md](https://my.sb.instance/.fs/Inbox/%7BdateSlashTime%7D.md)

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [August 23, 2026, 4:56am UTC](https://community.silverbullet.md/t/android-share-target-alternative-implementation/2994/8 "2026-08-23T04:56:04Z")

</div>

For the record: the /.fs was not a thing around the time of originally posting this.
