NotesUESTC/Android开发笔记/Android引入其他工程.md

20 lines
771 B
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## Android引入其他工程
在安卓开发中,我们为了开发方便,所以需要引入其他的已经封装好的模块。如下所示:
<img src="C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20230211150717050.png" alt="image-20230211150717050" style="zoom: 50%;" />
在app工程中需要用到libsmb库提供的smb管理和访问的功能。需要在两个地方进行配置。首先是app工程目录下的settings.gradle中配置。
```shell
# settings.gradle的配置是编译器包含libsmb
rootProject.name = "My Application"
include ':app'
include ':libsmb'
# 在build.gradle中添加依赖选项
implementation fileTree(include: ['*.jar'], dir: 'libs')
...
implementation project(':libsmb')
```