我已多次尝试过,但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 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)
显示HomeScreen时:
@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在线工作......
是的,我试图联系支持部门,从未接听过我。