- Brogyi: CTEK akkumulátor töltő és másolatai
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Luck Dragon: Asszociációs játék. :)
- ldave: New Game Blitz - 2026
- bambano: Bambanő háza tája
- MasterDeeJay: RAM gondolatok: Mennyi a minimum? DDR3 is jó?
- Geri Bátyó: Agglegénykonyha 14 – Kések, késélezés
- mefistofeles: Az elhízás nem akaratgyengeség! 2 Ahogy én csinálom.......
- gerner1
- sziku69: Fűzzük össze a szavakat :)
Új hozzászólás Aktív témák
-
SektorFlop
aktív tag
Sziasztok!
Már jó rég jártam itt, viszont most nagyon csúnyán elakadtam egy egyszerű dologgal. Van egy egyszerű kódom, ami lementene egy fájlt belső van külső tárhely /Android/data/... mappájába. 10 telefonból 9-en működik. A kivétel egy Huawei Y6 (Android 5.1.1, EMUI 3.1) Valakinek volt hasonló problémája? Vagy esetleg megoldást tud rá valaki?
A leegyszerűsített program rész:
public void createFile(TextView textView){
String filepath ="/storage/sdcard1/Android/data/com.example.app/route.txt";
FileOutputStream fos = null;
try {
fos = new FileOutputStream(filepath);
byte[] buffer = "Ez lesz írva a fájlba".getBytes();
fos.write(buffer, 0, buffer.length);
fos.close();
textView.setText("Saved");
} catch (FileNotFoundException e) {
e.printStackTrace();
textView.setText(e.toString());
} catch (IOException e) {
e.printStackTrace();
textView.setText(e.toString());
}finally{
if(fos != null)
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
textView.setText(e.toString());
}
}
}Manifestben következő permissionok:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />11-08 09:18:52.442 6957-6957/com.mobilengine.filesavetest W/System.err: java.io.FileNotFoundException: /storage/sdcard1/Android/data/com.example.app/route.txt: open failed: EACCES (Permission denied)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at libcore.io.IoBridge.open(IoBridge.java:494)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at com.mobilengine.filesavetest.MainActivity.createFile(MainActivity.java:36)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at com.mobilengine.filesavetest.MainActivity.onCreate(MainActivity.java:27)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.Activity.performCreate(Activity.java:6102)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.ActivityThread.access$1200(ActivityThread.java:165)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.os.Looper.loop(Looper.java:135)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5593)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at java.lang.reflect.Method.invoke(Native Method)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at java.lang.reflect.Method.invoke(Method.java:372)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at libcore.io.Posix.open(Native Method)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: at libcore.io.IoBridge.open(IoBridge.java:480)
11-08 09:18:52.452 6957-6957/com.mobilengine.filesavetest W/System.err: ... 18 more
Új hozzászólás Aktív témák
- AOC Q27G3XMN 27" 180Hz 1440p gamer monitor
- Iphone 13 mini mobiltelefon eladó
- Ryzen 5 5500 (ÚJ, 2 ÉV GARI) - 16 GB DDR4 3200 MT/s CL16 - 1 TB NVMe SSD (G4) - MSI MAG Vampiric ház
- Samsung NP270E5E-K07PL Notebook 3 órás akkuval
- Új Gamer PC - Ryzen 7 5700X / RTX 5060 Ti / B550M WIFI / 16GB RAM / 1TB SSD / 650W
- 8 GB-os GeForce RTX 2060 SUPER (OEM HP) - garanciával
- Samsung Galaxy S21 Ultra 5G 256GB, Kártyafüggetlen, 1 Év Garanciával
- Lenovo Thinkpad X1 Yoga 5th Gen. i7 10th, 16GB RAM 27% ÁFÁS (0329)
- GYÖNYÖRŰ iPhone XR 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3995, 100% Akksi
- HIBÁTLAN iPhone 11 128GB White -1 ÉV GARANCIA - Kártyafüggetlen, MS4258
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
