how to run android app only on phone ,not on tab - android

I have developed one android app which intended to run only on phone.But it also run on Tab
I have made changes in Manifest file as following-
<supports-screens
android:anyDensity="true"
android:largeScreens="false"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="false" />
But it doesn't work.
What is the way to setup android app using code which only run on phone, not on android tab.

Just add this line in the Manifest.xml :
<uses-feature android:name="android.hardware.telephony"/>
If the device has no dialer and a data network, this one will be excluded from GooglePlayStore.
Check this: Google Play Filtering
On the other hand, if you change the supports-screens property you will have problems with devices with high density displays.
Good luck!

Related

Are the Android manifest device-filtering options broken or am I missing something?

I was trying to prevent users from downloading my app on devices that are clearly incapable of running it (it's a Unity3D game), and figured I'd use android:glEsVersion and screen size as a filter to get rid of the worst of them.
With the following two lines in my manifest, Google Play filters my list of compatible devices down to (a surprisingly low) 905 valid devices:
<supports-screens android:smallScreens="false" android:normalScreens="false" android:largeScreens="true" android:xlargeScreens="true" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
(Without them, I get 4489 valid devices)
One of the devices that gets removed is my own Nexus 5, but it has OpenGLES 3.0 support and a resolution way above the definition for "largeScreen", so it makes no sense to me at all.
Does anyone have any idea what's going on? GooglePlay does not say why a given device is excluded, so it's kind of hard to backtrace.
I don't think that will work, but did you try to add
android:anyDensity="true"
But in https://developer.android.com/guide/topics/graphics/opengl.html#manifest we can see :
If your application uses OpenGL features that are not available on all devices

Restrict app to be installed on android tablets and kindle devices only

Until now I was restricting my app to only run on tablets by having something like this in the manifest file:
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:requiresSmallestWidthDp="600"
android:smallScreens="false"
android:xlargeScreens="true" />
I am preparing to launch on Amazon Fire for the first time and because of the following restriction: "requiresSmallestWidthDp="600", many users will be affected as the app cannot be installed on this device. I am getting the following error message: "android:requiresSmallestWidthDp = '600'; device requires '527'".
As the Fire 2015 is the most popular tablet, I would really like to allow the app to be installed on it, but at the same time I don't want my app to be installed on phones. Any suggestion on how to achieving this?
There is no clear technical distinction between a tablet and a phone, so if you really need to filter out non-tablets, you need to resort to other filters. If it's about your app's UI, the support-screens and compatible-screens are your best bets. Just remember that some phones have a higher screen resolution than some tablets.

Android buttons turn black when pressed (if supports-screens in in the AndroidManifest.xml)

I've built a test app to demonstrate the problem.
I have an Android app which has a couple of buttons with semi-transparent gradient background.
The problem is - when the button is pressed, the space under the button turns black (screenshot provided).
After a long time of searching for the cause i've found, that the problem is caused by this entry in the AndroidManifest.xml:
<supports-screens
android:anyDensity="false"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
If i delete it, everything is ok. Anyone have any thoughts on this one?
P.S
I should mention, that this may be device specific, since i have a Samsung Galaxy S phone (i9000) but with android 4.3 flashed to it (don't judge me on that :D)
It is probably to do with the line
android:anyDensity="false"
According to the official documentation on supports-screens found at Supports Screens Element,
"you should not set it "false" unless you're absolutely certain that it's necessary for your application to work."
It then references the documentation on Supporting multiple screens which says that if it is false, the drawing operations can have unexpected behaviour. See Supporting Multiple Screens, point 2 on Auto-scaling of pixel dimensions and coordinates.
Hopefully this provides an explanation.

Toast size on Galaxy Nexus

When I use toasts in my app, the size is very very small. But when another app displays a toast, the size is normal (like Advanced Task Killer, or SMS).
What do I have to do to get normally-sized toasts?
I have a Galaxy Nexus ICS=4.0.1, and my app is using SDK API level 7 (android 2.1+).
Thank you ! (x1000)
Adding
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"/>
to my manifest, solved my problem...
you may need to use a Custom ToastView
Maybe this is a theme problem... Can you try to implement Using Holo while supporting Android 2.x in this post ?
I finally fixed this by removing android:anyDensity="false" from my supports-screens element in my manifest. I'm not sure why I had it there in the first place, except that I started that app from one of my rather old apps instead of from scratch.
That setting also caused my activity to be realllllly small (order the order of 25px by 20px) when I ran with targetSdkVersion 14 or 15 on my nexus. Seems like a bug.

Problem running apps fullscreen in emulator

I've created a device targeting 2.1 and having a screen screen size of 480x800 (WVGA). Some apps, including the one I'm currently writing, as well as the ApiDemos example, won't run fullscreen. I've uploaded a screenshot here: http://img248.imageshack.us/img248/503/emulator.png
What could cause something like this? If I run these apps on my HTC Desire (which has the same resolution), they utilize the whole screen like they should.
Well I finally found a solution. In case anyone else comes across the same problem, the solution is to add the following to your AndroidManifest.xml:
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<uses-sdk android:minSdkVersion="4"/>
<uses-sdk android:targetSdkVersion="10"/>
Putting sdk version in androidmanifext file will make it work too.

Categories

Resources