资源简介
微云游戏平台(WiGame)SDK_Android版游戏SDK_3.0.4
微云游戏平台Android版SDK开发者指南.pdf
javadoc
...
代码片段和文件信息
package com.wiyun.game;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import android.app.ListActivity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.wiyun.game.model.ChallengeRequest;
public class Sample extends ListActivity {
// test app key and secret key
private static final String APP_KEY = “4e861427e3253720“;
private static final String SECRET_KEY = “dqpSaVecbtUBtruKxFyYNm2DBnU4LgsZ“;
private static final String SCORE_LEADERBOARD_ID = “93e7f544f14aaccd“;
private static final String TIME_LEADERBOARD_ID = “a3ac18ef9140072d“;
private static final String ACHIEVEMENT_ID = “ce902fbd2fbc298c“;
private static final String CHALLENGE_DEFINITION_ID = “654fd115d9820136“;
// challenge to user id
private String mChallengeToUserId;
// flag of orientation
private boolean mLandscape;
// flag of fullscreen
private boolean mFullScreen;
// hint text
private TextView mHintText;
// 所有的回调都是在UI线程中发生的,如果您需要做一些时间比较长的操作,请在线程中进行
private WiGameClient mClient = new WiGameClient() {
public void wyLoggedIn(String sessionKey) {
mHintText.setText(WiGame.getMyName() + “ Welcome“);
Bitmap bitmap = WiGame.getMyPortrait();
Drawable drawable = new BitmapDrawable(bitmap);
mHintText.setCompoundDrawablesWithIntrinsicBounds(drawable null null null);
}
public void wyLogInFailed() {
mHintText.setText(“Login Failed“);
}
@Override
public void wyPlayChallenge(ChallengeRequest request) {
byte[] data = request.getBlob();
int length = data == null ? 0 : data.length;
mChallengeToUserId = request.getCtuId();
Toast.makeText(Sample.this String.format(getString(R.string.toast_play_challenge)
mChallengeToUserId request.getScore() length) Toast.LENGTH_SHORT).show();
}
public void wyPortraitGot(String userId) {
if(WiGame.getMyId().equals(userId)) {
Bitmap bitmap = WiGame.getMyPortrait();
Drawable drawable = new BitmapDrawable(bitmap);
mHintText.setCompoundDrawablesWithIntrinsicBounds(drawable null null null);
}
}
@Override
public void wyGameSaveStart(String name int totalSize) {
Log.d(“WiYun“ “game saving start total size: “ + totalSize);
}
@Override
public void wyGameSaveProgress(String name int uploadedSize) {
Log.d(“WiYun“ “game saving progress uploaded size: “ + uploadedSize);
}
@Override
public void wyGameSaved(String name) {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-07-13 11:30 extra\
目录 0 2011-07-13 11:30 extra\WiGame_icon_A\
目录 0 2011-07-13 11:30 extra\WiGame_icon_B\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\114\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\48\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\512\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\57\
目录 0 2011-07-13 11:30 extra\WiGame_icon_C\72\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\114\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\48\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\512\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\57\
目录 0 2011-07-13 11:30 extra\WiGame_icon_D\72\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\114\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\48\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\512\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\57\
目录 0 2011-07-13 11:30 extra\WiGame_icon_E\72\
目录 0 2011-07-13 11:30 javadoc\
目录 0 2011-07-13 11:30 javadoc\com\
目录 0 2011-07-13 11:30 javadoc\com\wiyun\
目录 0 2011-07-13 11:30 javadoc\com\wiyun\game\
目录 0 2011-07-13 11:30 javadoc\com\wiyun\game\class-use\
目录 0 2011-07-13 11:30 javadoc\com\wiyun\game\model\
目录 0 2011-07-13 11:30 javadoc\com\wiyun\game\model\class-use\
目录 0 2011-07-13 11:30 javadoc\index-files\
目录 0 2011-07-13 11:30 javadoc\resources\
目录 0 2011-07-13 11:30 libs\
............此处省略811个文件信息
评论
共有 条评论