Question

Hi I am doing research into developing for smart watches for an upcoming project i may be undertaking. I am looking to develop a custom launcher for a smart watch to be used as the main interface that the user interacts with. I have done my research into this and i think i know what direction to head in. What I dont know how ever (and Im sure a lot of others dont and would like to know) is how to set my self up in Eclipse or Android Studio to develop apps for the small screen sizes of Smart watches.

Is it simply setting dimensions in the res/values folder or is it more complicated than that? Also is there any special SDKs i can get my hands on to aid me in developing for Smartwatches?(i know of the Sony SDK but havnt been able to find any others.) Also is there a way to configure my IDEs so that i can easily set up Smart watch projects?

Was it helpful?

Solution

You can use an emulator to see your results for different dpi.

DPI is a measure that you can use on your dimens.xml, and if you have a measure in pixel,you can use this to know which kind of dpi is.

switch (getResources().getDisplayMetrics().densityDpi) {
    case DisplayMetrics.DENSITY_LOW:
        System.out.println("low");
        // ...
        break;
    case DisplayMetrics.DENSITY_MEDIUM:
        System.out.println("medium");
        // ...
        break;
    case DisplayMetrics.DENSITY_HIGH:
        System.out.println("high");
        // ...
        break;
    case DisplayMetrics.DENSITY_XHIGH:
        System.out.println("xhigh");
        // ...
        break;
    }

For example, Nexus 4 has a density of 320 (xhdpi), Samsung Galaxy SII 240 (hdpi)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top