Skip to content


Subversion checkout URL

You can clone with
Download ZIP
An IntelliJ template project for android developers, pre-configured to work with Robolectric, Roboguice, an other common, useful Android libraries.
Java Ruby Shell Perl
Branch: nested-tests
Pull request Compare This branch is 1 commit ahead, 122 commits behind master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Instructions on installing pivotal's git scripts for supporting `git pair xx yy`, for example.

Based on IntelliJ 10.5

# Robolectric:
robolectric starts out as a read-only submodule of pivotal/robolectric (HEAD).

## To initialize robolectric:
    git submodule init
    (cd submodules/robolectric && ant clean test) # make sure it runs

## Forking Robolectric
At this time we recommend forking robolectric for your project.

Start by removing the default pivotal/robolectric

1. Delete the relevant line from the .gitmodules file.
2. Delete the relevant section from .git/config.
3. Clean up git and directories:

    git rm --cached submodules/robolectric
    rm -rf submodules
    See "Robolectric" above, but use your own robolectric repository git uri.

Add your own fork

    git submodule add git://***YOUR-REPO-HERE***/robolectric.git submodules/robolectric
    git submodule init
    cd submodules/robolectric
    (cd submodules/robolectric && ant clean test)

## Contributing back to Robolectric
Contributing back to pivotal/robolectric is accomplished by following the official Github fork

    # add pivotal/robolectric HEAD as an upstream remote
    cd submodules/robolectric
    git remote add upstream git://
    git fetch upstream

    # merge pivotal/robolectric into your fork
    git merge upstream/master

Next, make a pull request as your client user:

The pull request can be handled by someone with commit right to robolectric, maybe even you!
See "Managing Pull Requests" at

# Roboguice
This project is set up by default to use Roboguice for dependency injection.  See MySampleApplication.ApplicationModule
and SampleRoboguiceTestRunner.TestApplicationModule for injection configuration.  See StarterActivityWithRoboguiceTest
for an example of injection usage.

## To remove Roboguice injection:
- Delete MySampleApplication and remove references
- Delete SampleRoboguiceTestRunner and remove references
- Delete guice* and roboguice* jars in libs/main and libs-src/
- Remove all uses of @Inject, @InjectView, etc.
- Remove reference to MySampleApplication from AndroidManifest

# C2DM Support
We have added base support for C2DM. C2DM is Google's push notification service for Android and is available in
API v. 2.2 and above, though is safely ignored in lower versions.

While 2.2 devices are support C2DM, Google does not provide API code for integrating with the service -- no
registration, unregistration, or notification-receipt handling code. Google suggests copying code from one of
their sample projects for this support, which we have done.  See Note that we modified to support Roboguice.

To handle C2DM notifications you will need to implement C2DMReceiver, which is currently empty but heavily documented.

## C2DM Resources:
- Official C2DM site:
- Pivotal Blog articles:
- Sample code:

## To Remove C2DM:
- Remove C2DMReceiver and test
- Delete
- Remove the C2DM Section of AndroidManifest.xml
Something went wrong with that request. Please try again.