1

I want to run my application only on Galaxy S3 in Android. What do i have to change in Android:Manifiestfile.I searched a lot here on SO as well as on Google but still haven´t found the right solution.Please someone help me with this issue.Thanks in advance.

<supports-screens
    android:anyDensity="true"
    android:compatibleWidthLimitDp="120"
    android:largeScreens="true"
    android:largestWidthLimitDp="120"
    android:normalScreens="false"
    android:requiresSmallestWidthDp="120"
    android:resizeable="true"
    android:smallScreens="false"
    android:xlargeScreens="false" />

What do i have to change in the above code or do i have to add here something else?

Obl Tobl
  • 5,604
  • 8
  • 41
  • 65
Biginner
  • 243
  • 1
  • 2
  • 15

3 Answers3

2

You need to use android.os.Build and use the Build.MODEL, Build.PRODUCT and Build.MANUFACTURER fields.

But this will only work post-installation.

String mf = android.os.Build.MANUFACTURER;

if (mf.equals("Samsung")) {
    //device is samsung
} else {
    //device not samsung
}

Then expand that logic to include the model. I don't know what technology you are using for your app, but basically you can put an init() or a main() or w/e when the check succeeds, and then give the user some kind of dialog or message to tell him why it fails (he has the wrong type of device)

As mentioned earlier though, you can restrict the app to specific devices when you publish the app itself.

This little hack will only work post-installation, when the device runs your code.

2

You can restrict to certain devices/phones in the developer console where you publish your apps. Not in your app.

Update: Se also this reply: How to restrict android app to specific device make?

Community
  • 1
  • 1
Mattias Isegran Bergander
  • 11,811
  • 2
  • 41
  • 49
  • well i cannot do it with Android:Manifest file or any other solution other than you give me here.Thanks. – Biginner Dec 20 '12 at 04:03
1

If you are going to publish in the Play store, you can pick which devices can install your app. Search for something like this:

This application is available to over 2242 devices. Show devices

Macarse
  • 91,829
  • 44
  • 175
  • 230