Android, testing service from the test case!

Hello everybody,

This sample is specially created for Shivang Seth from Robotium conference and I would like to describe how to bind service from the test case! 🙂

First of all you will need:

1) Bind/unbind methods for service for setUp() and tearDown() methods accordingly;

2) Connection class to bind the service;

3) Binder implementation inside the service, should have public method ‘getService’ otherwise you will be not able to get the service outside the package:

Happy testing! (:

Best regards,