copy

Description

Copies an existing file in the cache directory of the mobile phone.

Input / Parameter

Output

Object

Callback

callback

The action performed if this function runs successfully.

errorCallback

The action performed if this function does not run successfully.

Example

In this example, we will copy a file and view the contents in the console.

Note: This example will only work after the user has created a file using `File.write` function.

Steps

  1. Drag a button component to a page in the mobile designer.

  2. Select the event press and drag the File.copy function to the event flow. Fill in the parameters of the function.

Result

  1. Open the installed app on a device with a debugger on and try to press the button.

  2. If the copied file exists, user should be able to see the content on the console.

Last updated