Archive for August, 2011


Google Maps API info

Aug 12, 2011 in Android, Google

API docs:

Get a key from MD5 debug app signing certificate:

Steps ..

— Get maps key

— Get example, HelloMapView

— Get Google Add-ons via the Eclipse Windows / Android SDK and ADB Manager

More detailed Example

jMock resources..

Aug 04, 2011 in Java

This article explains how the mock setup class works
(I have been looking for this for at least 5 hours over 2 days..)

To mock System.class and override the currentTimeMillis() method, do this:

Note: this works for protected methods.

Mockit.setUpMock(new MockSystem());


@MockClass(realClass = System.class)
public class MockSystem {
    public long currentTimeMillis() {
        return ....;

To redefine methods using another way, including mocking static methods, use this:

public void setUp() throws Exception {
    Mockit.redefineMethods(MyClass.class, MockMyClass.class);


public static class MockMyClass {
    public static Something doSomething(...) {
        return Something ...;