This is an example, into Intent.EXTRA_TEXT
set the device information
Intent msg = new Intent(Intent.ACTION_SEND);
String[] recipients = { "mailto:prayers@e-orthodoxy.net" };
String[] carbonCopies = { "" };
msg.putExtra(Intent.EXTRA_EMAIL, recipients);
msg.putExtra(Intent.EXTRA_CC, carbonCopies);
msg.putExtra(Intent.EXTRA_TEXT, getDeviceInformation( getResources().getString(R.string.appversion)));
msg.putExtra(Intent.EXTRA_SUBJECT, "this is an email");
msg.setType("message/rfc822");
startActivity(Intent.createChooser(msg, "Email:"));
this is my method, you can send the appversion from strings.xml:
public static String getDeviceInformation(String appversion){
String info = "\n\n"+android.os.Build.MODEL+" "+"/"+android.os.Build.VERSION.RELEASE+"/"+ appversion;
return info;
}
or you can get the app version from your Manifest.xml
file
public static String getDeviceInformation(){
PackageManager manager = this.getPackageManager();
PackageInfo infoPackage = manager.getPackageInfo(this.getPackageName(), 0);
String appversion = infoPackage.versionName;
String info = "\n\n"+android.os.Build.MODEL+" "+"/"+android.os.Build.VERSION.RELEASE+"/"+ appversion;
return info;
}
to get the android version you will use :
android.os.Build.VERSION.RELEASE
or
android.os.Build.VERSION.SDK_INT