Java Swarm离线方法不起作用(使用AndEngine)
我已经试过好几次了,但是Swarm不适合离线使用。。。 在这个网站上,他说把这个文件放在你的Android项目的资产中,它是JSON文件。我已经把它放在我的资产文件夹中,但它不工作。 也许他没有读这个文件 LogCat错误:Java Swarm离线方法不起作用(使用AndEngine),java,android,andengine,Java,Android,Andengine,我已经试过好几次了,但是Swarm不适合离线使用。。。 在这个网站上,他说把这个文件放在你的Android项目的资产中,它是JSON文件。我已经把它放在我的资产文件夹中,但它不工作。 也许他没有读这个文件 LogCat错误: 04-25 02:42:48.621: W/System.err(12466): java.net.UnknownHostException: Unable to resolve host "api.swarmconnect.com": No address associa
04-25 02:42:48.621: W/System.err(12466): java.net.UnknownHostException: Unable to resolve host "api.swarmconnect.com": No address associated with hostname
04-25 02:42:48.621: W/System.err(12466): at java.net.InetAddress.lookupHostByName(InetAddress.java:424)
04-25 02:42:48.640: W/System.err(12466): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
04-25 02:42:48.640: W/System.err(12466): at java.net.InetAddress.getAllByName(InetAddress.java:214)
04-25 02:42:48.644: W/System.err(12466): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
显示主屏幕时:
@Override
public void createScene() {
if ( Swarm.isEnabled() ) {
Swarm.init(this.activity, GameConfig.SWARP_APP_ID, GameConfig.SWARP_APP_KEY);
}
createBackground();
createMenuChildScene();
}
单击“播放”菜单时:
public boolean onMenuItemClicked(MenuScene pMenuScene, IMenuItem pMenuItem, float pMenuItemLocalX, float pMenuItemLocalY)
{
switch(pMenuItem.getID()) {
case MENU_PLAY:
if (! Swarm.isInitialized() ) {
Swarm.init(this.activity, GameConfig.SWARP_APP_ID, GameConfig.SWARP_APP_KEY, mySwarmLoginListener);
}else{
SceneManager.getInstance().loadGameScene(engine);
}
//many switch code where...
SwarmListener:
private SwarmLoginListener mySwarmLoginListener = new SwarmLoginListener() {
// This method is called when the user has successfully logged in.
public void userLoggedIn(SwarmActiveUser user) {
//Carrega Game Scene
SceneManager.getInstance().loadGameScene(engine);
}
public void userLoggedOut() { }
public void loginStarted() { }
public void loginCanceled() { }
};
}
Swarm在线工作很好
是的,我试着联系支持人员,但没有回答