I'm really new to Android development, and my first project was a simple game which has a display and a logic part. I would like to add a save feature to the game, but I'm having trouble with the implementation.
I would like to do it this way, with an ObjectOutputStream (just the important part is included)
String filename = "res/raw/testfile.txt";
try
{
FileOutputStream fileout = new FileOutputStream(filename);
ObjectOutputStream out = new ObjectOutputStream(fileout);
out.writeObject(...logic objects...);
}
catch (Exception ex)
{
//show the error message
}
But I always get an error message which says, that "no such file ...". Even if I create a "testfile.txt" in the raw directory, it says the same error.
Please help me, what am I doing wrong?