Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai All
I have a mobile app in cordova , in that i create directory , if i use Target Api 28, it will create folder, in same time if set Target Api as 29 ,directory never creating, i am using following code to create directory in internal storage.

C#
if (device.platform.toLowerCase() == "android") {
            window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, onFileSystemSuccess, onError);
        } else {
            window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, onError);
        }
        
        function onFileSystemSuccess(fileSystem) {
        var entry = "";
        if (device.platform.toLowerCase() == "android") {
            entry = fileSystem;
        } else {
            entry = fileSystem.root;
        }
        entry.getDirectory("smfolder", {
            create: true,
            exclusive: false
        }, onGetDirectorySuccess, onGetDirectoryFail);
    };



    function onError(e) {
        alert("Fail to get folder");
    };


This is config.xml screenshot : http://prntscr.com/w53qgh When i upload in Play Store , it will ask to set Target Api level as 29, then only can upload, so i need to set API as 29, is there any thing need to add in config or android manifest file ? or need to add permission to use API 29.

Appreciate your assistance since i have been stuck in this for few days now.

What I have tried:

I tried to add this 2 lines in androidmanifest.xml , still cant create directory
C#
<pre> 
 <uses-permissionandroid:name="android.permission.WRITE_INTERNAL_STORAGE" />
<pre><uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />


Regards,

Aravind
Posted
Comments
David Crow 18-Dec-20 9:15am    
Are any exceptions being thrown?
Aravindba 18-Dec-20 21:36pm    
no error, app will works fine, but directory not creating in internal storage, we create folder for store files in that place, so we need create folder, our app is DMS, allow to upload and download files.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900