我已经下载并安装了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设备列表中不会显示BlackBerry模拟器。 我应该怎么做才能在BlackBerry模拟器上运行我的Android代码???
I have download and install BlackBerry Simulator and run it in VMWare Machine. I have run its controller. Then, I have created a simple hello world project in android studio. Here is MainActivity.java:
public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }Here is 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>Here is build.gradle of app:
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.+' }Then I run BlackBerry ADB Proxy Manager, and then I click on play icon of running BlackBerry simulator. Now if i run my android project by clicking on green run arrow of android studio, The BlackBerry emulator is not shown in Android device list. What I should i do to run my android code on BlackBerry simulator???
最满意答案
我做了以下操作让它出现在Android工作室:
您需要转到Android Platform-tools文件夹。运行命令
./adb连接正在运行的设备的IP
然后,该设备应出现在您的Android Studio设备列表中。
**与您提供给BlackBerry ADB Proxy Manager的相同
I did the following to make it appear on Android studio:
You need to go to Android Platform-tools folder.Run the command
./adb connect IP of your running device
Then, the device should appear in your Android Studio Device list.
** Same as the one you given to the BlackBerry ADB Proxy Manager
更多推荐
发布评论