无法运行real.exe_连接,在Real Android设备上配置App并使用Android Studio运行Hello World程序。

无法运行real.exe

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

在这篇文章中,我们将学习如何与Android Studio连接和配置Android设备(智能手机等)。 之后,我们将运行一个简单的Hello World程序。

先决条件: (Pre-requisites:)

1) Android Studio installed on your PC (Unix or Windows). You can learn how to install it here .

1)在您的PC(Unix或Windows)上安装了Android Studio。 您可以在此处了解如何安装它。

2) A basic knowledge of Android lifecycle and different classes & functions used in Android Studio.

2)基本的Android生命周期知识以及 Android Studio中使用的不同类和函数。

Follow following steps for connecting smartphone with Android Studio:

请按照以下步骤将智能手机与Android Studio连接:

First we need to enable Developer options on Android device.

首先,我们需要在Android设备上启用开发人员选项

Go to Settings of the Android Device and then System Settings as shown below:

转到 Android设备的设置” ,然后转到 系统设置” ,如下所示:

device_system_setting.png

Click on About Phone (In some devices it is About Device). Following screen will be opened:

单击关于电话 (在某些设备中是关于设备)。 将打开以下屏幕:

settings_about_phone.png

For Android version higher than 4.4, developer option is hidden. In the above window there will be a Build number.

对于高于4.4的Android版本,隐藏了开发人员选项。 在上面的窗口中,将有一个内部版本号。

You need to hit this build number 7 times. It is common for all android devices. Now go back to settings again. You will see developer options as shown below:

您需要按此内部编号7次。 这对于所有android设备都是常见的。 现在,再次回到设置。 您将看到如下所示的开发人员选项:

device_developer_option.png

Select developer options and then select USB debugging option. Connect your Android device with Android Studio through micro USB wire. Select photo transfer (PTP) option.

选择开发人员选项,然后选择USB调试选项。 通过微型USB线将您的Android设备与Android Studio连接。 选择照片传输(PTP)选项。

Now open Device Monitor in Android Studio and you will be able to see device connected.

现在,在Android Studio中打开设备监视器,您将能够看到已连接的设备。

So we have successfully connected and configured android device. Now let’s run a Hello World App on our configured device.

因此,我们已成功连接并配置了android设备。 现在,让我们在配置的设备上运行Hello World应用程序。

建立新专案 (Creating new project)

Please follow following steps:

请按照以下步骤操作:

  1. Open Android Studio and make a new project with name “Android Device” and company domain application.example.com (I used my company domain i.e androidtutorialpoint.com. Similarly you can use yours).

    打开Android Studio并创建一个名为“ Android Device”和公司域application.example.com的新项目(我使用了我的公司域,即androidtutorialpoint.com。同样,您也可以使用您的公司域)。
  2. Click Next and choose android version Lollipop. Again Click Next and Choose Blank Activity.

    单击下一步,然后选择android版本Lollipop。 再次单击下一步,然后选择空白活动。
  3. Leave all things remaining same and Click Finish.

    保留所有内容不变,然后单击“完成”。

Now you can see MainActivity.javacontent_main.xml and strings.xml. If you are not able to see them then click on the left window where these files can easily be located as shown in following figure:

现在,您可以看到MainActivity.javacontent_main.xmlstrings.xml 。 如果看不到它们,请单击左侧窗口,可以很容易地找到这些文件,如下图所示:

java_xml_view.png

Run the code (Shift+F10) . Following window will pop up:

运行代码(Shift + F10) 。 将弹出以下窗口:

device_emulator.png

Select the device and click Ok. Boom!! Our App is working and running fine. Hello World will be shown on Android Device.

选择设备,然后单击确定 。 繁荣!! 我们的应用程序正常运行。 Hello World将显示在Android设备上。

下一步是什么 (What’s Next)

You can see our next tutorial of How to make a basic App. Here You will be able to make an App from scratch without any external help.

您可以查看我们的下一个有关如何制作基本App的教程。 在这里,您无需任何外部帮助即可从头开始制作应用。

翻译自: https://www.experts-exchange.com/articles/28700/Connect-Configure-App-on-Real-Android-device-and-Run-Hello-World-program-with-Android-Studio.html

无法运行real.exe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值