26

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).

2
  • Here is a good article mobile.tutsplus.com/tutorials/android/… . Similar to accepted answer Commented Feb 14, 2013 at 13:16
  • In short, there is as of this writing, no way to do this through the Google Play Developer console. While there are some tricks here to use scripts to automate hitting the 'Exclude' button for thousands of devices one at a time, there is no whitelisting concept, and new devices are included by default. The only way to really accomplish this is targeting a unique hardware feature, but this of course needs to be defined in the device's firmware. Commented Aug 11, 2017 at 12:17

9 Answers 9

32

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.

Sign up to request clarification or add additional context in comments.

5 Comments

This is comprehensive... Thanks for the help Soham.
While this still pertains, if you wanted to do a select all or simply remove numerous manufacturers at once, it seems like a daunting process of one by once exclusion.
Can you exclude one set of devices for v1.0 of your app and a different set of devices for v2.0 of your app?
@Brendan Did you ever find a way to do this? As far as I can tell you can only exclude devices on a per app basis, not per apk...
@soham: What if the new device is launched. In that case by default it will be set to be enabled and that will be allowed to download.
30

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.

5 Comments

I wish I would have seen this comment before I took the time to write my own script. This saved my company a lot of time. Here is the script I wrote, but yours works too. var nodes = document.getElementsByClassName("GLBE-H2DLBB GLBE-H2DMBB"); for(var i=0; i < nodes.length; i++) {    nodes.item(i).setAttribute("aria-checked","true"); }
@MichaelDePhillips: Your way is probably much quicker - thanks for writing it up :)
It is quicker, but it seems it only toggles the switches visually and not functionally. Looks like yours is the only one that works! Thanks for posting this, I would have been stumped.
Thanks for posting this guys! I like the script posted by @Desty as it marked everything as unsupported.
For folks who don't know much about html/dom (like me), note that you will need to change the class name (ABC DEF) mentioned in this solution to match the class name found in the webpage served to your browser. To find the correct class name, search through the DOM (using Firebug) until you find a long list of <li>'s which hold spans that have role="checkbox"; the class name you should use is the class of that span.
19

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.

2 Comments

I'm writing an app that can only go on Samsung devices and this post saved me a lot of time clicking!! What I ended up doing was first selecting the 'Supported Devices' list and running the above script to de-select everything. I saved this and then opened the Manually Excluded devices list. Finally, I did a search for "Samsung" and ran the same script again - but this time with "true". Now, only Samusung devices are allowed to install!
I'm not able to re-run the above code on Google Developer Console Page. Please help me out
2

Well you can do it a logical way.

First the hardware details using getResources().getConfiguration() . Now you can give condition if your hardware is of this mdel Or name then go on.

1 Comment

Although @Soham's answer is the one I went for, I also like this answer too.
2

I have written a script to disable devices by brand based on the script from KrisWebDev.

You have to locate the <ol> of your chosen brand, edit and add id="sarasa" to it, then run this script to disable all:

var nodes = document.getElementById("sarasa"); for(var i=0; i < nodes.childNodes.length; i++) { if (nodes.childNodes[i].childNodes[0].getAttribute("aria-checked") == "false") { nodes.childNodes[i].childNodes[0].click(); } } 

2 Comments

I'm not able to re-run the above code on Google Developer Console Page. Please help me out
Hi Ameya, what's exactly the issue ?
2

I have written a little script using different part from answers on this page (thanks @Desty and @MichaelDePhillips). The script is quick (between 100 and 200ms on my computer) and you can specify a brand to not switch. Here is the script :

console.time('Execution time'); var manufacturers = document.querySelectorAll('[data-manufacturer-group]'); for (var i = 0; i < manufacturers.length; i++) { var manufacturer = manufacturers[i]; var brand = manufacturer.firstElementChild; if (brand.tagName == 'H3' && brand.textContent != 'Samsung') { console.log(brand.textContent); var tags = manufacturer.children; for (var j=0;j<tags.length;j++) { var tag = tags[j]; if (tag.tagName == 'OL') { var devices = tag.children; for (var k=0;k<devices.length;k++) { var device = devices[k]; if (device.tagName == 'LI') { var checkbox = device.firstElementChild; var attr = checkbox.getAttribute; if (checkbox.tagName == 'CHECKBOX') { checkbox.setAttribute('aria-checked', 'true'); } } } } } } } console.timeEnd('Execution time'); 

This is my first javascript, all feedbacks are welcome.

2 Comments

This certainly switches the toggles but unfortunately does not save the changes for me.
Thanks. I used your script but had to change checkbox.setAttribute('aria-checked', 'true'); to checkbox.click()
0

when you are going to upload a application to market, on publishing page you will have available devices option where you can add/delete devices. By this way you can filter out devices by manufacture and model name.

Comments

0

For check/Uncheck all checkbox in the supported device page in Google play console, use the below script.This script is working fine for latest Google play console. Just copy paste in the console of your browser(tested with CHROME and FIREFOX).

function runScript() { for (var bxs = document.getElementsByTagName("input"), j = bxs.length; j--;){ if (bxs[j].type == "checkbox"){ bxs[j].click(); } } let nextPage = document.querySelector('button[aria-label="Next page"]:enabled'); if(nextPage){ nextPage.click(); console.log("next page start"); setTimeout(runScript, 20); } } runScript(); 

Comments

0

As the Google Play console design as evolved, I did not succeed to make the previous work. I notice that only the first checkbox state was modified. It seems that every click makes a POST to google server. After some attempts, I found that adding a tempo allows to loop on checkboxes. Here is the Javascript that works for me. Just copy paste in the console of your browser (tested with CHROME and FIREFOX). Note that you will have to replace "Next page" in the querySelector of next page button if your loan is not English.

function uncheckAll() { const cbxSelector= 'input[type=checkbox]:checked:enabled' let checkBoxes = document.querySelectorAll(cbxSelector) if (checkBoxes.length > 0) { checkBoxes[0].click(); setTimeout(uncheckAll, 20); }else{ let nextPage = document.querySelector('button[aria-label="Next page"]:enabled'); if(nextPage){ nextPage.click(); setTimeout(uncheckAll, 20); } } } uncheckAll(); 

If you are willing to check all the check-boxes just replace 'input[type=checkbox]:checked:enabled' with 'input[type=checkbox]:checked:disabled'

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.