Monday 15 April 2013

cordova - How to check weather the device is iPad and tablet in phonegap -


How to check phonegap in device? In fact, I need that my application is only running on tablets or iPhones. Prevent your application on other phones, only run Android tablet or ipad in iPad. Is it possible to check this in PhoneGap?

Thanks

intro

There are many available solutions. Some are provided by javascript, some are free and some are paid services plus some are on the server side and some are client side but with this mail, I think you need a client-side solution.

Client Side Detection:

-

The increasing benefits of cool new web technologies are very fun, as long as you Modernizr makes it easy for you to handle conditional javascript and CSS in every situation, whether a browser supports a feature or not. This is easily correct to progressive growth.

Good:

Only client side, server side component is not existent

fast but with its 12kb Still big for a JavaScript framework

Poor:

Only information that can provide less information, server-side detection.

There is a great way to find out about your user's browser capabilities in a modern way. However, you can only access your API on the browser, which means that you can easily benefit from knowing about browser capabilities in your server logic.

  • It can be found here:

    Example:

           

    Good:

    Simple

    Bad:

    This will only tell the device type, but this device will not provide the version. For example it will tell you The iPad used us but not, if this version is 1,2 or 3.

    Example: