0

i have three classes and want to store all the data of three classes... these classes are composed in main class ... so can any one tell that whether i have implement the Serilzable interface on class or all three classes which are composed....

Deleplace
  • 6,812
  • 5
  • 28
  • 41
user643144
  • 517
  • 1
  • 4
  • 5

3 Answers3

1

please check this out http://developer.android.com/guide/topics/data/data-storage.html it is according to your requirement. but i suggest to use the shared preference if the data is in key pair value.it store value in xml tag inside the application and also fast operation as compare to other thing. for shared preference here

Community
  • 1
  • 1
Sameer Z.
  • 3,265
  • 9
  • 48
  • 72
1

All objects in the object tree of a Serializable object must implement Serializable; otherwise you'll get a NotSerializableException.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
1

Serialization is for entire object graph or none. For e.g you have the following scenario

Class A
{

      class b = new class B();
      class c = new class C();  
      class d = new class D(); 

}

Suppose if you want to serialize A then all of the composed objects of different class has to implement serializable including A if any of composed object fails to implement serializable then NoSerializableException will be thrown.

Umesh K
  • 13,436
  • 25
  • 87
  • 129