我已经在我的Android游戏中集成了OpenFeint,我想知道我需要添加什么才能获得OpenFeint播放器id。我想要id或用户名,这样我就可以允许用户在设备之间转移他们的游戏帐户,使用OpenFeint进行身份验证。
下面是我使用OpenFeint的代码:
OpenFeintSettings ofsettings = new OpenFeintSettings(gameName, gameKey, gameSecret, gameID);
OpenFeint.initialize(this, ofsettings, new OpenFeintDelegate() {});发布于 2012-02-14 17:43:30
当我在我开发的游戏中实现openFeint时,我也需要玩家id。
我使用了以下代码
import com.openfeint.api.OpenFeint;
import com.openfeint.api.resource.User;
import android.app.Activity;
import android.os.Bundle;
public class ABC extends Activity {
User u;
String Name;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.score);
u = OpenFeint.getCurrentUser();
// user id received
Name = u.name;
System.out.println("** The User id is ** " + Name );
}
}发布于 2012-01-23 14:51:43
如果你不是100%喜欢OpenFeint,请查看Swarm,它提供了一系列类似的功能(排行榜、成就、云数据保存等)。Swarm's Cloud Data将完全满足您的需求,并允许您将数据保存到用户的帐户中,因此,无论他们使用哪种设备,他们都可以使用自己的所有数据:)
https://stackoverflow.com/questions/7732460
复制相似问题