TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Serialise and deserialise any Java object to Shared Preferences in Android

1 pointsby brad-curranalmost 12 years ago

1 comment

brad-curranalmost 12 years ago
It&#x27;s pretty simple to use.<p>Saving objects: Animal animal = new Animal(&quot;Lassie&quot;, &quot;Dog&quot;); DroidPrefs.instance(context).put(&quot;key&quot;, animal).apply();<p>Loading objects: Animal animal = DroidPrefs.instance(context).get(&quot;key&quot;, Animal.class);