整理android java 的知识Android打包环境

java 环境变量

1、系统变量→新建

变量名:JAVA_HOME

变量值:(变量值填写你的jdk的安装目录,例如本人是 E:\Java\jdk1.7.0)

2、在系统变量中找到 Path 变量,选择编辑

在变量值最后输入 %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

(注意如果原来Path的变量值末尾没有;号,就先输入;号再输入上面的代码)

3、系统变量→新建

变量名:CLASSPATH

变量值:.%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar(注意最前面有一点)

 

(Path最前边前写上(中间加;) D:\Program Files (x86)\UnityTools\android\Androidandroid-sdk\platform-tools;%JAVA_HOM%\bin;%JAVA_HOME%\jre\bin;)

 

到这系统变量就配置完毕了。

4、检验jdk是否配置成功:运行cmd 输入 java -version (java 和 -version 之间有空格)

 

android sdk:

Android 安装后:
打开Unity Edit -> Preferences...浏览Andoid SDK的目录
D:\Program Files (x86)\U3dTool_AndroidSDK\adt-bundle-windows-x86_64-20131030\sdk

C:\Program Files\Java\jdk1.8.0_152

不是

 

下载的链接///

http://sdk.android-studio.org/


http://openjdk.java.net/

https://developer.android.com/ndk/downloads/older_releases

https://developer.android.com/studio/releases/sdk-tools

http://jdk.java.net/16/

 

Adding modules to the Unity Editor
Use the Unity Hub to add additional components to installations of the Editor that you originally installed using the Hub.

Open the Hub.
Select Installs.
Find the Editor you want to add the components to.
Click the three dots to the right of the version label, then select Add Modules. (NOTE: If you didn’t install the Editor via the Hub, you will not see this option. To enable this option, install the Editor via the Hub.)
In the Add Modules dialog, locate the module to add and tick its checkbox.
When you have selected all the modules to add, select Done.

/

 

关于移动客户端token过期问题

 

移动客户端游戏登陆SDK时,向渠道认证完成之后,拿到认证信息,其中之一为token或称之为sessionid;

 

*token有一定的时效,过期之后需要重新向登陆认证,拿到新的token;

 

*移动客户端向游戏服务器登陆时,需要提供包含token的认证,游戏服务器需要向渠道认证包含token的认证信息,如果渠道返回有效,则认为移动客户端为合法;

 

*游戏过程中经常会断线重连,每次重连过程相当于走一次向游戏服务器登录的过程,游戏服务器也会将token向渠道服务器进行了认证,但是token的时效性,导致一段时间之后的断线重连会被拒绝;

 

*一种解决方案是:每次断线重连的时候,先向渠道服务器登陆,申请新的token;另一种是:当游戏服务器得到的反馈是token已经过期,那么告知客户端重新向渠道服务器获取,然后带着新的token进行断线重连操作。相对于可能频繁的获取token,更趋向于第二种方法,从经验来看,大部分token的时效是按照小时来计算的,而对于相对碎片时间的移动客户端来说,小时是个非常长的打开游戏的时间。

 



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值