3

Android TV では、U ディスク マウント /mnt/usb/sdb4、android DownloadManage を使用し、

 File pathyr = new File("/mnt/usb/sdb4");
            Uri downloadUri = Uri.parse(DOWNLOAD_FILE);
            DownloadManager.Request request = new DownloadManager.Request(downloadUri);
            request.setDestinationUri(Uri.fromFile(new File( pathyr,"100mb.jpg") ));

04-20 10:54:05.593: W/dalvikvm(2315): threadid=1: thread exiting with uncaught exception (group=0x40f771f8)
04-20 10:54:05.665: E/AndroidRuntime(2315): FATAL EXCEPTION: main
04-20 10:54:05.665: E/AndroidRuntime(2315): java.lang.SecurityException: Destination must be on external storage: file:///mnt/usb/sdb4/100mb.test.test
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.os.Parcel.readException(Parcel.java:1327)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.content.ContentProviderProxy.insert(ContentProviderNative.java:415)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.content.ContentResolver.insert(ContentResolver.java:730)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.exercise.download.DownloadManager.enqueue(DownloadManager.java:750)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.exercise.AndroidDownloadManager.AndroidDownloadManagerActivity$1.onClick(AndroidDownloadManagerActivity.java:71)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.View.performClick(View.java:3511)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.View.onKeyUp(View.java:6073)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.widget.TextView.onKeyUp(TextView.java:5595)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.KeyEvent.dispatch(KeyEvent.java:3010)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.View.dispatchKeyEvent(View.java:5500)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1246)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1879)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1361)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.app.Activity.dispatchKeyEvent(Activity.java:2325)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1806)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3327)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3300)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2460)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.os.Looper.loop(Looper.java:137)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at android.app.ActivityThread.main(ActivityThread.java:4424)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at java.lang.reflect.Method.invokeNative(Native Method)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at java.lang.reflect.Method.invoke(Method.java:511)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:579)
04-20 10:54:05.665: E/AndroidRuntime(2315):     at dalvik.system.NativeStart.main(Native Method)
4

2 に答える 2