Dateipfad für Internen Android Speicher?

  • Antworten:5
Kullorki
  • Forum-Beiträge: 55

12.12.2010, 19:34:52 via Website

Hallo,
wie sieht der Dateipfad für den internen AndroidSpeicher aus?
ich hab schon so gut wie alles mögliche probiert, aber es haut irgendwie nicht hin....

FileWriter lSchreiber = new FileWriter ("file://data//com//de.Kullorki.test//temp.tmp", false);

oder

FileWriter lSchreiber = new FileWriter ("data//com//de.Kullorki.test//temp.tmp", false);

oder

FileWriter lSchreiber = new FileWriter ("data//data//com//de.Kullorki.test//temp.tmp", false);

oder

FileWriter lSchreiber = new FileWriter ("temp.tmp", false);

ich bekomme immer eine IO Exception, woran liegt das?
wenn ich zum beispiel ("sdcard//temp.tmp",false) benutze klappt es zwar,
aber ich will in diesem fall nicht auf die SD karte schreiben... :(


mfg

— geändert am 12.12.2010, 19:57:37

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

12.12.2010, 19:52:08 via Website

ISchreiber ?

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Kullorki
  • Forum-Beiträge: 55

12.12.2010, 19:57:05 via Website

FileWriter lSchreiber halt ^^ tut hier nichts zur sache, deshalb hab ichs halt rausgelassen ^^

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

12.12.2010, 20:00:06 via Website

als ob man variablen Groß schreibt, daher schon. Konstanten sind was anders.

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

13.12.2010, 00:13:33 via Website

kA Was der Interne Speicher ist, aber dort wo die App rennt gehts schon:

1@Override
2 public Void process(final Context _context, final InputStream _instream) throws IOException, Exception
3 {
4 FileOutputStream fout = null;
5 BufferedInputStream inStream = null;
6 try
7 {
8 inStream = new BufferedInputStream(_instream, IOUtils.BIG_BUFFER_SIZE);
9 fout = _context.openFileOutput(stationsXMLFilePath, Context.MODE_PRIVATE);
10 final byte[] buffer = new byte[IOUtils.BIG_BUFFER_SIZE];
11 int bytesRead = -1;
12 while ((bytesRead = inStream.read(buffer)) > -1)
13 {
14 fout.write(buffer, 0, bytesRead);
15 }
16 if (Logging.isEnabled)
17 {
18 Log.d(LOG_TAG, stationsXMLFilePath + " updated");
19 }
20 }
21 catch (final IOException e)
22 {
23 final IOException ioe = new IOException("Failed to update " + stationsXMLFilePath);
24 ioe.initCause(e);
25 throw ioe;
26 }
27 finally
28 {
29 IOUtils.close(fout);
30 IOUtils.close(inStream);
31 }
32
33 return null;
34
35 }

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten