Android - how to find out from within running app if device it is running on is phone or tablet -


this question has answer here:

is there method identify if device app running on phone or tablet? want implement different behavior depending of device type.

if want differnce because of screensize, should find screensize, not easy, there tablets small screens , phones large screens. still, ofcourse possible screen size.

you try do gsm capabilities. again, there exceptions, tablets can call..

i advise against making differentiation, , define on basis need. screensize, capabilities etc. might groups consist of both "phones" , "tables", you'll have better knowledge of group like.

i'm still not sure how define "tablet" , try needs definition, if take @ this link, can see might (did quick read) things consider tablets not identify in user-agent string mobile device. but:

  • you need useragent string devices' browser. illogical use guess
  • useragent strings can changed, people don't want mobile sites, change agent string. influence behaviour, weird.

in end think need define tablet is, , check that!


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -