<!doctype html>
|
<html>
|
<head>
|
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
|
<title>Android-SDK集成手册.md</title><style type='text/css'>html {overflow-x: initial !important;}.CodeMirror { height: auto; }
|
.CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; }
|
.CodeMirror-lines { padding: 4px 0px; }
|
.CodeMirror pre { }
|
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { background-color: white; }
|
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background-color: rgb(247, 247, 247); white-space: nowrap; }
|
.CodeMirror-linenumbers { }
|
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
|
.CodeMirror div.CodeMirror-cursor { border-left: 1px solid black; z-index: 3; }
|
.CodeMirror div.CodeMirror-secondarycursor { border-left: 1px solid silver; }
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { width: auto; border: 0px; background: rgb(119, 238, 119); z-index: 1; }
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite { }
|
.cm-tab { display: inline-block; }
|
.cm-s-typora-default .cm-header, .cm-s-typora-default .cm-property { color: rgb(217, 79, 138); }
|
.cm-s-typora-default pre.cm-header1:not(.cm-atom) :not(.cm-overlay) { font-size: 2rem; line-height: 2rem; }
|
.cm-s-typora-default pre.cm-header2:not(.cm-atom) :not(.cm-overlay) { font-size: 1.4rem; line-height: 1.4rem; }
|
.cm-s-typora-default .cm-atom, .cm-s-typora-default .cm-number { color: rgb(149, 132, 134); }
|
.cm-s-typora-default .cm-table-row, .cm-s-typora-default .cm-block-start { font-family: monospace; }
|
.cm-s-typora-default .cm-comment, .cm-s-typora-default .cm-code { color: rgb(74, 90, 159); font-family: monospace; }
|
.cm-s-typora-default .cm-tag { color: rgb(169, 68, 66); }
|
.cm-s-typora-default .cm-string { color: rgb(126, 134, 169); }
|
.cm-s-typora-default .cm-link { color: rgb(196, 122, 15); text-decoration: underline; }
|
.cm-s-typora-default .cm-variable-2, .cm-s-typora-default .cm-variable-1 { color: inherit; }
|
.cm-s-typora-default .cm-overlay { font-family: monospace; }
|
.CodeMirror.cm-s-typora-default div.CodeMirror-cursor { border-left: 3px solid rgb(228, 98, 154); }
|
.cm-s-typora-default .CodeMirror-activeline-background { left: -60px; right: -30px; background: rgba(204, 204, 204, 0.2); }
|
.cm-s-typora-default .CodeMirror-gutters { border-right: none; background-color: inherit; }
|
.cm-s-typora-default .cm-trailing-space-new-line::after, .cm-startspace::after, .cm-starttab .cm-tab::after { content: "•"; position: absolute; left: 0px; opacity: 0; font-family: LetterGothicStd, monospace; }
|
.os-windows .cm-startspace::after, .os-windows .cm-starttab .cm-tab::after { left: -0.1em; }
|
.cm-starttab .cm-tab::after { content: " "; }
|
.cm-startspace, .cm-tab, .cm-starttab, .cm-trailing-space-a, .cm-trailing-space-b, .cm-trailing-space-new-line { font-family: monospace; position: relative; }
|
.cm-s-typora-default .cm-trailing-space-new-line::after { content: "↓"; opacity: 0.3; }
|
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
|
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
|
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
|
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
|
.cm-s-inner .cm-variable { color: black; }
|
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
|
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
|
.cm-s-inner .cm-property { color: black; }
|
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
|
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
|
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
|
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
|
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
|
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
|
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
|
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
|
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
|
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
|
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: blue; }
|
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
|
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
|
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
|
.cm-negative { color: rgb(221, 68, 68); }
|
.cm-positive { color: rgb(34, 153, 34); }
|
.cm-header, .cm-strong { font-weight: bold; }
|
.cm-del { text-decoration: line-through; }
|
.cm-em { font-style: italic; }
|
.cm-link { text-decoration: underline; }
|
.cm-error { color: rgb(255, 0, 0); }
|
.cm-invalidchar { color: rgb(255, 0, 0); }
|
.cm-constant { color: rgb(38, 139, 210); }
|
.cm-defined { color: rgb(181, 137, 0); }
|
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
|
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
|
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
|
.CodeMirror { position: relative; overflow: hidden; }
|
.CodeMirror-scroll { margin-bottom: -30px; margin-right: -30px; padding-bottom: 30px; padding-right: 30px; height: 100%; outline: none; position: relative; box-sizing: content-box; }
|
.CodeMirror-sizer { position: relative; }
|
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { position: absolute; z-index: 6; display: none; }
|
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow-x: hidden; overflow-y: scroll; }
|
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow-y: hidden; overflow-x: scroll; }
|
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
|
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
|
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
|
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
|
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: none !important; border: none !important; }
|
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
|
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
|
.CodeMirror-lines { cursor: text; }
|
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: transparent; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; word-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
|
.CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
|
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
|
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
|
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
|
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
|
.CodeMirror-widget { }
|
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
|
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
|
.CodeMirror-measure pre { position: static; }
|
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
|
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
|
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
|
.CodeMirror-selected { background: rgb(217, 217, 217); }
|
.CodeMirror-focused .CodeMirror-selected { background: rgb(215, 212, 240); }
|
.cm-searching { background: rgba(255, 255, 0, 0.4); }
|
.CodeMirror span { }
|
@media print {
|
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
|
}
|
.CodeMirror-lint-markers { width: 16px; }
|
.CodeMirror-lint-tooltip { background-color: infobackground; border: 1px solid black; border-radius: 4px; color: infotext; font-family: monospace; overflow: hidden; padding: 2px 5px; position: fixed; white-space: pre-wrap; z-index: 10000; max-width: 600px; opacity: 0; transition: opacity 0.4s; font-size: 0.8em; }
|
.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { background-position: left bottom; background-repeat: repeat-x; }
|
.CodeMirror-lint-mark-error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg=="); }
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { background-position: center center; background-repeat: no-repeat; cursor: pointer; display: inline-block; height: 16px; width: 16px; vertical-align: middle; position: relative; }
|
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { padding-left: 18px; background-position: left top; background-repeat: no-repeat; }
|
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); }
|
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); }
|
.CodeMirror-lint-marker-multiple { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); background-repeat: no-repeat; background-position: right bottom; width: 100%; height: 100%; }
|
|
|
:root { --bg-color: #ffffff; --text-color: #333333; --code-block-bg-color: inherit; }
|
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
|
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
|
a:active, a:hover { outline: 0px; }
|
.in-text-selection, ::selection { background: rgb(181, 214, 252); text-shadow: none; }
|
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; padding-bottom: 70px; white-space: pre-wrap; overflow-x: visible; }
|
.for-image #write { padding-left: 8px; padding-right: 8px; }
|
body.typora-export { padding-left: 30px; padding-right: 30px; }
|
@media screen and (max-width: 500px) {
|
body.typora-export { padding-left: 0px; padding-right: 0px; }
|
.CodeMirror-sizer { margin-left: 0px !important; }
|
.CodeMirror-gutters { display: none !important; }
|
}
|
.typora-export #write { margin: 0px auto; }
|
#write > p:first-child, #write > ul:first-child, #write > ol:first-child, #write > pre:first-child, #write > blockquote:first-child, #write > div:first-child, #write > table:first-child { margin-top: 30px; }
|
#write li > table:first-child { margin-top: -20px; }
|
img { max-width: 100%; vertical-align: middle; }
|
input, button, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
|
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
|
::before, ::after, * { box-sizing: border-box; }
|
#write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write div, #write pre { width: inherit; }
|
#write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6 { position: relative; }
|
h1 { font-size: 2rem; }
|
h2 { font-size: 1.8rem; }
|
h3 { font-size: 1.6rem; }
|
h4 { font-size: 1.4rem; }
|
h5 { font-size: 1.2rem; }
|
h6 { font-size: 1rem; }
|
p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; }
|
.typora-export p { white-space: normal; }
|
.mathjax-block { margin-top: 0px; margin-bottom: 0px; -webkit-margin-before: 0rem; -webkit-margin-after: 0rem; }
|
.hidden { display: none; }
|
.md-blockmeta { color: rgb(204, 204, 204); font-weight: bold; font-style: italic; }
|
a { cursor: pointer; }
|
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; }
|
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; margin: 4px 0px 0px; }
|
tr { break-inside: avoid; break-after: auto; }
|
thead { display: table-header-group; }
|
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
|
table.md-table td { min-width: 80px; }
|
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
|
.CodeMirror { text-align: left; }
|
.CodeMirror-placeholder { opacity: 0.3; }
|
.CodeMirror pre { padding: 0px 4px; }
|
.CodeMirror-lines { padding: 0px; }
|
div.hr:focus { cursor: none; }
|
pre { white-space: pre-wrap; }
|
.CodeMirror-gutters { margin-right: 4px; }
|
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: var(--code-block-bg-color); position: relative !important; }
|
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
|
.md-fences .CodeMirror.CodeMirror-wrap { top: -1.6em; margin-bottom: -1.6em; }
|
.md-fences.mock-cm { white-space: pre-wrap; }
|
.show-fences-line-number .md-fences { padding-left: 0px; }
|
.show-fences-line-number .md-fences.mock-cm { padding-left: 40px; }
|
.footnotes { opacity: 0.8; font-size: 0.9rem; padding-top: 1em; padding-bottom: 1em; }
|
.footnotes + .footnotes { margin-top: -1em; }
|
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: transparent; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: normal; text-align: left; box-sizing: content-box; direction: ltr; }
|
li div { padding-top: 0px; }
|
blockquote { margin: 1rem 0px; }
|
li p, li .mathjax-block { margin: 0.5rem 0px; }
|
li { margin: 0px; position: relative; }
|
blockquote > :last-child { margin-bottom: 0px; }
|
blockquote > :first-child { margin-top: 0px; }
|
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; }
|
@media print {
|
html, body { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
|
.typora-export * { -webkit-print-color-adjust: exact; }
|
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; orphans: 2; }
|
p { orphans: 4; }
|
html.blink-to-pdf { font-size: 13px; }
|
.typora-export #write { padding-left: 1cm; padding-right: 1cm; padding-bottom: 0px; break-after: avoid; }
|
.typora-export #write::after { height: 0px; }
|
@page { margin: 20mm 0mm; }
|
}
|
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
|
a img, img a { cursor: pointer; }
|
pre.md-meta-block { font-size: 0.8rem; min-height: 2.86rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
|
p .md-image:only-child { display: inline-block; width: 100%; text-align: center; }
|
#write .MathJax_Display { margin: 0.8em 0px 0px; }
|
.mathjax-block { white-space: pre; overflow: hidden; width: 100%; }
|
p + .mathjax-block { margin-top: -1.143rem; }
|
.mathjax-block:not(:empty)::after { display: none; }
|
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: none; box-shadow: none; }
|
.task-list { list-style-type: none; }
|
.task-list-item { position: relative; padding-left: 1em; }
|
.task-list-item input { position: absolute; top: 0px; left: 0px; }
|
.math { font-size: 1rem; }
|
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
|
.md-toc-content { position: relative; margin-left: 0px; }
|
.md-toc::after, .md-toc-content::after { display: none; }
|
.md-toc-item { display: block; color: rgb(65, 131, 196); text-decoration: none; }
|
.md-toc-inner:hover { }
|
.md-toc-inner { display: inline-block; cursor: pointer; }
|
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: bold; }
|
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
|
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
|
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
|
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
|
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
|
@media screen and (max-width: 48em) {
|
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
|
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
|
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
|
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
|
}
|
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
|
.footnote-line a:not(.reversefootnote) { color: inherit; }
|
.md-attr { display: none; }
|
.md-fn-count::after { content: "."; }
|
.md-tag { opacity: 0.5; }
|
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: monospace; }
|
code { text-align: left; }
|
h1 .md-tag, h2 .md-tag, h3 .md-tag, h4 .md-tag, h5 .md-tag, h6 .md-tag { font-weight: initial; opacity: 0.35; }
|
a.md-print-anchor { border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: none !important; background: transparent !important; text-decoration: initial !important; text-shadow: initial !important; }
|
.md-inline-math .MathJax_SVG .noError { display: none !important; }
|
.mathjax-block .MathJax_SVG_Display { text-align: center; margin: 1em 0em; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; display: block !important; }
|
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
|
.MathJax_SVG .MJX-monospace { font-family: monospace; }
|
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
|
.MathJax_SVG { display: inline; font-style: normal; font-weight: normal; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
|
.MathJax_SVG * { transition: none; }
|
.md-diagram-panel > svg { max-width: 100%; }
|
[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; }
|
|
|
:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
|
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: normal; src: local("Open Sans Regular"), url("./github/400.woff") format("woff"); }
|
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: normal; src: local("Open Sans Italic"), url("./github/400i.woff") format("woff"); }
|
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: bold; src: local("Open Sans Bold"), url("./github/700.woff") format("woff"); }
|
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: bold; src: local("Open Sans Bold Italic"), url("./github/700i.woff") format("woff"); }
|
html { font-size: 16px; }
|
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
|
#write { max-width: 860px; margin: 0px auto; padding: 20px 30px 100px; }
|
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
|
body > :first-child { margin-top: 0px !important; }
|
body > :last-child { margin-bottom: 0px !important; }
|
a { color: rgb(65, 131, 196); }
|
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
|
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
|
h1 tt, h1 code { font-size: inherit; }
|
h2 tt, h2 code { font-size: inherit; }
|
h3 tt, h3 code { font-size: inherit; }
|
h4 tt, h4 code { font-size: inherit; }
|
h5 tt, h5 code { font-size: inherit; }
|
h6 tt, h6 code { font-size: inherit; }
|
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
|
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
|
h3 { font-size: 1.5em; line-height: 1.43; }
|
h4 { font-size: 1.25em; }
|
h5 { font-size: 1em; }
|
h6 { font-size: 1em; color: rgb(119, 119, 119); }
|
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
|
li > ol, li > ul { margin: 0px; }
|
hr { height: 4px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border-width: 0px 0px 1px; border-style: none none solid; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; overflow: hidden; box-sizing: content-box; border-bottom-color: rgb(221, 221, 221); }
|
body > h2:first-child { margin-top: 0px; padding-top: 0px; }
|
body > h1:first-child { margin-top: 0px; padding-top: 0px; }
|
body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
|
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
|
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
|
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
|
li p.first { display: inline-block; }
|
ul, ol { padding-left: 30px; }
|
ul:first-child, ol:first-child { margin-top: 0px; }
|
ul:last-child, ol:last-child { margin-bottom: 0px; }
|
blockquote { border-left: 4px solid rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); }
|
blockquote blockquote { padding-right: 0px; }
|
table { padding: 0px; word-break: initial; }
|
table tr { border-top: 1px solid rgb(204, 204, 204); margin: 0px; padding: 0px; }
|
table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
|
table tr th { font-weight: bold; border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
|
table tr td { border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
|
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
|
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
|
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); }
|
.md-fences, code, tt { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; }
|
.md-fences { margin-bottom: 15px; margin-top: 15px; padding: 8px 1em 6px; }
|
.task-list { padding-left: 0px; }
|
.task-list-item { padding-left: 32px; }
|
.task-list-item input { top: 3px; left: 8px; }
|
@media screen and (min-width: 914px) {
|
}
|
@media print {
|
html { font-size: 13px; }
|
table, pre { break-inside: avoid; }
|
pre { word-wrap: break-word; }
|
}
|
.md-fences { background-color: rgb(248, 248, 248); }
|
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
|
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
|
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
|
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
|
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
|
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
|
.md-image > .md-meta { border: 1px solid rgb(221, 221, 221); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; color: inherit; }
|
.md-tag { color: inherit; }
|
.md-toc { margin-top: 20px; padding-bottom: 20px; }
|
.sidebar-tabs { border-bottom: none; }
|
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
|
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
|
#md-notification::before { top: 10px; }
|
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
|
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
|
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
|
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
|
|
|
|
|
|
|
</style>
|
</head>
|
<body class='typora-export' >
|
<div id='write' class = 'is-node'><h1><a name='header-n1024' class='md-header-anchor '></a>Android SDK集成手册</h1><h2><a name='header-n1027' class='md-header-anchor '></a>一、文档说明</h2><h3><a name='header-n1028' class='md-header-anchor '></a>1.1 功能描述</h3><p>另类SDK主要用来向游戏客户端提供统一的调用接口。本
|
文主要描述SDK接入及使用方法。</p><h3><a name='header-n1032' class='md-header-anchor '></a>1.2 阅读对象</h3><p>本文档读者需要已经熟悉 IDE (Eclipse 或者 Android Studio) 的基本
|
使用方法,以及具有一定的 Android 编程基础。</p><h3><a name='header-n1036' class='md-header-anchor '></a>1.3 更新日志</h3><table><thead><tr><th>版本</th><th>时间</th><th>描述</th></tr></thead><tbody><tr><td>V1.0.0</td><td>2017-07-14</td><td>初始版本</td></tr><tr><td>V1.5.0</td><td>2017-08.01</td><td>接入支付通道,新增接口</td></tr><tr><td>V1.6.0</td><td>2017-08.16</td><td>修改UI界面</td></tr><tr><td>V1.6.1</td><td>2017-08.23</td><td>加入登录失败提示</td></tr><tr><td>V1.7.0</td><td>2017-09-27</td><td>1、登录接口去除参数ILoginCallback,2、支付接口去除参数IPayCallback,3、切换账号去除参数ISwitchAccountCallback,4、去除的接口回调统一使用全局的回调ILLSDKCallback,在初始化后请设置全局回调监听 LLSDK.getInstance().setLLSDKCallback(ILLSDKCallback),5、新增生命周期onDestory()接口和onExit()退出接口</td></tr><tr><td>V1.7.1</td><td>2017-10-23</td><td>修复若干bug;更新提示:替换jar包、替换所有资源文件,没有api接口变动</td></tr><tr><td>V2.0.0</td><td>2017-12-01</td><td>1、去除com.linglei.sdklib.auth.pay.PayActivity类,新增com.linglei.sdklib.auth.CommonActivity类,注意AndroidManifest.xml文件的修改,2、修复bug,优化内部结构</td></tr><tr><td>V2.0.1</td><td>2018-01-02</td><td>修复bug,优化内部结构</td></tr><tr><td>V2.0.2</td><td>2018-04-09</td><td>1、新增接口onExit(ILLSDKExitCallback),详细使用请看3.8, 2、SDK jar包合并为一个lingleisdk-2.0.2.jar,之前版本多余的jar包请删掉</td></tr><tr><td>V2.1.0</td><td>2018-06-20</td><td>1、新增接口getApkVersionCode(Context context)和getApkVersionName(Context context),详细使用请看3.9</td></tr></tbody></table><h2><a name='header-n1082' class='md-header-anchor '></a>二、Android 客户端接入</h2><p></p><h3><a name='header-n1085' class='md-header-anchor '></a>2.1 SDK 目录介绍</h3><ul><li>examples 文件夹:SDK接入示例。</li><li>lib 文件夹:SDK相关jar包。</li><li>source 文件夹:assets 和 res 资源文件。</li><li>AndroidManifest.xml:Android配置文件</li><li>Android-SDK集成手册.html:客户端接入文档</li><li>SDKDemo.apk:SDK演示示例</li></ul><h3><a name='header-n1106' class='md-header-anchor '></a>2.2 SDK 导入</h3><ul><li>将 libs\xxx.jar 文件添加到 libs目录。</li><li>复制 source\res 目录下的资源文件到你的工程中 res 对应同名的目录下。</li><li>复制 source\assets 目录下的文件到你的工程中的 assets 目录下</li></ul><h3><a name='header-n1117' class='md-header-anchor '></a>2.3 配置工程</h3><blockquote><p>SDK最小支持api版本14(Android 4.0)</p></blockquote><h4><a name='header-n1121' class='md-header-anchor '></a>2.3.1 配置 AndroidManifest.xml 文件:</h4><p>根据 SDK 压缩包里的 AndroidManifest.xml 样例文件,来配置应用程序的 AndroidManifest.xml。<br/>
|
主要步骤为:</p><ul><li>复制备注为 "<span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-11-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="11.206ex" height="2.577ex" viewBox="0 -806.1 4825 1109.7" role="img" focusable="false" style="vertical-align: -0.705ex;"><defs><path stroke-width="1" id="E11-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E11-MJMATHI-52" d="M230 637Q203 637 198 638T193 649Q193 676 204 682Q206 683 378 683Q550 682 564 680Q620 672 658 652T712 606T733 563T739 529Q739 484 710 445T643 385T576 351T538 338L545 333Q612 295 612 223Q612 212 607 162T602 80V71Q602 53 603 43T614 25T640 16Q668 16 686 38T712 85Q717 99 720 102T735 105Q755 105 755 93Q755 75 731 36Q693 -21 641 -21H632Q571 -21 531 4T487 82Q487 109 502 166T517 239Q517 290 474 313Q459 320 449 321T378 323H309L277 193Q244 61 244 59Q244 55 245 54T252 50T269 48T302 46H333Q339 38 339 37T336 19Q332 6 326 0H311Q275 2 180 2Q146 2 117 2T71 2T50 1Q33 1 33 10Q33 12 36 24Q41 43 46 45Q50 46 61 46H67Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628Q287 635 230 637ZM630 554Q630 586 609 608T523 636Q521 636 500 636T462 637H440Q393 637 386 627Q385 624 352 494T319 361Q319 360 388 360Q466 361 492 367Q556 377 592 426Q608 449 619 486T630 554Z"></path><path stroke-width="1" id="E11-MJMATHI-65" d="M39 168Q39 225 58 272T107 350T174 402T244 433T307 442H310Q355 442 388 420T421 355Q421 265 310 237Q261 224 176 223Q139 223 138 221Q138 219 132 186T125 128Q125 81 146 54T209 26T302 45T394 111Q403 121 406 121Q410 121 419 112T429 98T420 82T390 55T344 24T281 -1T205 -11Q126 -11 83 42T39 168ZM373 353Q367 405 305 405Q272 405 244 391T199 357T170 316T154 280T149 261Q149 260 169 260Q282 260 327 284T373 353Z"></path><path stroke-width="1" id="E11-MJMATHI-71" d="M33 157Q33 258 109 349T280 441Q340 441 372 389Q373 390 377 395T388 406T404 418Q438 442 450 442Q454 442 457 439T460 434Q460 425 391 149Q320 -135 320 -139Q320 -147 365 -148H390Q396 -156 396 -157T393 -175Q389 -188 383 -194H370Q339 -192 262 -192Q234 -192 211 -192T174 -192T157 -193Q143 -193 143 -185Q143 -182 145 -170Q149 -154 152 -151T172 -148Q220 -148 230 -141Q238 -136 258 -53T279 32Q279 33 272 29Q224 -10 172 -10Q117 -10 75 30T33 157ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326Z"></path><path stroke-width="1" id="E11-MJMATHI-75" d="M21 287Q21 295 30 318T55 370T99 420T158 442Q204 442 227 417T250 358Q250 340 216 246T182 105Q182 62 196 45T238 27T291 44T328 78L339 95Q341 99 377 247Q407 367 413 387T427 416Q444 431 463 431Q480 431 488 421T496 402L420 84Q419 79 419 68Q419 43 426 35T447 26Q469 29 482 57T512 145Q514 153 532 153Q551 153 551 144Q550 139 549 130T540 98T523 55T498 17T462 -8Q454 -10 438 -10Q372 -10 347 46Q345 45 336 36T318 21T296 6T267 -6T233 -11Q189 -11 155 7Q103 38 103 113Q103 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="E11-MJMATHI-69" d="M184 600Q184 624 203 642T247 661Q265 661 277 649T290 619Q290 596 270 577T226 557Q211 557 198 567T184 600ZM21 287Q21 295 30 318T54 369T98 420T158 442Q197 442 223 419T250 357Q250 340 236 301T196 196T154 83Q149 61 149 51Q149 26 166 26Q175 26 185 29T208 43T235 78T260 137Q263 149 265 151T282 153Q302 153 302 143Q302 135 293 112T268 61T223 11T161 -11Q129 -11 102 10T74 74Q74 91 79 106T122 220Q160 321 166 341T173 380Q173 404 156 404H154Q124 404 99 371T61 287Q60 286 59 284T58 281T56 279T53 278T49 278T41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="E11-MJMATHI-72" d="M21 287Q22 290 23 295T28 317T38 348T53 381T73 411T99 433T132 442Q161 442 183 430T214 408T225 388Q227 382 228 382T236 389Q284 441 347 441H350Q398 441 422 400Q430 381 430 363Q430 333 417 315T391 292T366 288Q346 288 334 299T322 328Q322 376 378 392Q356 405 342 405Q286 405 239 331Q229 315 224 298T190 165Q156 25 151 16Q138 -11 108 -11Q95 -11 87 -5T76 7T74 17Q74 30 114 189T154 366Q154 405 128 405Q107 405 92 377T68 316T57 280Q55 278 41 278H27Q21 284 21 287Z"></path><path stroke-width="1" id="E11-MJMATHI-64" d="M366 683Q367 683 438 688T511 694Q523 694 523 686Q523 679 450 384T375 83T374 68Q374 26 402 26Q411 27 422 35Q443 55 463 131Q469 151 473 152Q475 153 483 153H487H491Q506 153 506 145Q506 140 503 129Q490 79 473 48T445 8T417 -8Q409 -10 393 -10Q359 -10 336 5T306 36L300 51Q299 52 296 50Q294 48 292 46Q233 -10 172 -10Q117 -10 75 30T33 157Q33 205 53 255T101 341Q148 398 195 420T280 442Q336 442 364 400Q369 394 369 396Q370 400 396 505T424 616Q424 629 417 632T378 637H357Q351 643 351 645T353 664Q358 683 366 683ZM352 326Q329 405 277 405Q242 405 210 374T160 293Q131 214 119 129Q119 126 119 118T118 106Q118 61 136 44T179 26Q233 26 290 98L298 109L352 326Z"></path><path stroke-width="1" id="E11-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-52"></use></g><g fill="red" stroke="red" transform="translate(1149,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-65"></use></g><g fill="red" stroke="red" transform="translate(1615,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-71"></use></g><g fill="red" stroke="red" transform="translate(2076,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-75"></use></g><g fill="red" stroke="red" transform="translate(2648,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-69"></use></g><g fill="red" stroke="red" transform="translate(2994,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-72"></use></g><g fill="red" stroke="red" transform="translate(3445,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-65"></use></g><g fill="red" stroke="red" transform="translate(3912,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMATHI-64"></use></g><g fill="red" stroke="red" transform="translate(4435,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E11-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-11">\textcolor{red}{(Required)}</script>" 的部分。</li><li>将标注为 "<span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-12-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="9.273ex" height="2.811ex" viewBox="0 -906.7 3992.4 1210.2" role="img" focusable="false" style="vertical-align: -0.705ex;"><defs><path stroke-width="1" id="E12-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E12-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E12-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">您</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">的</text></g></g></g><g fill="red" stroke="red" transform="translate(1996,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">包</text></g></g></g><g fill="red" stroke="red" transform="translate(2799,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">名</text></g></g></g><g fill="red" stroke="red" transform="translate(3602,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E12-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-12">\textcolor{red}{(您的包名)}</script>" 的部分替换为您当前应用程序的包名。</li><li>将标注为 "<span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-13-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="13.871ex" height="2.811ex" viewBox="0 -906.7 5972.2 1210.2" role="img" focusable="false" style="vertical-align: -0.705ex;"><defs><path stroke-width="1" id="E13-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E13-MJMATHI-41" d="M208 74Q208 50 254 46Q272 46 272 35Q272 34 270 22Q267 8 264 4T251 0Q249 0 239 0T205 1T141 2Q70 2 50 0H42Q35 7 35 11Q37 38 48 46H62Q132 49 164 96Q170 102 345 401T523 704Q530 716 547 716H555H572Q578 707 578 706L606 383Q634 60 636 57Q641 46 701 46Q726 46 726 36Q726 34 723 22Q720 7 718 4T704 0Q701 0 690 0T651 1T578 2Q484 2 455 0H443Q437 6 437 9T439 27Q443 40 445 43L449 46H469Q523 49 533 63L521 213H283L249 155Q208 86 208 74ZM516 260Q516 271 504 416T490 562L463 519Q447 492 400 412L310 260L413 259Q516 259 516 260Z"></path><path stroke-width="1" id="E13-MJMATHI-50" d="M287 628Q287 635 230 637Q206 637 199 638T192 648Q192 649 194 659Q200 679 203 681T397 683Q587 682 600 680Q664 669 707 631T751 530Q751 453 685 389Q616 321 507 303Q500 302 402 301H307L277 182Q247 66 247 59Q247 55 248 54T255 50T272 48T305 46H336Q342 37 342 35Q342 19 335 5Q330 0 319 0Q316 0 282 1T182 2Q120 2 87 2T51 1Q33 1 33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM645 554Q645 567 643 575T634 597T609 619T560 635Q553 636 480 637Q463 637 445 637T416 636T404 636Q391 635 386 627Q384 621 367 550T332 412T314 344Q314 342 395 342H407H430Q542 342 590 392Q617 419 631 471T645 554Z"></path><path stroke-width="1" id="E13-MJMATHI-49" d="M43 1Q26 1 26 10Q26 12 29 24Q34 43 39 45Q42 46 54 46H60Q120 46 136 53Q137 53 138 54Q143 56 149 77T198 273Q210 318 216 344Q286 624 286 626Q284 630 284 631Q274 637 213 637H193Q184 643 189 662Q193 677 195 680T209 683H213Q285 681 359 681Q481 681 487 683H497Q504 676 504 672T501 655T494 639Q491 637 471 637Q440 637 407 634Q393 631 388 623Q381 609 337 432Q326 385 315 341Q245 65 245 59Q245 52 255 50T307 46H339Q345 38 345 37T342 19Q338 6 332 0H316Q279 2 179 2Q143 2 113 2T65 2T43 1Z"></path><path stroke-width="1" id="E13-MJMATHI-44" d="M287 628Q287 635 230 637Q207 637 200 638T193 647Q193 655 197 667T204 682Q206 683 403 683Q570 682 590 682T630 676Q702 659 752 597T803 431Q803 275 696 151T444 3L430 1L236 0H125H72Q48 0 41 2T33 11Q33 13 36 25Q40 41 44 43T67 46Q94 46 127 49Q141 52 146 61Q149 65 218 339T287 628ZM703 469Q703 507 692 537T666 584T629 613T590 629T555 636Q553 636 541 636T512 636T479 637H436Q392 637 386 627Q384 623 313 339T242 52Q242 48 253 48T330 47Q335 47 349 47T373 46Q499 46 581 128Q617 164 640 212T683 339T703 469Z"></path><path stroke-width="1" id="E13-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">您</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(50.259) matrix(1 0 0 -1 0 0)">的</text></g></g></g><g fill="red" stroke="red" transform="translate(1996,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMATHI-41"></use></g><g fill="red" stroke="red" transform="translate(2746,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMATHI-50"></use></g><g fill="red" stroke="red" transform="translate(3498,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMATHI-50"></use></g><g fill="red" stroke="red" transform="translate(4249,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMATHI-49"></use></g><g fill="red" stroke="red" transform="translate(4754,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMATHI-44"></use></g><g fill="red" stroke="red" transform="translate(5582,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E13-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-13">\textcolor{red}{(您的APPID)}</script>"的部分,替换为您自己的APPID值。</li><li>权限配置(可参考 Demo),注意:targetSdkVersion >= 23时,危险权限需要动态申请。</li></ul><p><strong>注:</strong> 如果您当前应用程序有自己的 Application,则必须继承 com.linglei.sdklib.open.LLApplication,</p><pre class='md-fences mock-cm' style='display:block;position:relative'>如果没有,请指定 application 的 name 属性为 com.linglei.sdklib.open.LLApplication </pre><p></p><h4><a name='header-n1143' class='md-header-anchor '></a>2.3.2 闪屏接入:</h4><p>在 AndroidManifest.xml 文件加入以下 activity 声明</p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 230px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">activity</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.auth.SplashActivity"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:configChanges</span>=<span class="cm-string">"keyboardHidden|orientation|screenSize"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:screenOrientation</span>=<span class="cm-string">"landscape"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@android:style/Theme.NoTitleBar.Fullscreen"</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">action</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.action.MAIN"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">category</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.category.LAUNCHER"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">activity</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 230px;"></div><div class="CodeMirror-gutters" style="display: none; height: 260px;"></div></div></div></pre><p>还需将游戏 AndroidManifest.xml ⽂档中原来的主 Activity 即含有以下代码</p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 92px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">action</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.action.MAIN"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">category</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.category.LAUNCHER"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 122px;"></div></div></div></pre><p>修改为以下代码</p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 92px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">action</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"您的包名.MAIN"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">category</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.category.DEFAULT"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 122px;"></div></div></div></pre><p>AndroidManifest 示例<br/></p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 2093px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta"><?xml</span> <span class="cm-meta">version="1.0" encoding="utf-8"?></span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">manifest</span> <span class="cm-attribute">xmlns:android</span>=<span class="cm-string">"http://schemas.android.com/apk/res/android"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">package</span>=<span class="cm-string">"您的包名"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:versionCode</span>=<span class="cm-string">"9"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:versionName</span>=<span class="cm-string">"2.0.2"</span> <span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- 注意targetSdkVersion >= 23时,危险权限需要动态申请 --></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-sdk</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:minSdkVersion</span>=<span class="cm-string">"14"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:targetSdkVersion</span>=<span class="cm-string">"22"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required 注意targetSdkVersion >= 23时,危险权限需要动态申请--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.INTERNET"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.MOUNT_UNMOUNT_FILESYSTEMS"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.WRITE_EXTERNAL_STORAGE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.CHANGE_WIFI_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.WAKE_LOCK"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.ACCESS_NETWORK_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.READ_PHONE_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.CALL_PHONE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.SYSTEM_ALERT_WINDOW"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.GET_TASKS"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.READ_PHONE_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.ACCESS_WIFI_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.ACCESS_FINE_LOCATION"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.ACCESS_COARSE_LOCATION"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.WRITE_EXTERNAL_STORAGE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.VIBRATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.SYSTEM_OVERLAY_WINDOW"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">uses-permission</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.permission.CHANGE_NETWORK_STATE"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- 如果您当前应用程序有自己的Application,则必须继承com.linglei.sdklib.open.LLApplication--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- 如果没有,请指定application的name属性为com.linglei.sdklib.open.LLApplication --></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">application</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.open.LLApplication"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:allowBackup</span>=<span class="cm-string">"true"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:icon</span>=<span class="cm-string">"@drawable/ic_launcher"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:label</span>=<span class="cm-string">"@string/app_name"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@style/AppTheme"</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required APPID--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">meta-data</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"LL_APPID"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:value</span>=<span class="cm-string">"您的APPID"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!--务必把游戏主activity的 action 和 category 修改为以下值--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">activity</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdkdemoas.MainActivity"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:configChanges</span>=<span class="cm-string">"keyboardHidden|orientation|screenSize"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:screenOrientation</span>=<span class="cm-string">"landscape"</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">action</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"您的包名.MAIN"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">category</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.category.DEFAULT"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">activity</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required 闪屏页 务必把SDK启动页的 action 和 category 修改为以下值,屏幕方向请指定竖屏或横屏--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">activity</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.auth.SplashActivity"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:configChanges</span>=<span class="cm-string">"keyboardHidden|orientation|screenSize"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:screenOrientation</span>=<span class="cm-string">"landscape"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@android:style/Theme.NoTitleBar.Fullscreen"</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">action</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.action.MAIN"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">category</span> <span class="cm-attribute">android:name</span>=<span class="cm-string">"android.intent.category.LAUNCHER"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">intent-filter</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">activity</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required SDK内部界面 屏幕方向请指定竖屏或横屏, 主题务必不要修改--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">activity</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.auth.AuthActivity"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:configChanges</span>=<span class="cm-string">"keyboardHidden|orientation|screenSize"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:screenOrientation</span>=<span class="cm-string">"landscape"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@style/llsdk_dialog"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required 公共界面 屏幕方向请指定竖屏或横屏 --></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">activity</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.auth.CommonActivity"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:configChanges</span>=<span class="cm-string">"keyboardHidden|orientation|screenSize"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:screenOrientation</span>=<span class="cm-string">"landscape"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@android:style/Theme.NoTitleBar.Fullscreen"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!-- Required SDK核心服务--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">service</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.open.LLService"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:exported</span>=<span class="cm-string">"false"</span> <span class="cm-tag cm-bracket">/></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">application</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">manifest</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 2093px;"></div><div class="CodeMirror-gutters" style="display: none; height: 2123px;"></div></div></div></pre><h2><a name='header-n1157' class='md-header-anchor '></a>三、SDK接口调用</h2><blockquote><p>所有接口务必在主线程中调用</p></blockquote><h3><a name='header-n1159' class='md-header-anchor '></a>3.1 Application <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><p>如果您当前应用程序有自己的Application,则必须继承com.linglei.sdklib.open.LLApplication</p><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 138px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">public</span> <span class="cm-keyword">class</span> <span class="cm-def">MyApplication</span> <span class="cm-keyword">extends</span> <span class="cm-variable">LLApplication</span> {</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onCreate</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onCreate</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 168px;"></div></div></div></pre><p>如果没有自己的Application,请指定application的name属性为com.linglei.sdklib.open.LLApplication</p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 161px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">application</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:name</span>=<span class="cm-string">"com.linglei.sdklib.open.LLApplication"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:allowBackup</span>=<span class="cm-string">"true"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:icon</span>=<span class="cm-string">"@drawable/ic_launcher"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:label</span>=<span class="cm-string">"@string/app_name"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-attribute">android:theme</span>=<span class="cm-string">"@style/AppTheme"</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">application</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 161px;"></div><div class="CodeMirror-gutters" style="display: none; height: 191px;"></div></div></div></pre><h3><a name='header-n1168' class='md-header-anchor '></a>3.2 初始化 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><blockquote><p>在程序主页面 Activity 的 onCreate方法调用以下初始化代码<br/>
|
第一个参数Context必须为Activity的上下文<br/>
|
初始化回调返回respCode==1的时候表示成功,才能继续往下操作<br/></p></blockquote><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 253px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 第一个参数Context必须为Activity的上下文</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">initSDK</span>(<span class="cm-variable">Context</span>, <span class="cm-keyword">new</span> <span class="cm-variable">ILLSDKInitCallback</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onInitResponse</span>(<span class="cm-variable-3">int</span> <span class="cm-variable">respCode</span>, <span class="cm-variable-3">String</span> <span class="cm-variable">respMsg</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"code->"</span> <span class="cm-operator">+</span> <span class="cm-variable">respCode</span> <span class="cm-operator">+</span> <span class="cm-string">" msg->"</span> <span class="cm-operator">+</span> <span class="cm-variable">respMsg</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// respCode==1成功</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">if</span> (<span class="cm-variable">respCode</span> <span class="cm-operator">==</span> <span class="cm-number">1</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">showToast</span>(<span class="cm-string">"初始化成功"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 253px;"></div><div class="CodeMirror-gutters" style="display: none; height: 283px;"></div></div></div></pre><h3><a name='header-n1176' class='md-header-anchor '></a>3.3 设置全局回调接口 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 1058px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 全局回调 请在初始化后设置</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">setLLSDKCallback</span>(<span class="cm-variable">ILLSDKCallback</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">private</span> <span class="cm-variable">ILLSDKCallback</span> <span class="cm-variable">sdkCallback</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">ILLSDKCallback</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onLoginSuccess</span>(<span class="cm-variable">UserResp</span> <span class="cm-variable">userResp</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"登录成功"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">showToast</span>(<span class="cm-string">"登录成功"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 成功回调UserResp类</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// UserResp字段:</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// uid 用户唯一标识</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// token cp服务器校验值</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// uid和token信息也可以在登录成功后调用LLSDK.getInstance().getAuth()来获取(务必做非空判断)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 登录成功后请设置角色信息</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 参数依次为 游戏币当前余额、角色的等级、用户vip等级、角色唯一标识、角色名、所在区服</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">RoleInfoReq</span> <span class="cm-variable">roleInfoReq</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">RoleInfoReq</span>(<span class="cm-number">100</span>, <span class="cm-number">10</span>, <span class="cm-number">10</span>, <span class="cm-string">"roleId"</span>, <span class="cm-string">"roleName"</span>, <span class="cm-string">"zone"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">setRoleData</span>(<span class="cm-variable">roleInfoReq</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onLoginFailure</span>(<span class="cm-variable-3">int</span> <span class="cm-variable">errorCode</span>, <span class="cm-variable-3">String</span> <span class="cm-variable">errorMsg</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"登录失败"</span> <span class="cm-operator">+</span> <span class="cm-variable">errorCode</span> <span class="cm-operator">+</span> <span class="cm-string">" "</span> <span class="cm-operator">+</span> <span class="cm-variable">errorMsg</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">showToast</span>(<span class="cm-string">"登录失败"</span> <span class="cm-operator">+</span> <span class="cm-variable">errorCode</span> <span class="cm-operator">+</span> <span class="cm-string">" "</span> <span class="cm-operator">+</span> <span class="cm-variable">errorMsg</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onLogout</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 表示用户已登出, 切换账号接口会走这个回调,游戏收到此消息通常情况下,需要主动调用登录接口</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">login</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onPayResponse</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 此方法回调只能说明支付操作完毕,具体是否支付成功以接入方服务端为准</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"支付操作完毕"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">showToast</span>(<span class="cm-string">"支付操作完毕"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">onPayFailure</span>(<span class="cm-variable-3">int</span> <span class="cm-variable">errorCode</span>, <span class="cm-variable-3">String</span> <span class="cm-variable">errorMsg</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"支付失败"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">showToast</span>(<span class="cm-string">"支付失败"</span> <span class="cm-operator">+</span> <span class="cm-variable">errorCode</span> <span class="cm-operator">+</span> <span class="cm-string">" "</span> <span class="cm-operator">+</span> <span class="cm-variable">errorMsg</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">};</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 1058px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1088px;"></div></div></div></pre><h3><a name='header-n1178' class='md-header-anchor '></a>3.4 登录 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 23px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">login</span>(<span class="cm-variable">MainActivity</span>.<span class="cm-keyword">this</span>);</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 23px;"></div><div class="CodeMirror-gutters" style="display: none; height: 53px;"></div></div></div></pre><h3><a name='header-n1180' class='md-header-anchor '></a>3.5 设置角色信息 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><p>登录成功后请设置角色信息</p><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 69px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//参数依次为 游戏币当前余额、角色的等级、用户vip等级、角色唯一标识、角色名、所在区服</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">RoleInfoReq</span> <span class="cm-variable">roleInfoReq</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">RoleInfoReq</span>(<span class="cm-number">100</span>, <span class="cm-number">10</span>, <span class="cm-number">10</span>, <span class="cm-string">"roleId"</span>, <span class="cm-string">"roleName"</span>, <span class="cm-number">2</span>, <span class="cm-string">"zone"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">setRoleData</span>(<span class="cm-variable">roleInfoReq</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 69px;"></div><div class="CodeMirror-gutters" style="display: none; height: 99px;"></div></div></div></pre><h3><a name='header-n1184' class='md-header-anchor '></a>3.6 切换账号 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 46px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//cp在切换账号或者注销的时候一定要接入此接口,调了此接口会走全局回调的onLogout()方法 </span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">switchAccount</span>();</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 46px;"></div><div class="CodeMirror-gutters" style="display: none; height: 76px;"></div></div></div></pre><h3><a name='header-n1186' class='md-header-anchor '></a>3.7 支付 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><p><strong>注</strong>:支付是否成功以接入方服务端为准</p><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 161px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//支付订单请求类 OrderReq:</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 第1个参数 cpOrder(String) 游戏方订单号-必填</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 第2个参数 amount(int) 订单价格(单位:分)-必填-必须传整型</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 第3个参数 orderDesc(String) 订单描述-必填</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 第4个参数 cpInfo(String) 游戏方透传信息-选填-可为空字符串</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">OrderReq</span> <span class="cm-variable">orderReq</span> <span class="cm-operator">=</span> <span class="cm-keyword">new</span> <span class="cm-variable">OrderReq</span>(<span class="cm-string">"1494852115481"</span>,<span class="cm-number">100</span>, <span class="cm-string">"一把大宝剑"</span>,<span class="cm-string">""</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">pay</span>(<span class="cm-variable">MainActivity</span>.<span class="cm-keyword">this</span>, <span class="cm-variable">orderReq</span>);</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 161px;"></div><div class="CodeMirror-gutters" style="display: none; height: 191px;"></div></div></div></pre><h3><a name='header-n1190' class='md-header-anchor '></a>3.8 退出程序 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 138px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//在退出游戏的时候调用</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onExit</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//或者</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onExit</span>(<span class="cm-variable">ILLSDKExitCallback</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">//注:前者带退出确认框并实现退出程序逻辑,后者带退出确认框但没有退出逻辑,会通过回调接口返回给cp自己处理退出</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 168px;"></div></div></div></pre><h3><a name='header-n1192' class='md-header-anchor '></a>3.9 apk 的 VersionCode 和 VersionName 要求</h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 138px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 因我方业务的需要,必须由我方控制要apk版本号和版本名这两个字段,</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 如果游戏内部也使用 apk 的 VersionCode 和 VersionName 作为版本控制,</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 请务必调用 </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">getApkVersionCode</span>(<span class="cm-variable">Context</span>) </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 和 </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">getApkVersionName</span>(<span class="cm-variable">Context</span>)<span class="cm-variable">接口获取</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 168px;"></div></div></div></pre><p>还需在llsdk_config.xml 加入 <ll_v_code> 和 <ll_v_name> 标签</p><pre class="md-fences md-end-block" lang="xml"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 207px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta"><?xml</span> <span class="cm-meta">version='1.0' encoding='utf-8' standalone='yes' ?></span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"><</span><span class="cm-tag">map</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">llsdkcl</span><span class="cm-tag cm-bracket">></span>1<span class="cm-tag cm-bracket"></</span><span class="cm-tag">llsdkcl</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">llsdkfg</span><span class="cm-tag cm-bracket">></span>DEFAULT<span class="cm-tag cm-bracket"></</span><span class="cm-tag">llsdkfg</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!--apk版本号--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">ll_v_code</span><span class="cm-tag cm-bracket">></span>1<span class="cm-tag cm-bracket"></</span><span class="cm-tag">ll_v_code</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment"><!--apk版本名--></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">ll_v_name</span><span class="cm-tag cm-bracket">></span>1.0.1<span class="cm-tag cm-bracket"></</span><span class="cm-tag">ll_v_name</span><span class="cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket"></</span><span class="cm-tag">map</span><span class="cm-tag cm-bracket">></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 207px;"></div><div class="CodeMirror-gutters" style="display: none; height: 237px;"></div></div></div></pre><h3><a name='header-n1197' class='md-header-anchor '></a>3.10 SDK 生命周期 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-9-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.54ex" height="2.757ex" viewBox="0 -889.4 2385.4 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E9-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E9-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">必</text></g></g></g><g fill="red" stroke="red" transform="translate(1192,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1995,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E9-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-9">\textcolor{red}{(必接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 1610px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onStart()方法回调ILLApi的onStart()方法</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onStart</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onStart</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onStart</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onResume()方法回调ILLApi的onResume()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onResume</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onResume</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onResume</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onPause()方法回调ILLApi的onPause()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onPause</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onPause</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onPause</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onStop()方法回调ILLApi的onStop()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onStop</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onStop</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onStop</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onRestart()方法回调ILLApi的onRestart()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onRestart</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onRestart</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onRestart</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onDestroy()方法回调ILLApi的onDestroy()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onDestroy</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onDestroy</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onDestory</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onNewIntent()方法回调ILLApi的onNewIntent(Intent)方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onNewIntent</span>(<span class="cm-variable">Intent</span> <span class="cm-variable">intent</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onNewIntent</span>(<span class="cm-variable">intent</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onNewIntent</span>(<span class="cm-variable">intent</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onConfigurationChanged()方法回调ILLApi的onConfigurationChanged()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-def">onConfigurationChanged</span>(<span class="cm-variable">Configuration</span> <span class="cm-variable">newConfig</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onConfigurationChanged</span>(<span class="cm-variable">newConfig</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onConfigurationChanged</span>(<span class="cm-variable">newConfig</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// Activity生命周期onActivityResult()方法回调ILLApi的onActivityResult()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">protected</span> <span class="cm-variable-3">void</span> <span class="cm-def">onActivityResult</span>(<span class="cm-variable-3">int</span> <span class="cm-variable">requestCode</span>, <span class="cm-variable-3">int</span> <span class="cm-variable">resultCode</span>, <span class="cm-variable">Intent</span> <span class="cm-variable">data</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onActivityResult</span>(<span class="cm-variable">requestCode</span>, <span class="cm-variable">resultCode</span>, <span class="cm-variable">data</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onActivityResult</span>(<span class="cm-variable">requestCode</span>, <span class="cm-variable">resultCode</span>, <span class="cm-variable">data</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 在onBackPressed()方法回调onKeyBack()</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 或在Activity的onKeyDown(int, KeyEvent)方法监听返回键并回调ILLApi的onKeyBack()方法</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-def">onBackPressed</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-keyword">super</span>.<span class="cm-variable">onBackPressed</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">onKeyBack</span>();</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 1610px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1640px;"></div></div></div></pre><h3><a name='header-n1199' class='md-header-anchor '></a>3.11 关于异常统计 <span class="MathJax_Preview"></span><span class="MathJax_SVG" id="MathJax-Element-10-Frame" tabindex="-1" style="font-size: 100%; display: inline-block;"><svg xmlns:xlink="http://www.w3.org/1999/xlink" width="5.506ex" height="2.757ex" viewBox="0 -889.4 2370.5 1187.2" role="img" focusable="false" style="vertical-align: -0.692ex;"><defs><path stroke-width="1" id="E10-MJMAIN-28" d="M94 250Q94 319 104 381T127 488T164 576T202 643T244 695T277 729T302 750H315H319Q333 750 333 741Q333 738 316 720T275 667T226 581T184 443T167 250T184 58T225 -81T274 -167T316 -220T333 -241Q333 -250 318 -250H315H302L274 -226Q180 -141 137 -14T94 250Z"></path><path stroke-width="1" id="E10-MJMAIN-29" d="M60 749L64 750Q69 750 74 750H86L114 726Q208 641 251 514T294 250Q294 182 284 119T261 12T224 -76T186 -143T145 -194T113 -227T90 -246Q87 -249 86 -250H74Q66 -250 63 -250T58 -247T55 -238Q56 -237 66 -225Q221 -64 221 250T66 725Q56 737 55 738Q55 746 60 749Z"></path></defs><g stroke="currentColor" fill="currentColor" stroke-width="0" transform="matrix(1 0 0 -1 0 0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><g fill="red" stroke="red"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E10-MJMAIN-28"></use></g><g fill="red" stroke="red" transform="translate(389,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">选</text></g></g></g><g fill="red" stroke="red" transform="translate(1177,0)"><g fill="red" stroke="red"><g fill="red" stroke="red"><text font-family="STIXGeneral,'Arial Unicode MS',serif" stroke="none" transform="scale(32.867) matrix(1 0 0 -1 0 0)">接</text></g></g></g><g fill="red" stroke="red" transform="translate(1980,0)"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#E10-MJMAIN-29"></use></g></g></g></g></svg></span><script type="math/tex" id="MathJax-Element-10">\textcolor{red}{(选接)}</script></h3><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 391px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// SDK内部已实现异常捕获UncaughtExceptionHandler(初始化SDK时注册)</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 以下有三种情况:</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 1、客户端自己没有实现UncaughtExceptionHandler类捕获异常的情况下 </span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 如需处理异常 请设置异常回调LLSDK.getInstance().setExceptionCallback(IExceptionCallback)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">setExceptionCallback</span>(<span class="cm-keyword">new</span> <span class="cm-variable">IExceptionCallback</span>() {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-meta">@Override</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-keyword">public</span> <span class="cm-variable-3">void</span> <span class="cm-variable">uncaughtException</span>(<span class="cm-variable">Thread</span> <span class="cm-variable">thread</span>, <span class="cm-variable">Throwable</span> <span class="cm-variable">throwable</span>) {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-variable">Log</span>.<span class="cm-variable">e</span>(<span class="cm-string">"MainActivity"</span>, <span class="cm-string">"收到异常"</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span>}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">});</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 2、如果客户端自己已实现UncaughtExceptionHandler类捕获异常,并且注册于SDK初始化之后</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 那么SDK内部的异常捕获就会失效,那么请在客户端收到异常的地方回调给SDK</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-variable">LLSDK</span>.<span class="cm-variable">getInstance</span>().<span class="cm-variable">handleToSDKException</span>(<span class="cm-variable">Thread</span>, <span class="cm-variable">Throwable</span>);</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 3、如果客户端使用的是第三方统计异常库,那么请忽略3.11</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 391px;"></div><div class="CodeMirror-gutters" style="display: none; height: 421px;"></div></div></div></pre><h2><a name='header-n1201' class='md-header-anchor '></a>四、附录</h2><h3><a name='header-n1202' class='md-header-anchor '></a>4.1 SDK 打包混淆</h3><p>在 ProGuard 文件中加入以下 keep。</p><pre class="md-fences md-end-block" lang="java"> <div class="CodeMirror cm-s-inner CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 184px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">keep</span> <span class="cm-keyword">class</span> <span class="cm-def">com</span>.<span class="cm-variable">linglei</span>.<span class="cm-variable">sdk</span>.<span class="cm-operator">**</span> {<span class="cm-operator">*</span>;}</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">dontwarn</span> <span class="cm-variable">com</span>.<span class="cm-variable">linglei</span>.<span class="cm-variable">sdk</span>.<span class="cm-operator">**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">keep</span> <span class="cm-keyword">class</span> <span class="cm-def">com</span>.<span class="cm-variable">linglei</span>.<span class="cm-variable">sdklib</span>.<span class="cm-operator">**</span> {<span class="cm-operator">*</span>;}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">dontwarn</span> <span class="cm-variable">com</span>.<span class="cm-variable">linglei</span>.<span class="cm-variable">sdklib</span>.<span class="cm-operator">**</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">keep</span> <span class="cm-keyword">class</span> <span class="cm-def">com</span>.<span class="cm-variable">lingleigame</span>.<span class="cm-variable">ad</span>.<span class="cm-variable">sdk</span>.<span class="cm-operator">**</span>{<span class="cm-operator">*</span>;}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-operator">-</span><span class="cm-variable">dontwarn</span> <span class="cm-variable">com</span>.<span class="cm-variable">lingleigame</span>.<span class="cm-variable">ad</span>.<span class="cm-variable">sdk</span>.<span class="cm-operator">**</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px; border-bottom: 0px solid transparent; top: 184px;"></div><div class="CodeMirror-gutters" style="display: none; height: 214px;"></div></div></div></pre><h3><a name='header-n1206' class='md-header-anchor '></a>4.2 返回码</h3><table><thead><tr><th>返回码</th><th>代码</th><th>含义</th></tr></thead><tbody><tr><td>1</td><td>RespCode.SUCCESS</td><td>成功</td></tr><tr><td>2</td><td>RespCode.ERR_PARAM</td><td>参数错误</td></tr><tr><td>10</td><td>RespCode.ERR_CONFIG</td><td>配置信息错误</td></tr><tr><td>11</td><td>RespCode.ERR_NETWORK</td><td>网络异常</td></tr><tr><td>12</td><td>RespCode.ERR_NO_LOGGED</td><td>未登录</td></tr><tr><td>99</td><td>RespCode.ERR_FAIL</td><td>内部错误</td></tr><tr><td>101</td><td>RespCode.ERR_TOKEN</td><td>token错误</td></tr><tr><td>102</td><td>RespCode.ERR_TOKEN_OVERDUE</td><td>token已过期</td></tr><tr><td>103</td><td>RespCode.ERR_ACCOUNT_EXIST</td><td>账户已存在</td></tr><tr><td>104</td><td>RespCode.ERR_CHANNEL</td><td>错误的渠道号</td></tr><tr><td>105</td><td>RespCode.ERR_ACCOUNT_PWD</td><td>账号密码错误</td></tr><tr><td>106</td><td>RespCode.ERR_ACCOUNT_NO_EXIST</td><td>账号不存在</td></tr><tr><td>107</td><td>RespCode.ERR_BIND_ACCOUNT_PHONE_EXIST</td><td>要绑定的账号电话已存在</td></tr><tr><td>108</td><td>RespCode.ERR_SMS_SEND</td><td>短信发送失败</td></tr><tr><td>109</td><td>RespCode.ERR_VERIFY_NUM</td><td>验证码错误</td></tr><tr><td>201</td><td>RespCode.ERR_PAY_ORDER</td><td>支付订单创建失败</td></tr></tbody></table><p></p><p></p></div>
|
</body>
|
</html>
|