Commit 06f6cd4a authored by gaorui's avatar gaorui
Browse files

feat(app):新增海外接入参考demo

parent 54e04a84
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="#8f000000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="#7f666666" />
<stroke android:color="#a5666666" android:width="2dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
android:orientation="horizontal">
<ScrollView
android:id="@+id/main_scrollview"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingLeft="40dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:fadeScrollbars="false"
android:background="#6f000000"
android:fillViewport="true">
<LinearLayout
android:id="@+id/main_linearlayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/main_tv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="4dp"
android:text="12"
android:textSize="12dp"
android:textColor="@color/hl_white_ff"/>
</FrameLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<Button
android:id="@+id/init"
style="@style/DemoBtn"
android:onClick="onClickInit"
android:text="初始化" />
<Button
android:id="@+id/login"
style="@style/DemoBtn"
android:onClick="onClickLogin"
android:text="登录" />
<Button
android:id="@+id/logout"
android:onClick="onClickLogout"
style="@style/DemoBtn"
android:text="登出" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="createRole"
android:text="创角" />
<Button
android:onClick="enterSever"
style="@style/DemoBtn"
android:text="进服" />
<Button
android:onClick="levelUp"
style="@style/DemoBtn"
android:text="升级" />
<Button
android:onClick="customTrack"
style="@style/DemoBtn"
android:text="自定义" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<EditText
android:id="@+id/et_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="支付金额(分)"
android:textColorHint="#dddddd"
android:maxLines="1"
android:maxLength="7"
android:inputType="number"
android:textColor="@android:color/holo_red_light"
android:textSize="18sp" />
<EditText
android:id="@+id/et_itemId"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:hint="商品id"
android:textColorHint="#dddddd"
android:maxLines="1"
android:textColor="@android:color/holo_red_light"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="doPay"
android:text="支付1分钱" />
<Button
style="@style/DemoBtn"
android:onClick="customPay"
android:text="自定义支付" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="getPriceInfo"
android:text="商品信息(海外)" />
<Button
style="@style/DemoBtn"
android:onClick="onExit"
android:text="退出" />
<Button
android:id="@+id/fragment_accountmanage"
style="@style/DemoBtn"
android:onClick="onClickAccountmanage"
android:text="账号管理" />
<Button
style="@style/DemoBtn"
android:onClick="openService"
android:visibility="gone"
android:text="打开客服" />
<Button
style="@style/DemoBtn"
android:onClick="testCrashJava"
android:visibility="gone"
android:text="JAVA异常" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:visibility="gone"
android:orientation="horizontal">
<EditText
android:id="@+id/ip_et"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="IP"
android:text="192.168.0.107" />
<EditText
android:id="@+id/port_et"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="端口"
android:text="8888" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg2"
android:orientation="vertical"
android:paddingTop="40dp">
<ScrollView
android:id="@+id/main_scrollview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:padding="3dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_linearlayout">
<TextView
android:id="@+id/main_tv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:padding="20dp"
android:textColor="#eee"
android:text="用户信息用户信息用户信息用户信息用户信息用户信"
android:textSize="14sp" />
</LinearLayout>
</ScrollView>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal">
<EditText
android:id="@+id/et_ip_host"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:paddingLeft="20dp"
android:text="10.1.3.29"
android:textSize="14dp"
android:hint="ip地址"/>
<EditText
android:id="@+id/et_ip_port"
android:layout_width="80dp"
android:layout_height="48dp"
android:paddingLeft="20dp"
android:text="8888"
android:textSize="14dp"
android:hint="8888"/>
<EditText
android:id="@+id/et_ip_pwd"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:inputType="textPassword"
android:paddingLeft="20dp"
android:textSize="14dp"
android:text="123456"
android:hint="密码"/>
<Button
android:layout_width="80dp"
android:layout_height="48dp"
android:layout_weight="0"
style="@style/DemoBtn"
android:onClick="setProxy"
android:text="设置代理" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:orientation="horizontal">
<EditText
android:id="@+id/et_rpc"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:paddingLeft="20dp"
android:text="10.1.4.172"
android:textSize="14dp"
android:hint="ip地址"/>
<EditText
android:id="@+id/et_pwd"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_weight="1"
android:inputType="textPassword"
android:paddingLeft="20dp"
android:textSize="14dp"
android:hint="密码"/>
<Button
android:id="@+id/rpcBtn"
android:layout_width="80dp"
android:layout_height="48dp"
style="@style/DemoBtn"
android:layout_weight="0"
android:onClick="setRpc"
android:text="设置rpc" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<Button
android:id="@+id/init"
android:onClick="onClickInit"
style="@style/DemoBtn"
android:text="初始化" />
<Button
android:id="@+id/login"
style="@style/DemoBtn"
android:visibility="gone"
android:onClick="onClickLogin"
android:text="登录" />
<Button
android:id="@+id/logout"
android:onClick="onClickLogout"
style="@style/DemoBtn"
android:visibility="gone"
android:text="登出" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="createRole"
android:text="创角" />
<Button
style="@style/DemoBtn"
android:onClick="enterSever"
android:text="进服" />
<Button
style="@style/DemoBtn"
android:onClick="levelUp"
android:text="升级" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<EditText
android:id="@+id/et_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_et"
android:layout_weight="1"
android:gravity="center"
android:hint="支付金额(分)"
android:maxLines="1"
android:maxLength="7"
android:textColorHint="#dddddd"
android:inputType="number"
android:textColor="@android:color/holo_red_light"
android:textSize="18sp" />
<EditText
android:id="@+id/et_itemId"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_et"
android:layout_weight="1"
android:gravity="center"
android:hint="商品id"
android:textColorHint="#dddddd"
android:maxLines="1"
android:textColor="@android:color/holo_red_light"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="doPay"
android:text="支付1分" />
<Button
style="@style/DemoBtn"
android:onClick="customPay"
android:text="自定义支付" />
<Button
style="@style/DemoBtn"
android:onClick="gameInfoData"
android:text="方舟报送"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<Button
android:id="@+id/fragment_accountmanage"
style="@style/DemoBtn"
android:onClick="onClickAccountmanage"
android:text="账号管理" />
<Button
style="@style/DemoBtn"
android:onClick="share"
android:text="分享" />
<Button
style="@style/DemoBtn"
android:onClick="getPriceInfo"
android:text="商品信息(海外)" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:orientation="horizontal">
<Button
style="@style/DemoBtn"
android:onClick="onExit"
android:text="退出" />
<Button
style="@style/DemoBtn"
android:onClick="openService"
android:text="打开客服" />
<Button
style="@style/DemoBtn"
android:onClick="testCrashJava"
android:text="模拟JAVA异常" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="shareText"
android:text="shareText"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="shareVideo"
android:text="shareVideo" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="sharePhoto"
android:text="sharePhoto" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="fbShareText"
android:text="fbShareText" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="fbPhotoShare"
android:text="fbPhotoShare" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:onClick="fbShareVideo"
android:text="fbShareVideo" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">fastSdkDemo</string>
<string name="facebook_app_id">987654321</string>
<string name="fb_login_protocol_scheme">fb987654321</string>
<string name="facebook_client_token">987654321ABCDEFG</string>
<string name="game_services_project_id">242883477374</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DemoBtn">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_gravity">center</item>
<item name="android:textColor">#eeeeee</item>
<item name="android:background">@drawable/btn_selector</item>
<item name="android:layout_margin">2dp</item>
</style>
</resources>
\ No newline at end of file
android.useAndroidX=true
#android.enableJetifier=true
#android.userDexArchive=true
PROJ_UPLOADE_URL=https://sdk.wdyxgames.com/nexus/repository/sdk-release/
PROJ_UPLOADE_USERNAME=access
PROJ_UPLOADE_PASSWORD=hoolai
#加快构建编译速度
android.nonTransitiveRClass=true
org.gradle.caching=true
\ No newline at end of file
#Thu Aug 12 14:49:15 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Mar 16 14:51:48 CST 2023
sdk.dir=/Users/gaorui/Library/Android/sdk
rootProject.name = "hoolai-oversea-demo-new"
include ':game_demo'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment