How to check if app is running on tablet?

How to check if my app is running on a tablet? How will my app look like on a tablet?

1 Like

there is option in device selection, there are 2 tablets there, check on that

2 Likes

Yes but that is just a preview. Actual app may look different on a tablet because of screen sizes.

that’s on you, how you set your design, mostly use fill parent, dialogues and for buttons and other things use px that will show axact button or layout size as u set

1 Like

Okay thanks

1 Like

welcome , use kodular given tablets for view, its may near to other tabs, so there is only 1 percent chances left that app looks different from your design

1 Like

but if you want to customize the content according to tabs and mobiles differently you may get the screen.width and Screen.height to conclude the screen size using if-else but make sure you use it only when necessary

1 Like

Install Genymotion or any other Android emulator (Bluestacks is good too) on your computer, then select the device you want to try your app on and install your app by dragging and dropping the apk file in it.

1 Like

If you check the IMEI number you can check if it is a tablet or not. All phones have an IMEI number and some tablets. So if there is none you can almost conclude that you are running on a tablet. It is not 100% proof.

image

1 Like

Nice idea…But will it ask permission to get IMEI ?

I don’t know. I guess not. You could test that.

The companion is asking permission so i guess it will ask in apk to.

image

Some tablets (like the iPad with 3G) have IMEI numbers. I think any device that has a phone number has an associated IMEI, and some tablets do come with SIM options.

2 Likes

I know. But it would/could be the closest in finding the difference of most phones and tablets. Most of them don’t have that feature yet i think. I shall edit my post.

1 Like

As far as I know, OEMs have dropped SIM support for tablets. If you find a tablet with call functionality, chances are it’s quite old.

1 Like

Alternatively, you can use a hidden web viewer and run some JS to fetch the window.navigator.platform, which returns the device the web view is running on.

1 Like

there was an extension, which is able to detect it… but I forgot, which one… :wink: probably one of the tools extensions, not mine…
the extensions directory is here App Inventor Extensions | Pura Vida Apps

Taifun

2 Likes

I don’t want user use my app on tablet just because I think the layout and components would not fit into the screen of the tablet properly because the app is designed for phones not tablets. But I’m not sure about it.

Yes I have also seen it but I can’t find it now.

If you’re distributing your app on the Play Store, you can disable certain devices from downloading it. I think they have an option to disallow tablets from downloading your app. If enabled, your Play Store listing will show “designed for phones”

1 Like

Yes I am going to upload on Play Store. I’ll check it… thanks!

1 Like