Android:创建每次输入活动时更新会话ID的功能?

时间:2014-07-24 20:17:24

标签: android

我目前的应用程序是用户玩的游戏。存储每个会话的用户详细信息。

我想添加每次玩游戏时创建和更新sessionID的功能。

我该怎么办?

目前,sessionID只是一个随机数(x):

//getting random number for sessionid (WILL BE CHANGED EVENTUALLY)
            Random ran = new Random();
            int x = ran.nextInt(1) + 3000;


            //Adding the new Score to the database. NOTE: SESSIONID NEEDS TO BE SORTED AND CHANGED TO PRIM KEY EVENTUALLY
            db.addScore(new Score(x, "Multiplication", UserName.getUserName(), averageMedLevel,medMax, 
                    averageAttLevel,attMax, score,myDate));

            //single score, used for passing to the results screen
            single = db.getScore(UserName.getUserName());

0 个答案:

没有答案