How to make layout for Android app intended for wearables with api under 20 -


i bought cheap chinese android watch android 4.4.2, api 19. create app work on watch android phones. problem if put special layout layout-watch folder, qualifier not work since can used minimal api version 20. also, if write this:

if(conf.uimode == conf.ui_mode_type_watch) { 

it returns false , behaves non-watch device. please give me hints how create "watch app" kind of devices should work on api 20+ ? how specify special layout wearables/watches ? how write condition can determine if current device wearable device/watch ?

thanks

i using this:

public static boolean iswatch(activity activity) {     if(build.version.sdk_int>=build.version_codes.kitkat_watch) {         configuration conf = activity.getresources().getconfiguration();         return conf.uimode == conf.ui_mode_type_watch;     } else {         if(uiutil.getdisplaywidth(activity)<320||uiutil.getdisplayheight(activity)<320) {             return true; //some dump chinese watch         } else {             return false;         }     } } 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -