android - Sending sqlite data as an email attachment -


i have app gathers user data, , displays them listview. have emailsender class following function;

 protected void sendemail() {   log.i("send email", "");    string[] = {"amrood.admin@gmail.com"};   string[] cc = {"mcmohd@gmail.com"};   intent emailintent = new intent(intent.action_send);   emailintent.setdata(uri.parse("mailto:"));   emailintent.settype("text/plain");     emailintent.putextra(intent.extra_email, to);   emailintent.putextra(intent.extra_cc, cc);   emailintent.putextra(intent.extra_subject, "your subject");   emailintent.putextra(intent.extra_text, "email message goes here");    try {      startactivity(intent.createchooser(emailintent, "send mail..."));      finish();      log.i("finished sending email...", "");   } catch (android.content.activitynotfoundexception ex) {      toast.maketext(mainactivity.this,       "there no email client installed.", toast.length_short).show();   } } 

i want automatically add sqlite data email attachment. thoughts on that?

you can add sqllite path this

emailintent.putextra(android.content.intent.extra_stream, uri.parse(sqllitepath)); 

sqlitepath should built like

sqlitepath = "file://" + sqlitefolder.getabsolutepath() + "/" + sqlitedbname; 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -