2

How would I get user-provided information (e.g. product feedback) from an android app to be sent to a private email account?

I currently run a website and we would like to develop an android app that allows users to input product feedback. We would like this feedback to then be sent or stored in a way that is only accessible to certain people. It doesn't necessarily have to be sent to email, it just needs to be private. We just want the product feedback to be available for us for review and comment.

Is there any place I could go to get started thinking about this?

Matthew
  • 6,351
  • 8
  • 40
  • 53
M. Stanton
  • 31
  • 2
  • 1
    You should start by looking at this and see if you can make a more concise question. https://www.mkyong.com/android/how-to-send-email-in-android/ – Danieboy Jul 22 '16 at 16:44

1 Answers1

1

Assume you have a EditText in your layout file, you get the text in your activity like this, where the et_some_user_input is the id of the EditText in your layout file.

EditText etSomeUserInput = (EditText)findViewById(R.id.et_some_user_input);
String someUserInput      =  etSomeUserInput.getText().toString();

Now you have the user input in someUserInput, you can send this string like this:

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@private.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
i.putExtra(Intent.EXTRA_TEXT   , someUserInput);
try {
    startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
    Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}

Reference of the send email code.

This will make the user to fire up an email client such as google email, or yahoo email or any other email client the user choose. In case, you want the user input to be sent to your private email or somewhere you can access to without going through an email client. One suggestion is to set up a server that accepts user messages, so in your android app, you can send this message to your server, and you server can save that message into some sort of database, and you can then set up an admin web app to connect to that database to see what's being submitted by the user, or can you query that database directly.

If you are not sure what I am talking about, you will need to do some research to

How to set up a server to accept REST service calls in Java, PHP, Ruby, Python, Node.js or whatever programming language you prefer?

How to make REST service calls in Android?

If you don't have the resources to set up the server, then you can try to ask the internet if it's possible to send an email in Android without going through an email client.

Community
  • 1
  • 1
s-hunter
  • 24,172
  • 16
  • 88
  • 130
  • Thank you for your help. Now are you aware of an easier way about doing this that does not involve email? We want the app to just have a text box in it that the user fills out with there feedback. Than we want to be able to review that feedback. We would prefer if the user did not have to go away from the app (like to a private email server) to send the information. Any advice? – M. Stanton Jul 22 '16 at 17:13
  • see the updates above – s-hunter Jul 22 '16 at 18:12