android - Is it possible to write to the sd card without a file picker on kitkat+ -
i want delete files sd card root without file picker.
after searching around couple of days,i haven't found way this.but files apps es file explorer have no problem,does know why is?
the closest thing found how use new sd-card access api presented lollipop? have use file picker
manifest
<uses-permission android:name="android.permission.kill_background_processes"/> <uses-permission android:name="android.permission.read_external_storage"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.get_package_size"/> <uses-permission android:name="android.permission.clear_app_cache"/> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:screenorientation="portrait" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>
you must provide source code , tell tried.
check if can create new empty files:
file newfile = new file("/storage/sdcard1/test"); try { file.createnewfile(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); }
edit after comment:
add in manifest above application tag.
<uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage"/>
Comments
Post a Comment