Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zw_game_sdk
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
CI / CD
CI / CD
流水线
日程表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
提交
问题看板
Open sidebar
zwwl
zw_game_sdk
Commits
1286dbad
提交
1286dbad
authored
4月 30, 2026
作者:
钱宇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify:聚合SDK文档修改。
上级
0aaa5fe4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
73 行增加
和
67 行删除
+73
-67
build.gradle.kts
聚合SDK/aggregation-android-sdk-demo/app/build.gradle.kts
+3
-2
MainActivity.kt
.../main/java/com/zwgame/test/gamecenterdemo/MainActivity.kt
+5
-4
MainJavaActivity.java
...java/com/zwgame/test/gamecenterdemo/MainJavaActivity.java
+5
-4
接入文档.md
聚合SDK/接入文档.md
+60
-57
没有找到文件。
聚合SDK/aggregation-android-sdk-demo/app/build.gradle.kts
浏览文件 @
1286dbad
plugi
ns {
plugi
ns {
...
@@ -79,5 +79,5 @@ dependencies {
...
@@ -79,5 +79,5 @@ dependencies {
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.espresso.core)
implementation("com.zw.game.center:gameCenter:1.0.0.
4
")
implementation("com.zw.game.center:gameCenter:1.0.0.
3
")
}
}
\ No newline at end of file
聚合SDK/aggregation-android-sdk-demo/app/src/main/java/com/zwgame/test/gamecenterdemo/MainActivity.kt
浏览文件 @
1286dbad
packa
ge
com.zwgame.test.gamecenterdemo
packa
ge
com.zwgame.test.gamecenterdemo
...
@@ -59,7 +59,8 @@ class MainActivity : AppCompatActivity() {
...
@@ -59,7 +59,8 @@ class MainActivity : AppCompatActivity() {
val
obj
=
JSONObject
(
result
)
val
obj
=
JSONObject
(
result
)
val
success
=
obj
.
optBoolean
(
"success"
)
val
success
=
obj
.
optBoolean
(
"success"
)
if
(
success
)
{
if
(
success
)
{
Log
.
i
(
TAG
,
"init 成功"
)
val
channelCode
=
obj
.
optString
(
"channelCode"
)
Log
.
i
(
TAG
,
"init 成功,当前渠道:$channelCode"
)
}
else
{
}
else
{
Log
.
w
(
TAG
,
"init 失败 errorMsg=${obj.optString("
errorMsg
")} errorCode=${obj.optInt("
errorCode
")}"
)
Log
.
w
(
TAG
,
"init 失败 errorMsg=${obj.optString("
errorMsg
")} errorCode=${obj.optInt("
errorCode
")}"
)
}
}
...
@@ -173,12 +174,12 @@ class MainActivity : AppCompatActivity() {
...
@@ -173,12 +174,12 @@ class MainActivity : AppCompatActivity() {
private
fun
onShowFloatClick
()
{
private
fun
onShowFloatClick
()
{
statusText
.
setText
(
R
.
string
.
status_show_float_clicked
)
statusText
.
setText
(
R
.
string
.
status_show_float_clicked
)
ZySdk
.
s
dkShow
Float
(
this
)
{
}
ZySdk
.
s
howHuawei
Float
(
this
)
{
}
}
}
private
fun
onHideFloatClick
()
{
private
fun
onHideFloatClick
()
{
statusText
.
setText
(
R
.
string
.
status_hide_float_clicked
)
statusText
.
setText
(
R
.
string
.
status_hide_float_clicked
)
ZySdk
.
sdkHide
Float
(
this
)
{
}
ZySdk
.
hideHuawei
Float
(
this
)
{
}
}
}
private
fun
onExitClick
()
=
guardBusy
{
private
fun
onExitClick
()
=
guardBusy
{
...
...
聚合SDK/aggregation-android-sdk-demo/app/src/main/java/com/zwgame/test/gamecenterdemo/MainJavaActivity.java
浏览文件 @
1286dbad
packa
ge
com
.
zwgame
.
test
.
gamecenterdemo
;
packa
ge
com
.
zwgame
.
test
.
gamecenterdemo
;
...
@@ -68,7 +68,8 @@ public class MainJavaActivity extends AppCompatActivity {
...
@@ -68,7 +68,8 @@ public class MainJavaActivity extends AppCompatActivity {
JSONObject
obj
=
new
JSONObject
(
result
);
JSONObject
obj
=
new
JSONObject
(
result
);
boolean
success
=
obj
.
optBoolean
(
"success"
);
boolean
success
=
obj
.
optBoolean
(
"success"
);
if
(
success
)
{
if
(
success
)
{
Log
.
i
(
TAG
,
"init 成功"
);
String
channelCode
=
obj
.
optString
(
"channelCode"
);
Log
.
i
(
TAG
,
"init 成功,当前渠道:"
+
channelCode
);
}
else
{
}
else
{
Log
.
w
(
TAG
,
"init 失败 errorMsg="
+
obj
.
optString
(
"errorMsg"
)
+
" errorCode="
+
obj
.
optInt
(
"errorCode"
));
Log
.
w
(
TAG
,
"init 失败 errorMsg="
+
obj
.
optString
(
"errorMsg"
)
+
" errorCode="
+
obj
.
optInt
(
"errorCode"
));
}
}
...
@@ -217,12 +218,12 @@ public class MainJavaActivity extends AppCompatActivity {
...
@@ -217,12 +218,12 @@ public class MainJavaActivity extends AppCompatActivity {
private
void
onShowFloatClick
()
{
private
void
onShowFloatClick
()
{
statusText
.
setText
(
R
.
string
.
status_show_float_clicked
);
statusText
.
setText
(
R
.
string
.
status_show_float_clicked
);
ZySdk
.
INSTANCE
.
s
dkShow
Float
(
this
,
(
Function1
<
String
,
Unit
>)
result
->
Unit
.
INSTANCE
);
ZySdk
.
INSTANCE
.
s
howHuawei
Float
(
this
,
(
Function1
<
String
,
Unit
>)
result
->
Unit
.
INSTANCE
);
}
}
private
void
onHideFloatClick
()
{
private
void
onHideFloatClick
()
{
statusText
.
setText
(
R
.
string
.
status_hide_float_clicked
);
statusText
.
setText
(
R
.
string
.
status_hide_float_clicked
);
ZySdk
.
INSTANCE
.
sdkHide
Float
(
this
,
(
Function1
<
String
,
Unit
>)
result
->
Unit
.
INSTANCE
);
ZySdk
.
INSTANCE
.
hideHuawei
Float
(
this
,
(
Function1
<
String
,
Unit
>)
result
->
Unit
.
INSTANCE
);
}
}
private
void
onExitClick
()
{
private
void
onExitClick
()
{
...
...
聚合SDK/接入文档.md
浏览文件 @
1286dbad
# Gam
e Center SDK 接入说明V1.0.0.0
# Gam
e Center SDK 接入说明V1.0.0.0
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<a
name=
"overview-features"
></a>
<a
name=
"overview-features"
></a>
### 1. 主要功能
### 1. 主要功能
*
SDK初始化
*
SDK初始化
*
SDK登录
*
SDK登录
*
SDK角色信息上报
*
SDK角色信息上报
...
@@ -37,14 +37,14 @@
...
@@ -37,14 +37,14 @@
*
SDK退出引导
*
SDK退出引导
---
---
<a
name=
"overview-changelog"
></a>
<a
name=
"overview-changelog"
></a>
### 2. 更新内容
### 2. 更新内容
*
无
*
无
---
---
<a
name=
"overview-prereq"
></a>
<a
name=
"overview-prereq"
></a>
### 3. 接入准备
### 3. 接入准备
...
@@ -72,38 +72,38 @@
...
@@ -72,38 +72,38 @@
```
kotlin
```
kotlin
dependencyResolutionManagement
{
dependencyResolutionManagement
{
repositories
{
repositories
{
// sdk仓库
// sdk仓库
maven
{
maven
{
url
=
uri
(
"http://nexus.zwwlkj01.top/repository/android-advertisement"
)
url
=
uri
(
"http://nexus.zwwlkj01.top/repository/android-advertisement"
)
isAllowInsecureProtocol
=
true
isAllowInsecureProtocol
=
true
credentials
{
credentials
{
username
=
""
username
=
""
password
=
""
password
=
""
}
}
}
}
// 巨量媒体
// 巨量媒体
maven
{
maven
{
url
=
uri
(
"https://artifact.bytedance.com/repository/Volcengine/"
)
url
=
uri
(
"https://artifact.bytedance.com/repository/Volcengine/"
)
}
// 建议保留
google
()
mavenCentral
()
// 打华为包时保留
maven
{
url
=
uri
(
"https://developer.huawei.com/repo/"
)
}
}
}
// 建议保留
google
()
mavenCentral
()
// 打华为包时保留
maven
{
url
=
uri
(
"https://developer.huawei.com/repo/"
)
}
}
}
}
```
```
>同时建议保留 **Google / Maven Central** 等,以便传递依赖解析。
>同时建议保留 **Google / Maven Central** 等,以便传递依赖解析。
>
>
>若打 **华为** 包,则需加入华为maven库,以便下载华为插件。
>若打 **华为** 包,则需加入华为maven库,以便下载华为插件。
---
---
...
@@ -126,17 +126,17 @@ implementation("com.zw.game.center:gameCenter:1.0.0.0")
...
@@ -126,17 +126,17 @@ implementation("com.zw.game.center:gameCenter:1.0.0.0")
工程级
**`build.gradle.kts`**
中,加入
工程级
**`build.gradle.kts`**
中,加入
```
kotlin
```
kotlin
buildscript
{
buildscript
{
dependencies
{
dependencies
{
classpath
(
"com.android.tools.build:gradle:8.13.2"
)
classpath
(
"com.android.tools.build:gradle:8.13.2"
)
classpath
(
"com.huawei.agconnect:agcp:1.9.5.302"
)
classpath
(
"com.huawei.agconnect:agcp:1.9.5.302"
)
}
}
}
}
```
```
app模块下添加agc插件
app模块下添加agc插件
```
kotlin
```
kotlin
plugins
{
plugins
{
id
(
"com.huawei.agconnect"
)
id
(
"com.huawei.agconnect"
)
}
}
```
```
...
@@ -159,12 +159,12 @@ override fun getResources() = ZySdk.getResources(super.getResources())
...
@@ -159,12 +159,12 @@ override fun getResources() = ZySdk.getResources(super.getResources())
```
java
```
java
@Override
@Override
public
AssetManager
getAssets
()
{
public
AssetManager
getAssets
()
{
ZySdk
.
INSTANCE
.
getAssets
(
super
.
getAssets
());
ZySdk
.
INSTANCE
.
getAssets
(
super
.
getAssets
());
}
}
@Override
@Override
public
Resources
getResources
()
{
public
Resources
getResources
()
{
ZySdk
.
INSTANCE
.
getResources
(
super
.
getResources
());
ZySdk
.
INSTANCE
.
getResources
(
super
.
getResources
());
}
}
```
```
...
@@ -181,16 +181,17 @@ public Resources getResources() {
...
@@ -181,16 +181,17 @@ public Resources getResources() {
```
kotlin
```
kotlin
ZySdk
.
sdkInit
(
activity
)
{
result
->
ZySdk
.
sdkInit
(
activity
)
{
result
->
// 初始化结果:成功/失败信息与错误码等
// 初始化结果:成功/失败信息与错误码等
val
obj
=
JSONObject
(
result
)
val
obj
=
JSONObject
(
result
)
val
success
=
obj
.
optBoolean
(
"success"
)
val
success
=
obj
.
optBoolean
(
"success"
)
if
(
success
)
{
if
(
success
)
{
Log
.
i
(
TAG
,
"init 成功"
)
val
channelCode
=
obj
.
optString
(
"channelCode"
)
}
else
{
Log
.
i
(
TAG
,
"init 成功,当前渠道:$channelCode"
)
val
errorMsg
=
obj
.
optString
(
"errorMsg"
)
}
else
{
val
errorCode
=
obj
.
optInt
(
"errorCode"
)
val
errorMsg
=
obj
.
optString
(
"errorMsg"
)
Log
.
w
(
TAG
,
"init 失败 errorMsg=${errorMsg} errorCode=${errorCode}"
)
val
errorCode
=
obj
.
optInt
(
"errorCode"
)
}
Log
.
w
(
TAG
,
"init 失败 errorMsg=${errorMsg} errorCode=${errorCode}"
)
}
}
}
```
```
...
@@ -203,11 +204,13 @@ ZySdk.sdkInit(activity) { result ->
...
@@ -203,11 +204,13 @@ ZySdk.sdkInit(activity) { result ->
**回参**
**回参**
| 字段 | 类型 | 含义 |
| 字段 | 类型 | 含义 |
|:-----------:|:-------:|:--------:|
|:-------------:|:-------:|:------------------------------------:|
|
`success`
| Boolean | 是否成功 |
|
`success`
| Boolean | 是否成功 |
|
`errorMsg`
| String | 失败时的提示文案 |
|
`errorMsg`
| String | 失败时的提示文案 |
|
`errorCode`
| Int | 错误码 |
|
`errorCode`
| Int | 错误码 |
|
`msg`
| String | 提示文案 |
|
`channelCode`
| String | 渠道编码(oppo、vivo、xiaomi、huawei、honor等) |
**华为渠道错误码如下:**
**华为渠道错误码如下:**
...
@@ -538,13 +541,13 @@ ZySdk.sdkUpdate(this) { result ->
...
@@ -538,13 +541,13 @@ ZySdk.sdkUpdate(this) { result ->
显示浮窗
显示浮窗
```
kotlin
```
kotlin
ZySdk
.
s
dkShow
Float
(
this
)
{
result
->
ZySdk
.
s
howHuawei
Float
(
this
)
{
result
->
}
}
```
```
隐藏浮窗
隐藏浮窗
```
kotlin
```
kotlin
ZySdk
.
sdkHide
Float
(
this
)
{
result
->
ZySdk
.
hideHuawei
Float
(
this
)
{
result
->
}
}
```
```
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论