Android examples for File Input Output:Object Serialization
convert Object To String
//package com.java2s; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import android.util.Base64; public class Main { public static <E extends Serializable> String convertObjectToString( E value) throws IOException { ByteArrayOutputStream b = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(b); o.writeObject(value);/* w ww .j a v a 2 s . c o m*/ byte[] invocationBytes = b.toByteArray(); o.close(); b.close(); String base64 = new String(Base64.encode(invocationBytes, Base64.DEFAULT)); return base64; } }