我已经下载并安装了黑莓模拟器,并在VMWare虚拟机中运行它。我已经运行了它的控制器。然后,我在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>
这是应用程序的 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代理管理器,然后点击正在运行的BlackBerry模拟器的播放图标。现在,如果我通过单击Android Studio中的绿色运行箭头来运行我的Android项目,则BlackBerry模拟器不会显示在Android设备列表中。我应该怎么做才能在BlackBerry模拟器上运行我的Android代码?