This may be a silly question:
I’m looking to serialize an object as a once-off to then use that thereafter as a resource (deserializing each time it’s read). How can I write this serialized object once so I can access it from the PC and put it in the /res/raw folder (where it will then always just be read in and deserialized)?
I’ve tried:
try
{
FileOutputStream fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory().toString() + "/solver.sol"));
ObjectOutputStream out = new ObjectOutputStream(fos);
out.writeObject(solver);
out.close();
}
catch(IOException ex)
{
ex.printStackTrace();
}
Aswell as placing <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in the AndroidManifest.xml
But I can’t access it from my PC to place it in the resources folder?
Thanks in Advance
Calum
Try…
…instead of
.toString()