VRecorder
|--cnpay //支付模块
| |--src
| |--libs
|
|--staticanalysislib//数据打点探针模块
| |--src
| |--libs
|
|---themelibrary//主题配色、字符串资源模块
| |-src
| |-libs
|
|--App//主项目模块
|-src
|-libs
请求服务器接口下订单—>调用本地SDK支付—>SDK返回支付结果—>服务器验证查询订单支付结果
请求服务器接口下订单—>调用本地SDK支付—>SDK返回支付结果—>服务器验证查询订单支付结果
请求服务器接口获得授权信息—>调用支付宝SDK对授权信息进行授权—>获得openID再请求服务器接口获取所有订单购买情况
微信SDK发起授权获取code—>通过请求微信官网的链接接口进行验证授权返回openID—>请求服务接口获取所有订单购买情况
SecurityException。 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
打开前台服务,需要有通知栏体现:
Intent intent = new Intent(this, ForegroundService.class);
ContextCompat.startForegroundService(this, intent);
要请求让服务运行于前台,在ForegroundService.class里需要调用如下方法启动通知栏:
startForeground(NOTIFICATION_ID, notification);
对非Android SDK API的调用做了限制,通常会出现类似NoSuchClassException或NoSuchFieldException异常。
非SDK API包括Android未公开的底层内部实现细节的API反射调用。还有NDK里未公开的方法调用等。
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
Editmenu 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
}
}