Flush MTP connection with Android tablet?

前端 未结 2 708
隐瞒了意图╮
隐瞒了意图╮ 2020-12-21 05:04

I connect a Samsung Galaxy Android tablet with a USB cable to computer running Windows 7. It connects using MTP.

  • Step 1. Copy my SQLite database from Windows
2条回答
  •  我在风中等你
    2020-12-21 05:44

    Use this function of windows as shown by this DELPHI example.


    procedure shCopyFile(hWndOwner: HWND; const SourceFile, TargetFile: string);

    var Info : TSHFileOpStruct;
    Aborted : Bool;

    begin
    Aborted := False;

    with Info do
    begin
    Wnd := hWndOwner;
    wFunc := FO_COPY;

    // From Microsoft's Help:
    // wFunc = Operation to perform. This member can be one of the following values:
    // FO_COPY Copies the files specified by pFrom to the location specified by pTo.
    // FO_DELETE Deletes the files specified by pFrom (pTo is ignored).
    // FO_MOVE Moves the files specified by pFrom to the location specified by pTo.
    // FO_RENAME Renames the files specified by pFrom.

    pFrom := pChar(SourceFile);
    pTo := pChar(TargetFile);
    fFlags := 0;
    fFlags := FOF_SILENT or FOF_NOCONFIRMATION or FOF_NOERRORUI;
    fAnyOperationsAborted := Aborted;
    end;
    try
    SHFileOperation(Info);
    finally
    if Aborted then; enact upon any user cancellations
    end;
    end;

    I'm copying file from Desktop to Android MTP device PATH

    Stefano www.data-ware.it

提交回复
热议问题