Android Question In manifest: Tablet only

yfleury

Active Member
Licensed User
Longtime User
How to set my app for tablet only?

B4X:
<supports-screens android:largeScreens="true"
    android:xlargeScreens="true"
    android:normalScreens="false"
    android:smallScreens="false"
    android:anyDensity="true"/>)
with this code I have 206 phones and 1798 tablets.
My app don't support phones ( it useless)
 
Last edited:

yfleury

Active Member
Licensed User
Longtime User
Do you like installing an app on your phone and many part of ui is not available because the app is for tablet only? I don't like lost my time for an app like that.
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
I am sure you looked at this but just in case...
https://developer.android.com/guide/practices/screens-distribution.html

It appears that with current devices pushing the envelope of size and pixel density, there is no full proof way of excluding
large or high density phones (or normal sized tablets with phone capabilities if that is what you want).

And you probably do not want to tell a user that the App can't be installed because it has phone capabilities.
That is why I asked Why not phones? Is it the size? Or cellular access? Or security?

Your code in post #1 is correct for allowing only large and xlarge screens. But then some phones with high pixel densities will be allowed during
installation. You can tweak that somewhat, but ultimately after filtering out most small screens at installation, the remaining with high density and
small physical size will have to be excluded at run time.
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
I am sure you looked at this but just in case...
https://developer.android.com/guide/practices/screens-distribution.html

It appears that with current devices pushing the envelope of size and pixel density, there is no full proof way of excluding
large or high density phones (or normal sized tablets with phone capabilities if that is what you want).

And you probably do not want to tell a user that the App can't be installed because it has phone capabilities.
That is why I asked Why not phones? Is it the size? Or cellular access? Or security?

Your code in post #1 is correct for allowing only large and xlarge screens. But then some phones with high pixel densities will be allowed during
installation. You can tweak that somewhat, but ultimately after filtering out most small screens at installation, the remaining with high density and
small physical size will have to be excluded at run time.
Effectively I looking now for android:screenDensity=
But my customers have to install my app on tablet 7in minimum with a LTE to connect server. I am not sure I can restrict all phones for my app.
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
May be better solutions to explore on
Maybe android:requiresSmallestWidthDp ?
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
A TYPICAL 7" tablet has a smallestWidth of 600dp. Note that 1Dp = 1/160 of an inch, so that limits downloading of Apps to devices that in
Landscape mode are less then 3.75 inches HIGH, irrespective of Landscape width.

That might work for you, but for one App I have that is still too small.

Also note that

Caution: The Android system does not pay attention to this attribute, so it does not affect how your application behaves at runtime. Instead, it is used to enable filtering for your application on services such as Google Play. However, Google Play currently does not support this attribute for filtering (on Android 3.2), so you should continue using the other size attributes if your application does not support small screens.

Finally, if the App is downloaded and at run time it determines that the screen it is running on is substandard for the App,
you need to warn the user and provide some viable alternatives (even a refund if Paid for)

[Or perhaps not charge the user unless it is run on a compatible device]
 
Last edited:
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
Well, I am going the hard way, redesigning may app for hlarge and xlarge
 
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
How to set my app for tablet only?

B4X:
<supports-screens android:largeScreens="true"
    android:xlargeScreens="true"
    android:normalScreens="false"
    android:smallScreens="false"
    android:anyDensity="true"/>)
with this code I have 206 phones and 1798 tablets.
My app don't support phones ( it useless)
Although far from an ideal solution you could manually exclude the 206 phones....?
 
Upvote 0
Top