How can I test the 'uses:feature= telephony' requirement on an AVD? - android

I asked a question earlier about stopping tablets from an android app and I've added this line to the code:
<uses-feature android:name="android.hardware.telephony" android:required="true"/>
Now I want to verify it and be sure that the app cannot run on a tablet by testing it on an emulator. However, it seems like this requirement is always met on emulators. Is there another way to go about testing it?

You do, with that line, block all devices that do not have access to a SIM card from installing from Google Play. This isn't limited to tablets. THere may be phones without sim cards, and there are tablets with SIM cards and the ability to send text messages and make calls.
From Ken Wong's comment on the question:
Declared elements are informational only, meaning that the Android system itself does not check for matching feature support on the device before installing an application. However, other services (such as Google Play) or applications may check your application's declarations as part of handling or interacting with your application.
If you want to block tablets as a whole, that is basically impossible. This question offers a possible solution using the supports screens tag, but this, AFAIK, only makes the app incompatible on Google Play. If it is installed from a third party (USB debugging, APK mirror, from an APK file, etc) it can be installed. Once again we are back to the compatibility issue. The supports-screens tag is the same as the required tag: It is informational. Those who respect the tag doesn't allow installs. From this article:
An application that does not support small screens will not be available for small screen devices from external services (such as Google Play)
Small screens is just an example. If the support for any screen size is set to false, it will not be available from external services. Installing the APK directly (apk install outside Google Play or from USB debugging) bypasses it.
In addition, there are phones with xlarge screens. (They are more phablets I think the term is, but they are still phones. Just large ones).
So to summarize:
Using the required tag (should in theory) allow the app to install from third party sources, but Google Play shows it as incompatible. So USB debugging and APK installs (not from Google Play) allows install. Check for compatibility at runtime instead
Attempting to prevent tablets from accessing the app is basically stupid. Tablets can have SIM cards as well, blocking tablets because they have a bigger screen is not a good idea. Checking for the SIM card instead is the best way.
As for the emulator, AFAIK it would install in testing even though required is true. It will crash if you make calls to things it doesn't have. Have you checked to ensure the tablet emulator actually doesn't have telephony access?
Now I want to verify it and be sure that the app cannot run on a tablet by testing it on an emulator. However, it seems like this requirement is always met on emulators. Is there another way to go about testing it?
Well, required (as mentioned in a comment) is informational. The device itself doesn't check the conditions in the manifest (required = true at least). Once it is installed, check at runtime for compatibility. The required = true tag prevents installs from Google Play on unsupported devices (it shows up as "incompatible").
(Unfortunately) apps have a tendency to get pirated and uploaded to APK mirrors and similar sites (I know this from experience). These sites aren't like Google Play, and ignore the required = true calls. The app can be installed from these sites even on incompatible devices. So the best way to avoid incompatible usage is to check if the device has telephony access at runtime.
For checking on Runtime, that is a big field. Check this question for different solutions.

Related

Google Play: Your device is incompatible with this version -> "No Carrier"

I can't find anything online for this.
A user mentioned that he couldn't download my App because Google Play wouldn't let him. So I bought the device the user has (Galaxy Tab 3) because I couldn't figure it out remotely.
I can't find the App in the Play Store on the device. If I log in with the same Google account, it tells me that my device is incompatible with this App. All the information I have is "No Carrier".
Could it be possible that if my App needs an Internet connection I can't download the App if the device doesn't have a Sim-Card or something?
Update:
I have another flavor of this app in the store. The only difference (manifest-wise) is that this app needs camera permissions. But even if I make those optional (setting 'required' to false), it doesn't help. Also the specific model 'GT-P5210' is not listed in neither of my Apps in the supported devices list (even though I can find the other app in the store with the device). Also I made sure that there are screenshots for every possible tablet size.
Also I can of course install the App from Android Studio.
in the google play console, under store listing
add some screenshots for "TABLET".
without that, google play will think that your app is not meant for Tablets (which Galaxy Tab 3 is classified under).
The error indicates that there is a requirement listed in the app's manifest for phone networking. You need a phone to use it.

Check Small Screen support in android

I have put below code in android manifest file. So My app will not work in small size screens.
<supports-screens android:smallScreens="false" >
</supports-screens>
But now when I run application in small screen device via eclipse, it can be install.
If i want to check that small screen device cannot dwonload app from google play store how can I test?
I want to check before uploading to the play store.
You can not test without publishing app on playstore because only Google Play takes care of it.
To do so, you can enable filtering by external services such as Google Play by adding
elements to your manifest file that specify the screen configurations your application
supports.
External services such as Google Play use this information to apply filtering to your
application, so that only devices that have a screen configuration with which you declare
compatibility can download your application.
Fore more information Documentation
Publish your app via google play and check what devices will be rejected from use. If devices like HTC Wildfire is disabled you can be sure that small devices are not supported in your app.
When developers make apps, they have to specify any hardware/software requirements in a file called the androidmanifest.xml file.
These can be hardware or software requirements, such as if the app needs GPS, or telephony features - or if it will only work on a certain Android version.
When you use Google Play, it sends your device's 'features' to the server, and then filters apps accordingly.
The most likely reason it is deemed incompatible by Google Play is that it is set to require a certain screen resolution - or maybe portrait/landscape mode defaults.
Some tablets have a low resolution, and also tell google play that they cannot go into portrait mode.
It could also be, your tablet being generic, that it does not have the required GPS or sensors that the manifiest file says it needs, and the market is stopping you from installing because of that.
You can test by uploading apk file into the Google Play service. But, dont publish. Try to download/browse from/in Google Play in small screen devices. Make use of Sandbox.

How to test different Android OSs on physical hardware?

I wish to test my Android application against different versions of the Android OS on physical hardware. The need comes from testing interactions of my program with 3rd party hardware (barcode scanners).
In order to "switch" between Android OSs, I assume in order to "reimage" my phone, that I will have to root the phone then set the particular OS version with various images.
There seems to be much discussion on how to root the phones, however I'm curious if there is a easy/standard way to do this for developers (e.g. standard hardware which allows for this process to happen quickly/easily)? If not, how can I proceed?
Unfortunately, other than rooting your phone and flashing it w/ various OSs, you don't have a lot of options. My company keeps a tone of devices on hand running various different versions of android to address this exact challenge.
Otherwise, there are services out there that may be of help to you. Take a look at these:
http://www.deviceanywhere.com/
http://www.perfectomobile.com/
I'm sure there are others as well.
If it is just a testing of release candidate (not your BAU testing development), you may publish your app on Google Play as closed beta and then ask your friends (or some other community you trust) to play with the app.

Device Availability, filtering and Google Play

A question on limiting apps for devices. We've licensed software to device makers and we wanted to allow app developers to publish only on those devices (I'll call these "licensed devices"). Apps won't work on other devices("non-licensed devices").
I've found very helpful posts here about Device Availability & Google Play.
Android: Limit supported devices in Android Market
how to filter android app to be downloaded from google play to specific device? among others
With Device Availability, it looks like app developers have to manually select the universe of non-licensed devices from the dynamic list of supported devices and move these to the exclusion list. Seems like a lot of work for app developers, especially if they'd have to keep updating the exclusion list with each new Android device that's released.
I wanted to see if there's a means of doing the converse - making my app available only to a set of licensed devices. Is there a means of doing this with Google Play?
We've licensed software to device makers and we wanted to allow app developers to publish only on those devices (I'll call these "licensed devices"). Apps won't work on other devices("non-licensed devices").
Developers of such custom firmware extensions should do so as an SDK add-on, thereby requiring developers who use those extensions to have a corresponding <uses-library> element in their manifest. The Play Store should then automatically filter the app so that it only shows up on devices that have that SDK add-on. Motorola, HTC, Samsung, and others have created such SDK add-ons.
I wanted to see if there's a means of doing the converse - making my app available only to a set of licensed devices. Is there a means of doing this with Google Play?
No, sorry.
Tomorrow, if Google adds one more device to the list of supported devices then it will be automatically included to my supported devices list which I dont want to happen.
Then do not distribute the app on the Play Store.
Is there a mechanism to get a notification as soon as Google adds a new device to the list of supported devices in Google play console?
No, sorry.
If not, what is the alternate way of handling it.
Refresh your browser continuously, breathlessly waiting for the next update to the device roster.
I am sure many other android developers would have faced the same issue
Hopefully not. The Play Store is designed for distribution to all Android devices. The per-device exclusion list is designed for short-term compatibility issues, while you work out some bug fixes to overcome the issues.
It seems like Google has just released Google Play Private Channel, which could help you with your "licensed device" issue.
As said recently in this blog post: A new way to distribute your internal Android apps
Not natively. You can check the device type and exit if it doesn't match your whitelist, but that can easily be spoofed on rooted devices. If you have a library you can throw a fatal exception when initializing, etc.

market filter for memory class

Is there any way to hide apps in the android market for devices that fall in a certain memory class? eg. i only want to release the app for devices that have memory class 32 or higher( AcivityManager.getMemoryClass() ).
The <uses-configuration> tag only has screen / keyboard related flags, and <uses-feature> also has no memory related settings.
Is there any other way to specify necessary device attributes for an app?
I checked the AndroidManifest documentation and there is nothing that says anything about memory. The Market filters work with the information in the AndroidManifest, so I think it's not possible.
The only think I can think of is selecting devices in the Google Play console that are allowed to download it. But that requires a lot of manually selecting the correct devices.
Maybe you can request it as a feature with Google?

Categories

Resources