!! 나는이 문제가 전자 메일에 있다는 것을 깨달았습니다. 생각했던대로 작동하지 않습니다. 이메일이 매일 발생하도록 일정을 잡아서 자동으로해야합니다. !! !!전자 메일 데이터베이스가 작동하지 않습니다.
전자 메일로 데이터베이스의 복사본을 보내고 싶습니다. 파일을 SD 카드로 내 보낸 다음 전자 메일로 보내야합니다. 실행하려고하면 "이 응용 프로그램을 수행 할 응용 프로그램이 없습니다"오류가 발생합니다. 나는 SD를 사용할 수있는 안드로이드 에뮬레이터를 사용하고 있습니다.
public void sendEmail(View view){
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_SUBJECT, "Daily Records");
email.putExtra(Intent.EXTRA_EMAIL, new String[]{ "[email protected]"});
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
FileChannel source=null;
FileChannel destination=null;
String DB_NAME = "inoutDB.db";
String currentDBPath = "/data/"+ "mypackagename" +"/databases/"+DB_NAME;
String backupDBPath = DB_NAME;
File currentDB = new File(data, currentDBPath);
File backupDB = new File(sd, backupDBPath);
try {
source = new FileInputStream(currentDB).getChannel();
destination = new FileOutputStream(backupDB).getChannel();
destination.transferFrom(source, 0, source.size());
source.close();
destination.close();
email.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(backupDB));
} catch(IOException e) {
e.printStackTrace();
}
startActivity(Intent.createChooser(email, "Send Email"));
}
내가 내 매니페스트
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
데이터 파일에 액세스 할 수 없습니다. –
데이터 파일에 액세스하려면 어떻게해야합니까? – helpmeplease
이 질문을 관리자에게해야합니다. –