Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restrict android app to specific device make?

I am developing an android app for SPECIFIC brand of phones - that's the project requirement not my decision.

So I need to be able to make the app available in the android marketplace only to those devices that are produced by that SPECIFIC manufacturer.

I don't seem to be able to find how to do that.

Is it possible?

P.S. I can retrieve the device make in the android code. So I suspect that the market app should be able to filter by the device make as well. I just don't know if it actually does (would be great if it does).

like image 579
Nar Gar Avatar asked Mar 01 '12 04:03

Nar Gar


People also ask

How do you limit which Android devices can download your app?

Select the Excluded devices tab. Next to "Exclusion rules," select Manage exclusion rules. Don't exclude Android Go devices: Selected by default. Exclude Android Go devices: Prevent devices running Android Oreo (Go edition) from installing your app on Google Play.

Can you block an app on Android?

To block app installations on Android devices, admin can navigate to Android Profile -> Restrictions -> Applications -> Users can install unapproved apps.


3 Answers

You don't need to filter your app based on device/manufacturer in the application code, instead you can do it from the android market developer console - https://market.android.com/publish/ just when you publish the app itself.

There is a 'Supported Devices' section on the developer console, which shows you a list of all the devices which can access the android market. You can then filter out devices or manufacturers that are not compatible with your app

This is the section in the main developer console:

This is the section in the main developer console

Here you can exclude devices and/or manufacturers from being able to see your app

Here you can exclude devices and/or manufacturers from being able to see your app

For more information please refer to the Device Availability help page which says:

The Device Availability dialog can help developers in two powerful ways:

Understand which devices can find your app in Android Market

  1. Device Availability provides a dynamic list of compatible devices based upon your manifest settings. For example, if your apk’s manifest specifies a large screen size, the console will reflect the supported devices that can find your app in Market.

  2. You can also use the dynamic search feature to see the devices that your application will not be available to. You can search by manufacturer, the design name (E.g. “Passion”), or the actual public device name (E.g. "Nexus One"), to see if your manifest settings filtered a device. Filter problematic or non-compatible devices This feature provides a device-specific administration option to developers. When you add a device to the “Manually Excluded Devices” list, your app will not be available to that excluded device in Market. This is primarily intended to help developers provide the best user experience possible, by helping developers filter out devices known to have compatibility problems.

like image 64
Soham Avatar answered Oct 14 '22 18:10

Soham


In the Supported Devices section of the developer console page, you can view the list of all devices. This loads over 2,000 slider-type checkboxes which are initially set to enabled. Unfortunately there doesn't seem to be a "disable/enable all" option in the interface...

...Instead, I used Firebug's inspector tool to get the classname for these slider objects (can't recall what it was now - two random uppercase acronyms), then executed an expression in the Javascript console which toggled the state of every slider. Something like:

switches = document.getElementsByClassName("ABC DEF"); for(i = 0; i < switches.length; i++) switches[i].click(); 

This froze the browser for a minute or two, but afterwards, every phone was marked as unsupported. Then you can enable the phone(s) you need to support.

like image 31
Desty Avatar answered Oct 14 '22 16:10

Desty


Below is an improvement of Desty answer with:

  • Auto-detection of class name
  • Really unchecks: works even if you already have some boxes unchecked

Code:

var className = document.evaluate( 'string(//li[@data-device-id]/checkbox/@class)', document, null, XPathResult.STRING_TYPE, null ).stringValue;

switches = document.getElementsByClassName(className);
for(var i=0; i < switches.length; i++) {
   if (switches.item(i).getAttribute("aria-checked") == "false") switches[i].click();
}

This script takes about 1 minute to get executed. Run it from your browser Javascript Console.

like image 40
KrisWebDev Avatar answered Oct 14 '22 16:10

KrisWebDev