File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using WeakReferences in Android

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that WeakReferences are especially suited to implement Caches.

Are there other scenarios whereby WeakReferences are suitable on a mobile platform like Android ?
I understand that Android reclaims memory itself by killing processes.
 
Leandro Coutinho
Ranch Hand
Posts: 423
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Weak references are used to prevent circular references too.
 
Ed Burnette
Author
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Android's Dalvik VM does garbage collection just like your desktop version of Java SE does.

In addition to that, when memory gets tight, paused applications can be killed. If they're needed later they are reconstituted from saved state.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic