Archive for December, 2011

Java bitwise operators

December 25, 2011

This is a code snippet found in android.widget.AutoCompleteTextView class:

        // Always turn on the auto complete input type flag, since it
        // makes no sense to use this widget without it.
        int inputType = getInputType();
        if ((inputType&EditorInfo.TYPE_MASK_CLASS)
                == EditorInfo.TYPE_CLASS_TEXT) {
            inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE;
            setRawInputType(inputType);
        }

Here is what I found out: Java Notes: Bitwise Operators

System.out.println("3 & 7 = "+(3 & 7));//3
System.out.println("2 & 4 = "+(2 & 4));//0
System.out.println("2 & 5 = "+(2 & 5));//0
System.out.println("1 & 2 = "+(1 & 2));//0
System.out.println("1 & 0 = "+(1 & 0));//0

System.out.println("3 | 7 = "+(3 | 7));//7
System.out.println("2 | 4 = "+(2 | 4));//6
System.out.println("2 | 5 = "+(2 | 5));//7
System.out.println("1 | 2 = "+(1 | 2));//3
System.out.println("1 | 0 = "+(1 | 0));//1

Advertisements

Root Nexus One 2.3.6

December 17, 2011

Used this “DooMLoRD Easy Rooting Toolkit v3.0 (using zergRush exploit)” (Windows) and rooted my phone in less than 3 minutes. Also downloaded this  ROM Toolbox .

In the future if I find more time and energy, I may play around with some custom ROMs like CyanogenMod. I would probably be most interested in  getting them running on an emulator; It would be nice if someone put the compiled system.img files somewhere so that I don’t need to build from the source;).

Facebook for Android API 101

December 11, 2011

This morning I got to sit down and had a jump start on my first Facebook/mobile adventure! It seems I was able to follow through most part of their documentation (Android Tutorial and Graph API).

When I tried to get my app signature (Android key hash) using the java keytool, my Windows XP said it couldn’t find openssl command. I had to download both Visual C++ 2008 Redistributables and Win32 OpenSSL v1.0.0e from here.

I wasn’t able to save/get the access token from the preference file and I had to manually set the access token in the app. I got the token from the Graph API Explorer.