Terence Eden’s Blog<p><strong>Share Android Apps on Twitter (or anywhere else)</strong></p><p><a href="https://shkspr.mobi/blog/2010/07/share-android-apps-on-twitter-or-anywhere-else/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">shkspr.mobi/blog/2010/07/share</span><span class="invisible">-android-apps-on-twitter-or-anywhere-else/</span></a></p><p></p><p>I attended the Mobile Monday meeting "<a href="https://web.archive.org/web/20100731020119/https://www.ibegyourparton.co.uk/2010/07/20/mobile-monday-london-write-up-%E2%80%93-%E2%80%9C200000-apps-where%E2%80%99s-mine%E2%80%9D/" rel="nofollow noopener" target="_blank">200,000 Apps - Where's Mine</a>" last night.One thing that became clear is that apps don't do a very good job of promoting themselves. One crippling problems with most app stores is that there's no (easy) way to share an app with a friend.</p><p>Here's some basic code for an Android app which will post the URL of your app to Twitter. Stick it in a button or menu item for easy sharing.</p><pre>String twitterUri = "http://m.twitter.com/?status=";String marketUri = Uri.encode("http://example.com/?q=app&title=test");Intent shareOnTwitterIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(twitterUri + marketUri));startActivity(shareOnTwitterIntent);</pre><p>Some important things to note.</p><ol><li>This is set to post to the <em>mobile </em>version of Twitter. Your user is on a phone - don't direct them to a site that won't work on their device.</li><li>The second string is <a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow noopener" target="_blank">URI encoded</a>.</li><li>Consider if you want to post a "market://" link. I would advise against it. Twitter won't render it as a link and, even if it did, 90% of users won't be able to click on it. Make it a link that will direct desktop users to your website, mobile users to a mobile friendly site and Android users direct to the market.</li></ol><p>Facebook also has an <a href="http://www.facebook.com/share/" rel="nofollow noopener" target="_blank">API</a> for this sort of sharing.</p><pre>http://m.facebook.com/sharer.php?u=example.com&t=test</pre><p>Again, it points to the mobile site and needs to be URL encoded.</p><p>Happy sharing!</p><p></p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/android/" target="_blank">#android</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/api/" target="_blank">#api</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/mobile/" target="_blank">#mobile</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/sdk/" target="_blank">#sdk</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/sharing/" target="_blank">#sharing</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/sharing-is-caring/" target="_blank">#sharingIsCaring</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/twitter/" target="_blank">#twitter</a></p>