1

I'm developing an app for a client that wants different behavior on phones and tablets.

How can detect it?

Notes:

  • I know there are similar questions in SO, but my case is not about "supporting large screens" or "being able to make a call".
  • If possible, I'd like a programmatic way. If not, I can build two APKs.

Edit:

I know sometimes it's hard to tell what's a phone and what's a tablet. But the client requirements are something like:

A big phone is still a phone. A GSM tablet is still a tablet.

The phone version is for personal use, we trust less in this users, so they use that unconvenient authentication method with the server.

The tablet version is for business use, we trust more in this users, so they use the simplified authentication method with the server.

But, I'd like both being downloadable at Google Play. With the phone version being downloadable just by phone and the tablet version being downloadable just by tablets.

Kara
  • 6,115
  • 16
  • 50
  • 57
Alex Oliveira
  • 893
  • 1
  • 9
  • 27
  • 3
    "I know there are similar questions in SO, but my case is not about "supporting large screens" or "being able to make a call"." -- then what, pray tell, is your definition of a "tablet"? – CommonsWare Aug 07 '13 at 19:17
  • it depends on the definition of a tablet I guess because there are phones that are 6+ inches, that could be a small tablet. there is no way to tell if the device is a tablet or not – tyczj Aug 07 '13 at 19:18
  • Check out this answer http://stackoverflow.com/questions/9279111/determine-if-the-device-is-a-smartphone-or-tablet – Cam Connor Aug 07 '13 at 19:38
  • @CommonsWare It's not my definition, it's the client's definition. Something like "Phone version is for personal use and we trust less in this users. Tablet version is for business use and we trus more in this users." – Alex Oliveira Aug 07 '13 at 20:18
  • 1
    And, as you are hopefully aware, your client's definition is meaningless. Until and unless your client is capable of telling *you* what the actual difference is between a phone and a tablet, how precisely do you expect to ask *Android* to tell you whether a device is a phone or is a tablet? If the distinction is not based on screen size, and it is not based on whether the device has telephony, what is it based on? – CommonsWare Aug 07 '13 at 20:24
  • I don't see the point in having a different behavior of an app in terms of security if they use a tablet or a phone, it doesnt matter what the client thinks in this case. You should have two different types of login on the same app: one for personal use and the other one for business. I'm trying to imagine a scenario where that your client could need 2 versions but i can't think of one. – Gabriel Netto Aug 07 '13 at 21:02

1 Answers1

-1

Make two builds one that will be for the 'untrusted users' and another that the company will give to people they 'trust' to use.

There is no need to even bother checking what kind of device they are using. Just make sure your client doesn't offer the less secure version to the customer who is considered non-business.

SteveKB
  • 190
  • 6