AndroidStudio导入sdk中的Sample工程

6 篇文章 0 订阅

Android sdk中自带了Sample提供了各种示例,是初步了解学习各种动画或控件的神器。虚拟机中也集成有Sample的工程进行演示。
作为Google的亲儿子,AS提供了便捷的方法导入Android Sample。这些Sample工程都托管在github,用户可以再AS中自行选择模块查看。

下面以比较新潮的RecyclerView在Sample中的工程为例演示导入过程:

Sample工程导入步骤:

首先打开AS,如果在工程中则点击File -> Close Project进入到如下界面,
这里写图片描述
可以看到Import an android code sample,点击之后会下载android sample目录
PS:这里好像需要翻墙,请自备梯子
下面到了sample工程列表界面:
这里写图片描述
可以看到Sample中有有关图形、多媒体、布局等林林种种的选项,貌似还有电视、可穿戴神马的,牛哄哄的样子。
选中View->RecyclerView工程
- Description选项中可以直接进入github查看示例工程。
- Preview选项卡可以预览示例的效果。
这里写图片描述
点击next:
这里写图片描述
再点击Finish等待下载和构建工程之后大功告成。

Android Sample的github主页

https://github.com/googlesamples

List of Sample Apps The list below provides a summary of the sample applications that are available with the Android SDK. Using the links on this page, you can view the source files of the sample applications in your browser. You can also download the source of these samples into your SDK, then modify and reuse it as you need. For more information, see Getting the Samples. API Demos A variety of small applications that demonstrate an extensive collection of framework topics. Backup and Restore A simple example that illustrates a few different ways for an application to implement support for the Android data backup and restore mechanism. Bluetooth Chat An application for two-way text messaging over Bluetooth. BusinessCard An application that demonstrates how to launch the built-in contact picker from within an activity. This sample also uses reflection to ensure that the correct version of the contacts API is used, depending on which API level the application is running under. Contact Manager An application that demonstrates how to query the system contacts provider using the ContactsContract API, as well as insert contacts into a specific account. Home A home screen replacement application. JetBoy A game that demonstrates the SONiVOX JET interactive music technology, with JetPlayer. Live Wallpaper An application that demonstrates how to create a live wallpaper and bundle it in an application that users can install on their devices. Lunar Lander A classic Lunar Lander game. Multiple Resolutions A sample application that shows how to use resource directory qualifiers to provide different resources for different screen configurations. Note Pad An application for saving notes. Similar (but not identical) to the Notepad tutorial. SampleSyncAdapter Demonstrates how an application can communicate with a cloud-based service and synchronize its data with data stored locally in a content provider. The sample uses two related parts of the Android framework — the account manager and the synchronization manager (through a sync adapter). Searchable Dictionary A sample application that demonstrates Android's search framework, including how to provide search suggestions for Quick Search Box. Snake An implementation of the classic game "Snake." Soft Keyboard An example of writing an input method for a software keyboard. Spinner A simple application that serves as an application-under-test for the SpinnerTest sample application. SpinnerTest An example test application that contains test cases run against the Spinner sample application. To learn more about the application and how to run it, please read the Activity Testing tutorial. TicTacToeLib An example of an Android library project that provides a game-play Activity to any dependent application project. For an example of how an application can use the code and resources in an Android library project, see the TicTacToeMain sample application. TicTacToeMain An example of an Android application that makes use of code and resources provided in an Android library project. Specifically, this application uses code and resources provided in the TicTacToeLib library project. Wiktionary An example of creating interactive widgets for display on the Android home screen. Wiktionary (Simplified) A simple Android home screen widgets example.
### 回答1: 要在Android Studio导入SDK,请按照以下步骤操作: 1. 打开Android Studio并创建一个新项目。 2. 在“Welcome to Android Studio”窗口,选择“Configure”>“SDK Manager”。 3. 在“SDK Platforms”选项卡,选择您需要的Android版本。然后单击“Apply”以安装所选的SDK。 4. 在“SDK Tools”选项卡,选择您需要的工具。然后单击“Apply”以安装所选的工具。 5. 安装完成后,您可以在项目使用所需的SDK和工具。 希望这可以帮助您导入SDK。 ### 回答2: Android Studio是一款专门用于开发Android应用程序的IDE(Integrated Development Environment)。在使用Android Studio开发应用程序的时候,我们通常需要导入Android SDKAndroid SDK是包含了Android系统所需的开发工具、开发文档、库文件以及模拟器等,是Android应用程序开发的必备工具。 下面我们来了解一下如何在Android Studio导入SDK。 1、打开Android Studio,然后点击“File”菜单,选择“Settings”。 2、在Settings窗口,选择“Appearance & Behavior”下的“System Settings”,然后点击“Android SDK”。 3、在 Android SDK窗口,选择“SDK Platforms”选项卡,然后勾选需要的Android SDK版本,点击“Apply”按钮。 4、切换到“SDK Tools”选项卡,勾选需要的工具,点击“Apply”按钮。 5、等待SDK安装完成,就可以使用SDK进行开发了。 需要注意的是,在导入SDK的时候,应该选择当前使用的Android版本,以确保应用程序与设备兼容。 此外,还需要确保安装的工具包含了需要的开发工具以及系统镜像,以满足应用程序的开发需求。 总的来说,Android Studio导入SDK的过程并不复杂,只需要按照上述步骤操作即可。 ### 回答3: Android Studio是一款非常流行的集成开发环境,它可以用来开发 Android 应用程序。但是,为了正常开发Android应用程序,我们需要安装 Android SDK。 下面将为您介绍如何将 SDK 导入Android Studio 。 1.下载并安装SDK 首先,我们需要从官方网站 http://developer.android.com/sdk/index.html 下载最新版本的 Android SDK 。下载完成后,我们需要安装它。安装的时候,我们可以只安装需要的组件。为了避免不必要的错误,建议安装完整的 SDK。 2.打开Android Studio 打开Android Studio,在欢迎界面,点击“Configure”,然后选择“SDK Manager”。 3.导入SDKSDK Manager 窗口,选择“SDK Platforms”选项卡。这里将列出SDK支持的各种Android版本,我们可以选择需要的版本并点击“Apply”将其安装到本地。注意一定要选择与您正在开发的项目适配的Android版本。 接下来,我们选择“SDK Tools”选项卡并将其所有的工具都勾选上,在下方会显示出每个工具的版本号,带有"+"标志的表示该工具有新版本可以更新。 点击下方的“Apply”按钮,SDK就会开始下载和安装。等待一段时间之后,SDK将成功导入Android Studio 导入 SDK 后,我们就可以开始使用其的各种API 接口和开发工具来开发Android应用程序了。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值