How do I know if my application works on Bluestacks?

I am working on a special version of my application that should work on Bluestacks . This is a windows / mac application that allows you to run Android applications on a computer.

I would like to implement special behavior when the application runs in Bluestacks. Nothing complicated, perhaps showing a dialog or disabling some buttons.

But for this I need to know if the application is running on a Bluestacks device. I checked the device model ( Build.MODEL ) and the manufacturer ( Build.MANUFACTURER ), but I realized that this is a Samsung GT i900 device.

Does anyone know a definite way to find out if an application works on Bluestacks?

I know this is a fairly localized question, but it would be nice if I got some ideas on where to look or what to try.

+4
source share
4 answers

Finally, I decided to create a new application for Bluestacks using the Android library. This allows me to add special behavior to the bluestacks application.

I tried to get all the information using the Build class, but it returns the same as the Samsung Galaxy GT i9000 device, so it is impossible to find out that the device works in bluestacks.

+1
source

Try the following:

 /** * Returns true if device is Android port to x86 */ public static boolean isx86Port() { String kernelVersion = System.getProperty("os.version"); if(kernelVersion != null && kernelVersion.contains("x86")) // for BlueStacks returns "2.6.38-android-x86+" return true; return false; } 
+5
source

try under the code:
File test = new File("/data/Bluestacks.prop"); boolean isRunningInBluestacks = test.exists();

+1
source

It will be unique.

Bluestack does not have a Bluetooth device.

So try to get the Bluetooth address bar, which is always "null" on Bluestack or any emulator. Make sure you add Bluetooth permission to the project manifest.

 BluetoothAdapter m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); String m_bluetoothAdd = m_BluetoothAdapter.getAddress(); 
0
source

Source: https://habr.com/ru/post/1478929/


All Articles