トラッキング コード

7/18/2012

Starting for Android JUnit Test

If you would like to publish application to Google Market, I recommend that you test.
Android has test framework which helping you to test .

Check develoer's site!!

http://developer.android.com/tools/testing/index.html
The Android framework includes an integrated testing framework that helps you test all aspects of your application and the SDK tools include tools for setting up and running test applications. Whether you are working in Eclipse with ADT or working from the command line, the SDK tools help you set up and run your tests within an emulator or the device you are targeting.
If you aren't yet familiar with the Android testing framework, start by reading Testing Fundamentals. For a step-by-step introduction to Android testing, try the Activity Testing Tutorial.

How to set up Project for eclipse:

http://developer.android.com/tools/testing/testing_android.html

7/01/2012

Phone mode or Tablet mode in Android 4.1 Jelly Bean?




Android 4.1 Jelly Bean has Phone UI Mode and Tablet UI Mode, so same ICS.
How to change Phone / Tablet in Android Frameworks ?

If you have Android SDK Api 16, you can notice source code!!

Definition of UI Mode

Check in PhoneWindowManager#setInitialDisplaySize.

\sources\android-16\com\android\internal\policy\impl\PhoneWindowManager.java

        // SystemUI (status bar) layout policy
        int shortSizeDp = shortSize
                * DisplayMetrics.DENSITY_DEFAULT
                / DisplayMetrics.DENSITY_DEVICE;

        if (shortSizeDp < 600) {
            // 0-599dp: "phone" UI with a separate status & navigation bar
            mHasSystemNavBar = false;
            mNavigationBarCanMove = true;
        } else if (shortSizeDp < 720) {
            // 600-719dp: "phone" UI with modifications for larger screens
            mHasSystemNavBar = false;
            mNavigationBarCanMove = false;
        } else {
            // 720dp: "tablet" UI with a single combined status & navigation bar
            mHasSystemNavBar = true;
            mNavigationBarCanMove = false;
        }

        if (!mHasSystemNavBar) {
            mHasNavigationBar = mContext.getResources().getBoolean(
                    com.android.internal.R.bool.config_showNavigationBar);
            // Allow a system property to override this. Used by the emulator.
            // See also hasNavigationBar().
            String navBarOverride = SystemProperties.get("qemu.hw.mainkeys");
            if (! "".equals(navBarOverride)) {
                if      (navBarOverride.equals("1")) mHasNavigationBar = false;
                else if (navBarOverride.equals("0")) mHasNavigationBar = true;
            }
        } else {
            mHasNavigationBar = false;
        } 
PhoneWindowManager has been changed from ICS.
Tablet UI mode need 720dp!!