如何运行那些Android SDK示例应用程序?

发布于 2024-12-03 17:05:16 字数 339 浏览 3 评论 0原文

我有 64 位 Windows 7 Professional、Android SDK 和适用于 Eclipse 的 ADT 插件。在Android SDK的examples目录中,至少有三个不同的SoftKeyboard目录。我应该使用哪一个?

如何运行该软键盘?我尝试过,但根本没用。

您也可以从这里找到它: http://developer.android.com/资源/样本/SoftKeyboard/index.html

I have 64-bit Windows 7 Professional, Android SDK and ADT Plugin for Eclipse. In the examples directory of Android SDK there are at least three different directories for SoftKeyboard. Which one should I use?

How to run that SoftKeyboard? I tried, but it didn't work at all.

You can find it from here, too: http://developer.android.com/resources/samples/SoftKeyboard/index.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

二智少女猫性小仙女 2024-12-10 17:05:16

这些可以作为现有项目导入到您的 Eclipse 工作区中。
您可以在 ANDROID_SDK\samples\android-XX\SoftKeyboard 文件夹中找到项目文件(其中 XX 是某个 api 级别)。

要将它们导入到 eclipse 中,请转到 File ->新->其他-> Android 项目。然后选择从现有源创建项目并选择上面的文件夹作为位置。如果未选择,请选择下面适当的 API 级别,然后按“完成”。就这样,你得到了一个闪亮的新 Android 项目,你可以像其他项目一样运行它。

请记住,所有 api 示例都预安装在每个模拟器中。所以如果你想在模拟器中测试这个,你必须先卸载预装的版本。从操作系统的命令行运行 adb uninstall com.example.android.softkeyboard 或通过 Preferences -> 卸载示例模拟器本身中的应用程序

该文件夹中的不同版本适用于不同的 API 级别(什么是 API 级别?)安卓的。这仅仅意味着它们是为支持该 api 级别及以上级别而编写的。根据版本之间的更改,文件之间可能根本没有区别。

These can be imported as an existing project into your eclipse workspace.
You can find the project files in the ANDROID_SDK\samples\android-XX\SoftKeyboard folder (where XX is a certain api level).

To import them inside eclipse, go to File -> New -> Other -> Android Project. Then select create project from existing source and select the folder above as the location. Pick the appropriate API level below if none is selected and press finish. And thats it, you got yourself a shiny new android project that you can run like every other one.

Keep in mind that all api samples come preinstalled in every emulator. So if you want to test this in a emulator, you have to uninstall the preinstalled version first. Either run adb uninstall com.example.android.softkeyboard from the command line of your OS or uninstall the examples via Preferences -> Applications in the emulator itself.

The different versions in the folder are for the different API levels (What is an API level?) of android. That just means they are written to support that api level and above. Depending on what has changed between the versions, there might be no difference at all between the files.

明媚如初 2024-12-10 17:05:16

同一项目有不同的示例,因为您为多个版本的 Android 安装了多个 SDK。每个 SDK 目录都包含示例。我想说的是,只需加载您想要定位的 Android 版本即可。

要从 Eclipse 中的现有示例加载项目:单击 File ->新->项目并选择Android Project ->单击“下一步”。选择“从现有源创建项目”,然后单击浏览查找包含要加载的示例的目录。最后只需单击“完成”即可。

这应该将示例加载到您的工作区中。

There are different examples of the same project because you have multiple SDK's installed for several versions of Android. Each SDK directory contains the example. I would say just load the one for whichever version of Android you want to target.

To load the project from an existing example in Eclipse: Click on File -> New -> Project and select Android Project -> Click Next. Select "Create project from existing source" and click Browse to find the directory containing the example you want to load. Finally just click Finish.

That should load the example into your workspace.

没︽人懂的悲伤 2024-12-10 17:05:16

以下教程将指导您完成运行示例应用程序的步骤:

运行 Android SDK 示例

您应该使用适合您的 Android 版本的版本。因为 SoftKeyBoard 不是一个活动(它是一个服务),所以您必须通过自己的应用程序调用该服务才能对其进行测试。

here is a tutorial which guides you through the steps of running the sample apps:

Running Android SDK samples

You should use the version which fits to your Android Version. Because the SoftKeyBoard isn't an anctivity (it is a service) you have to call the service by your own application in order to test it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文