Share via


MtpDevice.ImportFile Method

Definition

Overloads

ImportFile(Int32, ParcelFileDescriptor)

Copies the data for an object to a file descriptor.

ImportFile(Int32, String)

Copies the data for an object to a file in external storage.

ImportFile(Int32, ParcelFileDescriptor)

Copies the data for an object to a file descriptor.

[Android.Runtime.Register("importFile", "(ILandroid/os/ParcelFileDescriptor;)Z", "", ApiSince=24)]
public bool ImportFile (int objectHandle, Android.OS.ParcelFileDescriptor descriptor);
[<Android.Runtime.Register("importFile", "(ILandroid/os/ParcelFileDescriptor;)Z", "", ApiSince=24)>]
member this.ImportFile : int * Android.OS.ParcelFileDescriptor -> bool

Parameters

objectHandle
Int32

handle of the object to read

descriptor
ParcelFileDescriptor

file descriptor to write the data to for the file transfer.

Returns

true if the file transfer succeeds

Attributes

Remarks

Copies the data for an object to a file descriptor. This call may block for an arbitrary amount of time depending on the size of the data and speed of the devices. The file descriptor is not closed on completion, and must be done by the caller.

Java documentation for android.mtp.MtpDevice.importFile(int, android.os.ParcelFileDescriptor).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ImportFile(Int32, String)

Copies the data for an object to a file in external storage.

[Android.Runtime.Register("importFile", "(ILjava/lang/String;)Z", "")]
public bool ImportFile (int objectHandle, string destPath);
[<Android.Runtime.Register("importFile", "(ILjava/lang/String;)Z", "")>]
member this.ImportFile : int * string -> bool

Parameters

objectHandle
Int32

handle of the object to read

destPath
String

path to destination for the file transfer. This path should be in the external storage as defined by android.os.Environment#getExternalStorageDirectory

Returns

true if the file transfer succeeds

Attributes

Remarks

Copies the data for an object to a file in external storage. This call may block for an arbitrary amount of time depending on the size of the data and speed of the devices.

Java documentation for android.mtp.MtpDevice.importFile(int, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to