public boolean initialize() {
        boolean success = true;

        String adbLocation = System
                .getProperty("com.android.screenshot.bindir");

        // for debugging (follwing line is an example)
        //		adbLocation = "C:\\ ... \\android-sdk-windows\\platform-tools"; // Windows
        //		adbLocation = "/ ... /adt-bundle-mac-x86_64/sdk/platform-tools"; // MacOS X

        if (success) {
            if ((adbLocation != null) && (adbLocation.length() != 0)) {
                adbLocation += File.separator + "adb";
            } else {
                adbLocation = "adb";
            }
            AndroidDebugBridge.init(false);
            mAndroidDebugBridge = AndroidDebugBridge.createBridge(adbLocation,
                    true);
            if (mAndroidDebugBridge == null) {
                success = false;
            }
        }

        if (success) {
            int count = 0;
            while (mAndroidDebugBridge.hasInitialDeviceList() == false) {
                try {
                    Thread.sleep(100);
                    count++;
                } catch (InterruptedException e) {
                }
                if (count > 100) {
                    success = false;
                    break;
                }
            }
        }

        if (!success) {
            terminate();
        }

        return success;
    }