Sunday 9 October 2011

Adding a Share Button to Your Android Apps

The share button and list for one of my apps.

I recently approached what I assumed would be the simple task of adding a share button to my Android apps. While the implementation is indeed simple, I was disappointed, yet again, by the lack of easily digestible guidance online, for what must be a very common task.

Anyway, for anyone in the same boat, here's what I learned. For my purposes I only needed a very basic implementation, so it may not be sufficient for your own applications - it should give you the generic outline in any case. For more specific guidance see my Mobiletuts+ tutorial - Android SDK: Implement a Share Intent on the subject.

Share Intent

To create a share button you have to start a new Intent, passing it the SEND action. When the Activity for your SEND Intent starts, it will present the user with a list of possible channels to share the content through. What each user sees will depend on their own device setup, but it will typically include email, Gmail, Twitter, Facebook, text messaging etc. You will almost certainly have seen the share button in action as an Android user, for example in the browser program.

Here is a basic outline of the code involved in instantiating a share button with the chooser list:

//create the send intent
Intent shareIntent = 
 new Intent(android.content.Intent.ACTION_SEND);

//set the type

//add a subject
 "Insert Subject Here");

//build the body of the message to be shared
String shareMessage = "Insert message body here.";

//add the message

//start the chooser for sharing
 "Insert share chooser title here"));

The code first creates an Intent with SEND as the action. The "setType" method allows you to choose a MIME type for the content being shared, such as plain text or HTML. The code here features two calls to the "putExtra" method, through which you can set various elements of your share item, subject and text content in this case. Finally, the code starts the Activity using the Intent sharing settings indicated, instructing Android to create a chooser list allowing users to pick a sharing medium.

There are other options within the sharing implementation, and you can obviously alter the parameters, method calls etc. to suit your own apps. What options you pick really depends on what you're sharing.


Bear in mind the fact that certain aspects of what you set using "putExtra" will be irrelevant for certain sharing channels. For example, if you choose to set a title like I have, it won't appear if the user opts to share using a text message. Also, if you want your users to share using Twitter, remember the 140 character limit.

It's actually tricky to create sharing content that will suit all of the possible messaging services. If you don't want users to choose from the list of options you can bypass that part of the process, but that means you have to create a button or other user control for each messaging service you want users to choose from.

As well as providing the highest level of choice for your users, in my view it's best to use familiar interaction where possible, and Android users are by now accustomed to the sharing chooser list. The downside is that you need to keep your sharing content pretty simple and standard.

For my apps, I was tempted to include a Twitter hashtag in the share content, since it suits my content, but clearly it would be redundant for users sharing through services other than Twitter. Obviously users can edit the content before going ahead and sending it, but it would be poor practice to include a load of guff the user has to delete each time they want to share something. I've seen some apps in which the developer has crammed a load of publicity text including links etc. in with their sharing content - tempting, but not to be recommended from a usability point of view.


Hope that proved useful to some people, here are some related resources:

Please feel free to add any of your own tips for sharing in Android apps.

Update November 2011
I've written a tutorial on share buttons for Mobiletuts+ Android SDK: Implement a Share Intent which goes into more detail.

Friday 29 April 2011

Android Market Comments and Ratings

As with all Internet and digital discourse, trolls seem to be a part of reality in the Android Market. Some thoughts on the Android Market comments and ratings I've received to date.

My Android apps are pretty niche, and I'm fully aware that they will only ever appeal to a small number of geeks like me. In the future I intend to develop apps that are more likely to be useful to a wide variety of users, but the apps I have on the Market at the moment are pretty odd.

However narrow their appeal, I've always tried to indicate very clearly what my apps do in the descriptions within their Market listings. I naively assumed that people who had no interest in the functionality my apps provide would not download them in the first place, but this appears to have been a mistaken assumption. Lots of my reviews seem to be from people who have absolutely no interest in what my apps do (which is clearly indicated in the descriptions) but who have for some reason downloaded them and subsequently given them a poor review.

While I've always been aware that a certain element of nastiness is standard within any Internet based review system, and know all about trolls and trolling, I must admit I've found my own feedback a little demoralising at times.

Here are a few choice 1 star reviews (the minimum possible rating) I've received for my Nonsense app, which is free by the way:

  • "Does what it says. However its nonsense."
  • "Does what it says...NONSENSE!!!"
  • "Boring, tis nonsense but not funny at all"
  • "this game sucks!" //nb the app is not meant to be a game
  • "Stinks!!!!"
  • "This the dummiest crap ever!!?? It is not wat I wanted."
  • "Stupid.. don't download"
  • "Gay!"
  • "Not amusing at all."
  • "Wow...waste of 4 sec. Of my life."
  • "Laaaaaame! Don't do it"
  • "Dumb...Uninstalled."
  • "i agree this is stupid and pointless"
  • "Crap...don't waste ur time downloading.... lame"
  • "Horrible, very stupid"
  • "Its stupid!!"
  • "Super lame."
  • "Worst app EVER!"
  • "The shittiest app I've ever seen"
  • "Boring pointless etc worst app ever do not download this..."
  • "Rlly retarded"
  • "Dumb!! Nothing good at all about this.."
  • "Pointless and stupid."
  • "This sucked! Waste of time!"
  • "Sucks"
  • "Terrible."
  • "I hate it"
  • "This is the most stupid thing ever don't get this!!"
  • "Why anyone would want this is beyond me!"
  • "This thing is almost as fun as going in the street and smashing your balls in with a hammer. This comment is officially better than this app"
  • "This sucks and it makes NO sense at all! Removing app" //nb the app is called nonsense
  • "This was a waist of time and space. I mean there are some bad aps out there but this one is the worse of all"
  • "Zzzzzzzzz...boring on ov de worst games ever"
  • "Its F***ING stupid"
  • "Pointless...don't get it uninstalled. How do u even play this game?"
  • "Title is accurate. Don't waste time downloading this."

Just to explain, all the app really does is generate nonsense sentences. There's a bit of linguistic geekery involved in that the structures are grammatical and meaningless, but essentially it's just a bit of fun. The free version was my initial foray into Android development but in more recent months I've created a couple of slightly more sophisticated paid versions (including a sweary one).

Anyway, from my point of view what's happened here is that I've spent a significant amount of my time producing and releasing something people can have for free if they happen to want it, and the overwhelming majority of those who have added a comment have responded with anger and some pretty vicious contempt, while in some cases acknowledging the fact that the app is exactly as described. Is it me or is there something wrong here?

An analogy: you see a stand in the street with the words "free chocolate ice cream" displayed above it, you go up and get some, eat a mouthful, spit it out and then start shouting about the fact that you hate chocolate ice cream...

I do realise a certain amount of unfettered nastiness is generally inevitable in the context of digital communications, you only need to look at the comments section on any website to see that. However, as a developer basically creating trivial little apps for fun in my spare time, it does take the shine off things somewhat.

To be fair, some of the comments I've had have been really productive and encouraging, and some of them have actually responded to the idiotic, nasty ones. I suspect some of the more helpful comments are perhaps from other developers, so I now make a point of putting positive comments on any apps I use that seem to be receiving a similar level of unwarranted aggression. However, my apps seem to have attracted this extreme negativity in the overwhelming majority of total feedback.

Anyway, to finally get to the point, I've become aware recently that I, and I think most Internet users, just accept this nastiness as a necessary evil. However, I received an email the other day which chimed with some of what I've read in the press in the last while, from an organisation called CiviliNation dedicated to campaigning against online bullying and the general lack of civility in digital discourse, and it got me questioning some of what I've accepted.

It does seem that the tide may be turning slightly and that the days of totally unfettered bile online are probably numbered, in certain contexts anyway. While one of the great things about Internet communication is the lack of censorship, I don't think it follows from that that the normal expectations we have when interacting with people should not apply to digital communications also.

The reality is that bullying has a very serious impact on some people, as the never-ending stream of stories about people announcing planned suicides on social networks demonstrates comprehensively. While this is the extreme end of the issue, I think the time has now come for us to have higher expectations of online behaviour.

Ultimately the problem lies with a lack of responsibility, but the difficulty is going to lie in making people behave in a more civil way while still preserving a degree of anonymity. How we're going to improve the situation I really don't know, but a healthier breed of online discourse would surely be better for everyone involved.

Here's some related content:

Update July 2011:
A couple of interesting Guardian articles on related topics:

The first one is a fascinating look at the history and psychology of "trolling" with reference to anonymity and the second is a Charlie Brooker article from last month on Spotify, not exactly the same topic but touches on some related issues.

And a few more:
Update September 2011:
Interesting piece in the Guardian pointing out the fact that as with any social problem there's no easy fix and that the reasons for trolling are complex:
Guardian: All you trolls out there - come out and explain yourself

The issue is certainly a complex one, and it seems there isn't even a clear definition of trolling at this stage, in fact it probably refers to a range of distinct activities with different characteristics and effects. The days of unfettered Internet trolls definitely look to be coming to an end, but there may well be negative consequences for Internet discourse too, i.e. the inevitable reduction in privacy.

Here's another incredibly depressing tale of extreme trolling:
Skepchick - Mom, Don't Read This

Something has to change, surely...

    Sunday 17 April 2011

    Android Developer Tutorial Websites

    I've been pretty disappointed by the lack of Android developer tutorials online and have often spent ages trying to find out how to do something that I thought would pop up instantly after a quick Google.

    Learning how to program for Android can be quite a task depending on your own background, so access to decent educational material is vital. From Android widget development to standard Android software app development and getting to grips with the Android SDK, there's potentially a lot to learn.

    Anyway, here are some of the better sources for Android developer tutorials I've come across. If I find any more I'll add them to the list, feel free to add comments with any you've discovered yourself!

    Android Developer Resources - Tutorials
    OK, it may seem obvious but there are so many different ways to browse the official developer guide for Android that I find it useful to have several different parts of it bookmarked...

    Vogella - Android Tutorials
    Lars Vogel's site is one I find myself returning to again and again. The tutorials are detailed and the techniques always best practice. Thoroughly recommended.

    IBM DeveloperWorks
    The IBM site has loads of useful resources for many different types of development, and Android is no exception.
    The site is a must-bookmark for anyone getting started with Android development in my view. I've found information here on numerous occasions that I couldn't find anywhere else.

    Hello Android
    It's a bit of an arbitrary mix but some of the tutorials on the Hello Android site are really useful.

    The tutorials on the Tuts+ network all tend to be very detailed and in-depth, and the mobile site has quite a few good Android guides.

    Romain Guy
    This is a personal blog by an Android software engineer and has a really good range of Android developer tutorials on different topics.

    Android Guys
    A lot of the articles in the Tips and Tools section of Android Guys are aimed at users rather than developers, but there are a few development topics in there.

    Talk Android
    Mostly news-focused but with some guides, Talk Android is always worth a look.

    Finally, here are links to some of mine on different sites:

    That's it for the moment, if I remember or discover any more I'll add them.

    Thursday 3 March 2011

    Android Marketplaces and Directories

    There are already a load of places people can download or access your Android applications, other than the official Market. If you're a developer, you'll naturally want to explore as many places to sell and list your app as possible.

    Some of the sites and applications describing themselves as marketplaces simply link into the Android Market, but on some of them you can upload and sell your apps directly. In this article I'll run through some of the main Android application stores I've found, focusing on those sites where you can distribute Android software, i.e. upload your Android APK files and sell them.

    On the directories, you can sometimes sign up for an account and alter the details listed for your apps. Here are some I've come across, I haven't tried them all so can't guarantee they're any good. Also, some of these are new services and are just starting out, so they don't always have much of a user base yet.

    Make sure you check out the terms, FAQs etc on any service before taking the time to sign up, many of them have high minimum payouts and restrictions on where developers can be resident etc.

    AndroidZoom is an interface to the Android Market. As a developer you can link your app listings to your Google account, insert additional information about your apps and access additional data, just click the "I'm the developer" link on any of your app listings.

    AndAppStore is a an Android app store aimed at catering to a wider variety of users than the mainstream market. As a user you need to install the app to access your downloads but can shop for them on a computer if you like.
    Developer signup

    SlideME is a community based marketplace for Android apps.
    Developer signup

    AndroidPIT combines an app store with articles and news etc about Android.
    Developer signup

    AndSpot is a new social networking based app store offering increased exposure and data.
    Developer signup

    ApplsLib is an alternative marketplace for tablets running Android. To use the service as a customer you need to install the AppsLib application.
    Developer signup

    Handango is a major app store for platforms including Android, Blackberry, Windows Mobile, Symbian and Palm.
    Developer signup

    Appoke uses social networking to aid app sales.
    Developer signup

    MobiHand is an app store for Android, Blackberry, iPhone, Symbian, Windows Mobile and Palm.
    Developer signup

    GetJar is an app store for many different handsets and platforms.
    Developer signup

    AppStoreHQ covers Android, iPhone and iPad, linking to the Android market for downloads and sales. You can claim your profile.

    Androlicious is an interface for browsing the Android market, and you can link your apps to your Google account. You can submit apps and information to them via email.

    AndroLib is another listings site, but they have quite a lot of informative statistics and charts on the app pages. You can claim your apps by clicking the "I am the developer" link on the listings page.

    So that's it for now. There are also loads of app review sites, but that'll be for another post... If you know of any good Android market store sites please do add them in the comments.

    Update October 2011
    In the short time since I wrote this post a load more marketplaces have started up and I have to admit I've totally lost track of them! One resource that may be useful for some developers is appbackr which I've just heard about so know very little about. It provides an alternative way of funding your apps and handles the distribution side of things for you. If anyone has experience using the service please do comment on how well (or not) it's worked for you.

    Thursday 24 February 2011

    Thinking About Android Development?

    I started Android development in 2009, although when I say "started" that's exactly what I mean. I learned the basics, released a really trivial free application and then did nothing else with Android for about a year and a half.

    Having started getting back into Android development since the end of 2010, I've been surprised by the still relatively small number of useful Android development resources online. For that reason I thought I'd start a blog and keep note of the things I learn or come across as I go along, in case any of it proves useful for anyone else. This is going to be pretty simple stuff aimed at developers like myself who are really just doing Android on a casual basis.

    Some initial thoughts about the Android development process:

    Android development isn't what I expected it to be. My initial training was in Java programming for desktop applications, and I then got into Web and multimedia development (mainly so that I could work freelance). I've always loved Java development, and for that reason was excited by the possibility of getting paid to do it on a freelance basis.

    However, the Android development process bears more resemblance to Web development than the type of Java application development I was used to. This is probably good news for people who come from a Web background and want to get into Android. If, like me, your background has been more desktop-oriented, you might need to make a bit of a mental adjustment when you approach Android. I'd recommend reading up on the Android Activity Lifecycle before you get started, as this is the key concept to get to grips with when it comes to structuring your apps.