Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know whether my App is running on Bluestacks?

I'm working on a special version of my App which should run in Bluestacks. It's a windows/mac application which allows to run Android apps on the computer.

I would like to implement special behaviour when the app runs in Bluestacks. Nothing complicated, maybe showing a dialog or disabling some buttons.

But for that purpose I need to know whether the app is running on a Bluestacks device. I checked the device model (Build.MODEL) and manufacturer (Build.MANUFACTURER), but I get that the device is a Samsung GT i900.

Does someone know an unambiguous way to know whether an app is running on Bluestacks?

I know it´s rather a quite localized question, but it would be fine if I get some ideas about where to look at, or what to try.

like image 356
Esparver Avatar asked May 03 '13 07:05

Esparver


People also ask

How do I know if an app is running or not?

There are a few ways to see what apps are running in the background and consuming your Android's resources. Go to Settings > System > Developer Options. If you don't see Developer Options, scroll down and select About phone, then look for Build number and tap it seven times. Tap Running Services.

How do I find my installed apps on BlueStacks?

The 'System apps' icon is available under the 'My games' section at the end of the list of apps installed on your BlueStacks. Clicking on the 'System apps' icon opens a set of tools, as shown below.

How do I close a game on BlueStacks?

Click on the "X" button on the top right corner of the app that you wish to close. Alternatively, you can also click on "Clear all" to close all of the previously opened apps. 1.

Why my game is not opening in BlueStacks?

Restart BlueStacks and launch the app again. Clear the app cache: Open the "System apps" folder from the home screen of BlueStacks. Navigate to Settings > Apps. Locate the app from the "All apps" list and click on it.


2 Answers

Try this:

/**
* 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;
}
like image 100
MADev Avatar answered Sep 21 '22 22:09

MADev


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

like image 26
xiaoweiz Avatar answered Sep 19 '22 22:09

xiaoweiz