나는 안드로이드 개발에 newbe 해요. 나는 자동 다운로더에 대한 응용 프로그램을 bulid내 개발 안드로이드 애플 리케이션의 DRM 파일을 다운로드
,
모든 다운로드가 제대로 작동하고 내 SD 카드, 에 저장하지만 DRM 파일은 장치에서 열 수 없습니다.
나는 내 자신을 설명하고 확장자가 dd \ dm 인 파일을 다운로드하려고 시도한다. 일반 브라우저에서 dd \ dm 파일을 다운로드하면 장치가 dcf 확장자로 압축을 풉니 다.
내 앱이 그렇게하지 않으면 ... 내 장치가 다시 시작하면 모든 것이 올바르게 표시됩니다. 실제로 장치가이 파일의 확장명을 dcf로 변경하고이 노래를 재생할 수 있습니다. 발신자가 아닐 경우 장치를 다시 시작 .dd.dm
MT 콘텐츠 형식의 파일 확장명 숙박입니다 : 응용 프로그램/vnd.oma.drm.message 내가 그 치료를 필요로하는지
누군가는 알고있다?
이
은 오래된 질문 비록class DownloadFileFromURL extends AsyncTask<String, String, String> {
/**
* Before starting background thread
* Show Progress Bar Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
showDialog(progress_bar_type);
}
/**
* Downloading file in background thread
* */
@Override
protected String doInBackground(String... f_url) {
int count;
try {
URL url = new URL(f_url[0]);
URLConnection conection = url.openConnection();
conection.getContent();
conection.connect();
// getting file length
int lenghtOfFile = conection.getContentLength();
// Insert Information Of File to Array
getCurrentArray()[index].setSizeOfFile(OrangeFile.convertToStringRepresentation(lenghtOfFile));
getCurrentArray()[index].setMimeOfFile(conection.getContentType());
// input stream to read file - with 8k buffer
InputStream input = new BufferedInputStream(url.openStream(), 8192);
// Output stream to write file
OutputStream output = new FileOutputStream(mPath + getCurrentArray()[index].getNameOfFile() + "." + getCurrentArray()[index].getExtOfFile());
byte data[] = new byte[1024];
long total = 0;
while ((count = input.read(data)) != -1) {
total += count;
// publishing the progress....
// After this onProgressUpdate will be called
publishProgress(""+(int)((total*100)/lenghtOfFile));
// writing data to file
output.write(data, 0, count);
}
// flushing output
output.flush();
// closing streams
output.close();
input.close();
} catch (Exception e) {
Log.e("Error: ", e.getMessage());
}
return null;
}