当前位置: 首页>>代码示例>>Java>>正文


Java KeyValueStorage.getValue方法代码示例

本文整理汇总了Java中com.soomla.data.KeyValueStorage.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java KeyValueStorage.getValue方法的具体用法?Java KeyValueStorage.getValue怎么用?Java KeyValueStorage.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.soomla.data.KeyValueStorage的用法示例。


在下文中一共展示了KeyValueStorage.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUserProfile

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
/**
 * Fetches the user profile stored for the given provider
 *
 * @param provider the provider which will be used to fetch the user profile
 * @return a user profile
 */
public static UserProfile getUserProfile(IProvider.Provider provider) {
    String userProfileJSON = KeyValueStorage.getValue(keyUserProfile(provider));
    if (TextUtils.isEmpty(userProfileJSON)) {
        return null;
    }

    try {
        JSONObject upJSON = new JSONObject(userProfileJSON);
        return new UserProfile(upJSON);
    } catch (JSONException e) {
        SoomlaUtils.LogError(TAG, "Couldn't create UserProfile from json: " + userProfileJSON);
    }

    return null;
}
 
开发者ID:soomla,项目名称:android-profile,代码行数:22,代码来源:UserProfileStorage.java

示例2: getLevelUpModel

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static JSONObject getLevelUpModel() {
    JSONObject modelJSON = null;

    String model = KeyValueStorage.getValue(DB_KEY_PREFIX + "model");
    SoomlaUtils.LogDebug(TAG, "model: " + model);
    if (model == null) {
        return null;
    }

    try {
        modelJSON = new JSONObject(model);
    } catch (JSONException e) {
        SoomlaUtils.LogError(TAG, "Unable to parse LevelUp model into JSON");
    }

    return modelJSON;
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:18,代码来源:LevelUp.java

示例3: login

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void login(final Activity parentActivity, final AuthCallbacks.LoginListener loginListener) {
    if (!isInitialized) {
        SoomlaUtils.LogError(TAG, "Consumer key and secret were not defined, please provide them in initialization");
        return;
    }

    SoomlaUtils.LogDebug(TAG, "login");
    WeakRefParentActivity = new WeakReference<Activity>(parentActivity);

    RefProvider = getProvider();
    RefLoginListener = loginListener;

    preformingAction = ACTION_LOGIN;

    mainRequestToken = null;
    twitter.setOAuthAccessToken(null);

    // Try logging in using store credentials
    String oauthToken = KeyValueStorage.getValue(getTwitterStorageKey(TWITTER_OAUTH_TOKEN));
    String oauthTokenSecret = KeyValueStorage.getValue(getTwitterStorageKey(TWITTER_OAUTH_SECRET));
    if (!TextUtils.isEmpty(oauthToken) && !TextUtils.isEmpty(oauthTokenSecret)) {
        twitter.setOAuthAccessToken(new AccessToken(oauthToken, oauthTokenSecret));
        twitterScreenName = KeyValueStorage.getValue(getTwitterStorageKey(TWITTER_SCREEN_NAME));

        loginListener.success(RefProvider);

        clearListener(ACTION_LOGIN);
    }
    else {
        // If no stored credentials start login process by requesting
        // a request token
        twitter.getOAuthRequestTokenAsync(oauthCallbackURL);
    }
}
 
开发者ID:soomla,项目名称:android-profile,代码行数:39,代码来源:SoomlaTwitter.java

示例4: getTimesCompleted

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
/**
 * Fetches the number of times the mission has been completed.
 *
 * @param missionId the id of the mission to check
 * @return the number of times the mission has been completed, 0 by default.
 */
public static int getTimesCompleted(String missionId) {
    String key = keyMissionTimesCompleted(missionId);
    String val = KeyValueStorage.getValue(key);
    if (TextUtils.isEmpty(val)) {
        return 0;
    }
    return Integer.parseInt(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:15,代码来源:MissionStorage.java

示例5: getAccessToken

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public String getAccessToken() {
    return KeyValueStorage.getValue(VERIFY_ACCESS_TOKEN_KEY);
}
 
开发者ID:soomla,项目名称:android-store-google-play,代码行数:4,代码来源:GooglePlayIabService.java

示例6: isCompleted

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static boolean isCompleted(String worldId) {
    String key = keyWorldCompleted(worldId);
    String val = KeyValueStorage.getValue(key);
    return !TextUtils.isEmpty(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:WorldStorage.java

示例7: getAssignedReward

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static String getAssignedReward(String worldId) {
    String key = keyReward(worldId);
    return KeyValueStorage.getValue(key);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:5,代码来源:WorldStorage.java

示例8: getLastCompletedInnerWorld

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static String getLastCompletedInnerWorld(String worldId) {
    String key = keyLastCompletedInnerWorld(worldId);
    return KeyValueStorage.getValue(key);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:5,代码来源:WorldStorage.java

示例9: getLastDurationMillis

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static long getLastDurationMillis(String levelId) {
    String key = keyLastDuration(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Long.parseLong(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例10: getSlowestDurationMillis

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static long getSlowestDurationMillis(String levelId) {
    String key = keySlowestDuration(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Long.parseLong(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例11: getFastestDurationMillis

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static long getFastestDurationMillis(String levelId) {
    String key = keyFastestDuration(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Long.parseLong(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例12: getTimesStarted

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static int getTimesStarted(String levelId) {
    String key = keyTimesStarted(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Integer.parseInt(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例13: getTimesPlayed

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static int getTimesPlayed(String levelId) {
    String key = keyTimesPlayed(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Integer.parseInt(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例14: getTimesCompleted

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
public static int getTimesCompleted(String levelId) {
    String key = keyTimesCompleted(levelId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? 0 : Integer.parseInt(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:6,代码来源:LevelStorage.java

示例15: getLatestScore

import com.soomla.data.KeyValueStorage; //导入方法依赖的package包/类
/**
 * Gets the most recently saved value of the given score.
 *
 * @param scoreId the id of the score to examine
 * @return the last saved value
 */
public static double getLatestScore(String scoreId) {
    String key = keyLatestScore(scoreId);
    String val = KeyValueStorage.getValue(key);
    return TextUtils.isEmpty(val) ? -1 : Double.parseDouble(val);
}
 
开发者ID:soomla,项目名称:android-levelup,代码行数:12,代码来源:ScoreStorage.java


注:本文中的com.soomla.data.KeyValueStorage.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。