You can use a mocking structure for this. Check out this question and answers to a list of mocking frameworks that work great with Android. I personally recommend Mockito, which recently got Android support.
Now the question is what is being taunted. You can try to mock data storage mechanisms directly, but I would recommend wrapping data storage at a different level of abstraction. This will give you a clean seam to introduce the layout when testing. This design also gives you great flexibility in general (for example, you can change a specific type of data warehouse without affecting the business logic of your application).
Let me know if this is exactly what you are looking for.
source share