Saturday, July 2, 2011

Adding a feedback link

One of the most important things which an app developer can do is to provide clients with a means to provide feedback on their apps. I've read this on several occasions, and it makes sense. So, what I'm going to do is simple add a link on the initial page which allows the customer (or trial customer) to let me know what he or she thinks. The least I can do is leave them with a good taste in their mouth by saying thanks for the feedback, I'll take a look at it.

For now, I'm just planning on adding it as a link. I was thinking I could make the purchase link more inviting by making it a button, but probably not the feedback. At least not yet. For now, I'll just re-uses the code for the purchase. Possibly make a single routine out of it - I'm not sure yet.

Ok, so since the linkify worked before, let's try it on my email address:

String text = "Feedback: mcd@kanjisoft.com";

No, linkify just make an http address out of it.

Well, I found a link that let's you do it using a button:

http://www.helloandroid.com/tutorials/how-send-email-your-application

I could just throw it onto the settings page. But, that's not really where it belongs.

Another option is to create a "feedback" web page, and just link to that. Hmm...it's tempting. It will be simpler to implement. But, I would like to have the address of the client. Can I send it as part of the url? Do I have access to it?

I would really like to create feedback from the link. But would linkify then highliight the parameter? Or make a form out of it?

Wait. I have it in code, maybe. Let's change the protocol to smpt, the simple mail transfer protocol:

// prefix our pattern with smpt:
Linkify.addLinks(feedback, pattern, "smpt://");

Strange. It comes up with a black/whit dialog which says "edit text/copy url".

Or, it just crashes. Let's look at the log.

I/ActivityManager( 103): Starting: Intent { act=android.intent.action.VIEW dat=smpt://mcd@kanjisoft.com (has extras) } from pid 4083
E/AndroidRuntime( 4083): FATAL EXCEPTION: main
E/AndroidRuntime( 4083): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=smpt://mcd@kanjisoft.com (has extras) }


Ok - so it's launching an intent, and looking for an activity to matching the intent. However, the intent looks like it's trying to match the smpt address to an activity. I'd like to see an example of the code using this.

Let's google Linkify email example.

Ok, this looks promising:

http://developer.android.com/resources/articles/wikinotes-linkify.html

It's one of the "friendly" links that gives examples that you occasionally run across at the developer site. They say it handles emails, web address and such automatically. Let's have a look-see.

Default Linkify: Using the set of default active link options is very straightforward. Simply pass it a handle to a TextView with content in it, and the Linkify.ALL flag:

TextView noteView = (TextView) findViewById(R.id.noteview);
noteView.setText(someContent);
Linkify.addLinks(noteView, Linkify.ALL);

Should we try this?

Linkify.addLinks(feedback, Linkify.ALL);

Cook. An email comes up! I need to refine it. I'd like to have a default subject header, and the contact is pulling from the wrong contact (that's what I get from buying a used phone). But for now, it will do.

No comments:

Post a Comment