Below you will find pages that utilize the taxonomy term “Android Studio”
July 9, 2017
Android Studio 3.0 Device File Explorer & Fonts
Device File Explorer 使用设备的文件系统,可按如下的操作方式:
点击View > Tool Windows > Device File Explorer或者点击右下角位于工具窗口条中的Device File Explorer按钮来打开Device File Explorer。
从上方的下拉列表中选择设备。
在文件浏览窗口中操作设备文件。鼠标右键点击文件或目录来创建一个新文件或目录,保存现在的文件或目录到电脑中,上传、删除或同步文件。鼠标双击文件可以在Android Studio中打开文件。
注意:Android Studio 将用 Device File Explorer 打开的文件保存在工程外的临时目录中,如果在 Device File Explorer 中修改文件,并想把修改保存到设备中,需要手动将修改的文件上传到设备中。
Figure1 Device File Explorer窗口
当浏览设备文件时,以下2个目录是经常访问的:
data/data/app_name/:包含存储于内部存储空间的应用数据文件
sdcard/:包含存储于外部存储空间的用户文件
注意:不是所有的文件都在Device File Explorer中可见。例如在**data/data/**目录中,非debuggable应用的文件是不能展开的。
XML Fonts & Downloadable Fonts Android O 引入了XML字体新特性,可以将字体作为资源使用。
XML Fonts Android O 可以通过将字体文件加入res/font目录来将字体作为资源使用。这些字体会被编译到R文件中,并在 Android Studio 中可用。可以通过新的资源类型font来访问字体资源,例如用@font/myfont或者R.font.myfont来访问一个字体资源。
在 Android Studio 中可以通过执行以下步骤来字体资源:
鼠标右键点击res目录,选择New > Android Resource Directory,打开New Resource Directory窗口。
在Resource type列表里选择font,然后点击OK。
Figure2 添加字体目录
Notes
Android studio tips
Share module between projects Add this to settings.gradle file at the project root:
include ':libraryName' project(':libraryName').projectDir=new File('/path/to/library') where the path you specify in the second line is the path to the directory containing the library’s build.gradle file. The path can be relative or absolute.
Avoid so file can not find problem If library’s jniLibs contians armeabi-v7a folder, but main module’s jniLibs contains not, the app will crash because of so file could not found.