Android 4.4(API 级别 19)引入了存储访问框架 (SAF)。SAF 让用户能够在其所有首选文档存储提供程序中方便地浏览并打开文档、图像以及其他文件。 用户可以通过易用的标准 UI,以统一方式在所有应用和提供程序中浏览文件和访问最近使用的文件。
自API 19引入SAF后,应用程序无法直接通过java 的File API进行写操作了。需要用到Android 的DocumentFile
API 进行间接处理文件。
DocumentFile.fromTreeUri(context,uri)
Jcenter and MavenCenter are moden time standar maven center. they maintained by Bintray
and sonatype
respectively.
As the artical , we just talk abut Bintray’s JCenter. Cause Android Studio now support Jcenter as default maven center.
First of all , you need create an accunt of Binray at Bintray.com and generate an API Key at
Edit
menu of account profile
buildscript{
dependencies{
//bintray: jcenter publish build plugin
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'// maven publish method to create groups of artifacts
The bintray plugin supports three methods to create groups of artifacts: Configurations, Publications and Copying specific files using filesSpec. For more read, reference gradle-bintray-plugin.
sources.Jar
and javadoc.Jar
artifactscreate task as below for android gradle:
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
在firebse 上注册登陆账号,之后注册应用,填写包名等信息,下载配置文件。
google-services.json
适用于 Gradle 的说明 | UnityC++Gradle 的 Google 服务插件会加载您刚刚下载的 google-services.json 文件。请修改您的 build.gradle 文件以使用该插件。 |
项目级 build.gradle(<项目>/build.gradle
):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.0.0' }
}
应用级 build.gradle(<项目>/<应用模块>/build.gradle
):
dependencies {
// Add this line
compile 'com.google.firebase:firebase-core:16.0.0'
}
...
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
默认情况下包含 Analytics
最后,按 IDE 中显示的栏中的“立即同步”:
Android APP 构建脚本采用的是Gradle框架。Gradle是一种构建builde编译框架,采用的是groovy语言。谷歌官方有使用自己的一套builde 插件依赖 配置在project.gradle文件里:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
As following:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/jaysen/gems/gems/nokogiri-1.8.4/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20180727-12716-1rv24w0.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.5
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/jaysen/gems/extensions/x86_64-linux/2.5.0/nokogiri-1.8.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/jaysen/gems/gems/nokogiri-1.8.4 for
inspection.
Results logged to
/home/jaysen/gems/extensions/x86_64-linux/2.5.0/nokogiri-1.8.4/gem_make.out
An error occurred while installing nokogiri (1.8.4), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.4' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
github-pages was resolved to 188, which depends on
jekyll-mentions was resolved to 1.4.0, which depends on
html-pipeline was resolved to 2.8.3, which depends on
nokogiri
可以从网上搜索域名注册
关键词,进入域名注册提供商网站去注册自己想要的域名,看自己的情况选择购买合适价格的域名进行注册。
本人是在阿里云注册的域名,现在注册需要实名认证之后才能成功解析域名。否则在网站上输入自己的域名无法访问到ip
地址,即打不开网站。
本人注册的域名解析的是解析至GitHub主机上。
GitHub pages
是一个静态网页托管平台,你可以把你制作的HTML静态网页通过git
工具上传至GitHub
代码仓库。
GitHub
上的某个项目上设置你的自定义域名jaylin.top
),之后点击 Save.按钮保存。 To check if your custom domain is supported, see “About supported custom domains.”HTTPS
协议. For more information, see “Securing your GitHub Pages site with HTTPS.”