Search code examples
javascriptandroidmobileuser-agenttablet

Targeting android mobile devices


Is this possible?

I want to exclude android phones from using some code, but I still want it to work on android tablets.

The only user agent I can find is "android" which will obviously exclude everything android related.


Solution

  • There are two ways you can proceed:

    1. Exclude the code at runtime, knowing the size of user's device. The actual width and height in pixels can simply be queried at runtime.
    2. Since there exists a multiple apk support, which means that you can publish a set of apk's targeting different devices, you can create two versions of your application, each targeting its set of devices.

    Hope this helps.