mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
* feat(android): add openFile to utils * tests: move test_openFile() test to apps/ui-tests-app Small changes to openFile() method
15 lines
537 B
TypeScript
15 lines
537 B
TypeScript
import { isIOS, isAndroid } from "tns-core-modules/platform";
|
|
import * as fs from "tns-core-modules/file-system/file-system";
|
|
import * as utils from "tns-core-modules/utils/utils";
|
|
|
|
export function openFile() {
|
|
let directory;
|
|
if (isIOS) {
|
|
directory = fs.knownFolders.ios.downloads();
|
|
} else if (isAndroid) {
|
|
directory = android.os.Environment.getExternalStorageDirectory().getAbsolutePath().toString();
|
|
}
|
|
|
|
const filePath = fs.path.join(directory, "Test_File_Open.txt");
|
|
utils.openFile(filePath);
|
|
} |