title: How to organize database access code in Android project?
body: <p>I have created a ContentProvider for my main Sqlite table, pretty much following <a href="http://developer.android.com/guide/tutorials/notepad/index.html" rel="nofollow noreferrer">NotePad example</a> from SDK (although I am not sure whether I will ever be exposing my data to other apps). However, I need to create lots of other, non-trivial queries on that and other tables and views. A good example would be queries to extract some statistics from the base data, averages, totals etc.</p>
  
  <p>So what's the best place for this code in an Android project? How it should be related and connected to the Uri-based data access exposed by a Provider? Any good examples out there?</p>