我有引用应用程序,它具有向开发人员发送反馈电子邮件的功能.我想在电子邮件中附加设备型号和Android版本信息.我不知道怎么能这样做.我发送电子邮件的java代码如下所示.
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","exmaple@gmail.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Write Here");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
Run Code Online (Sandbox Code Playgroud)
谢谢
使用以下代码
String deviceInfo="Device Info:";
deviceInfo += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL + ")";
deviceInfo += "\n OS API Level: " + android.os.Build.VERSION.SDK_INT;
deviceInfo += "\n Device: " + android.os.Build.DEVICE;
deviceInfo += "\n Model (and Product): " + android.os.Build.MODEL + " ("+ android.os.Build.PRODUCT + ")";
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","exmaple@gmail.com", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Device Info");
emailIntent.putExtra(Intent.EXTRA_TEXT, deviceInfo);
startActivity(Intent.createChooser(emailIntent, "Send email..."));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
599 次 |
| 最近记录: |