BlackDragonFun
Lurker
Hi,
I've just started out on Android, I've done the tutorials including the tests.
I'm trying to be a good developer by writing unit tests as I go along (or even before implementation). To begin with, I want to write some of the back end first which goes off on to the web and downloads a file then processes it.
This should be one or two classes, however I don't know how you're supposed to unit test classes that include Android SDK references but wouldn't be able to run as an app by itself. i.e. unit testing library functions. For those who have done the Android notepad tutorials, I would be trying to unit test the equivalent to NotesDbAdapter.
I'm also a bit confused as to how I would do a mock file download (for unit testing) so that the download request returns a file from the test project. Any suggestions?
Where is a good place to store downloaded files? I have been Googling for a while, and the examples I have seen explicitly download to either the internal storage or SD card. Can I create a temporary directory (or cache area) for the app to downloaded files to? It would only be a single file, and shouldn't happen to frequently.
Lastly, I'm a bit confused as to where to start writing an app. Do I do the low level back end stuff first, or do I do the GUI first?
Much appreciated if someone can help
I've just started out on Android, I've done the tutorials including the tests.
I'm trying to be a good developer by writing unit tests as I go along (or even before implementation). To begin with, I want to write some of the back end first which goes off on to the web and downloads a file then processes it.
This should be one or two classes, however I don't know how you're supposed to unit test classes that include Android SDK references but wouldn't be able to run as an app by itself. i.e. unit testing library functions. For those who have done the Android notepad tutorials, I would be trying to unit test the equivalent to NotesDbAdapter.
I'm also a bit confused as to how I would do a mock file download (for unit testing) so that the download request returns a file from the test project. Any suggestions?
Where is a good place to store downloaded files? I have been Googling for a while, and the examples I have seen explicitly download to either the internal storage or SD card. Can I create a temporary directory (or cache area) for the app to downloaded files to? It would only be a single file, and shouldn't happen to frequently.
Lastly, I'm a bit confused as to where to start writing an app. Do I do the low level back end stuff first, or do I do the GUI first?
Much appreciated if someone can help
