我已经下载并安装了 BlackBerry Simulator 并在 VMWare Machine 中运行它。我已经运行了它的控制器。然后,我在 android studio 中创建了一个简单的 hello world 项目。这是 MainActivity.java:
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
这是 XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.vats.vatishs.helloworld.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
这是app的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 18
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.vats.vatishs.helloworld"
minSdkVersion 11
targetSdkVersion 18
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:18.+'
}
然后我运行 BlackBerry ADB Proxy Manager,然后单击运行 BlackBerry 模拟器的播放图标。现在,如果我通过单击 android studio 的绿色运行箭头来运行我的 android 项目,BlackBerry 模拟器不会显示在 Android 设备列表中。我应该怎么做才能在黑莓模拟器上运行我的 android 代码???