Last Updated: February 25, 2016
·
589
· outlying

Create DAO inside Application object

Many Android API methods require Context object parameter, you could pass Activity or Application for that, but in case of any kind of data communication it would be much safer to use Application context.

Plenty of memory issues exists because developers keep references to Activity context inside theirs DAOs, this was Activity cannot be removed from memory when needed.