aspose file tools*
The moose likes Android and the fly likes Testing Android applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Testing Android applications" Watch "Testing Android applications" New topic
Author

Testing Android applications

Akil Kumar
Ranch Hand

Joined: Jun 08, 2009
Posts: 83
Hello everyone,

Can anyone tell me what is the best way to test the android application on multiple devices? Especially with various screen resolutions how should one test the app on different devices, and under different OS versions?

Has anyone tested the application in tablet? What sort of modification needs to be done to run the same app in the tablet?
If there is any tutorial or any sort of link please share.

Thanks
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

what sort of testing do you want to do? UI testing or business logic testing?

I believe you could use the instrumentation toolkit to test the UI, then just use jUnit to test your regular logic. If you try and keep your business logic outside your android classes (ie activities) then it may prove easier to test as you wnt have to worry about mocking android classes.


Kind Regards, James. OCPJP 1.6 || My SCJP / OCJCP Study Notes
Interested in : SCJP, Google App Engine, Stripes, Android;|| My Bite-Size SCJP Study Blog
Perry Hoekstra
Greenhorn

Joined: Dec 07, 2010
Posts: 28
I would second what James said:

-> First make sure your classes have a distinct separation between those that drive the UI and those that are business logic classes.
-> I don't know how it is with the other platforms but there is a wealth of information on how to do unit testing on Android. One example is: https://sites.google.com/site/androiddevtesting and another is: http://pivotal.github.com/robolectric In addition, the Android Development website has beefed up their documentation on testing recently. One example is: http://developer.android.com/resources/tutorials/testing/activity_test.html
-> In terms of mocking, I know that developers have had some issues with EasyMock and Mockito. PowerMock (http://code.google.com/p/powermock) claims to have solved those issues, I have not had an opportunity to try it out.
-> There is the Android Instrumentation framework

Right now, I am not aware of any software that drives the UI that is repeatable and scriptable in order to test the application in various screen resolutions. There are claims that Robotium (http://code.google.com/p/robotium) is Selenium-like but again, it is on my ToDo list to try out and I have not gotten to it yet.

Perry Hoekstra
Akil Kumar
Ranch Hand

Joined: Jun 08, 2009
Posts: 83
James Elsey wrote:what sort of testing do you want to do? UI testing or business logic testing?

I believe you could use the instrumentation toolkit to test the UI, then just use jUnit to test your regular logic. If you try and keep your business logic outside your android classes (ie activities) then it may prove easier to test as you wnt have to worry about mocking android classes.


Hello James,

Thank you for the response. I am already using the instrumentation toolkit and created test cases using JUnit. I was asking what sort of hardware do I need to consider for testing? There are several phones available in the market and with different display screen sizes.

I came across this online while looking for testing

http://www.perfectomobile.com/portal/cms/android.html

Has anyone tried testing the android applications in these cloud service platform?
Before I publish the app in the market, would like to check how the UI icons are positioned in the screen?

Thanks
Perry Hoekstra
Greenhorn

Joined: Dec 07, 2010
Posts: 28
The best approach may be to use one released by Google: http://android-developers.blogspot.com/2010/08/nexus-one-developer-phone.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Testing Android applications
 
Similar Threads
Android in Action - Questions
What platform to use?
Tablet Devices supporting midp..?
How important is it to have an andriod enabled device?
Questions from beginner Android developer