/** アイテムSTORE表示 */ public static void openPurchaseView() { if (appCCloud == null) { // Log.w(TAG,"Plugin was not started."); return; } appCCloud.Purchase.callPurchaseActivity(); }
/** * item数追加 * * @param id * @param addCount */ public static void addItemCount(String id, int addCount) { if (appCCloud == null) { // Log.w(TAG,"Plugin was not started."); return; } appCCloud.Purchase.addItemCount(id, addCount); }
/** * アイテム取得 * * @param key アイテムキー * @return JSON形式文字列 */ public static String getItem(String key) { AppCCloud._Purchase.Item item = appCCloud.Purchase.getItem(key); JSONObject json = new JSONObject(); try { json.put("id", item.getKey()); json.put("name", item.getName()); json.put("count", item.getCount()); } catch (Exception e) { } return json.toString(); }
/** * 全アイテムを返す * * @return JSON形式、getItemの戻り値が配列になったもの */ public static String getItems() { ArrayList<AppCCloud._Purchase.Item> items = appCCloud.Purchase.getItems(); JSONArray jsonArray = new JSONArray(); for (AppCCloud._Purchase.Item item : items) { JSONObject json = new JSONObject(); try { json.put("id", item.getKey()); json.put("name", item.getName()); json.put("count", item.getCount()); } catch (Exception e) { continue; } jsonArray.put(json); } return jsonArray.toString(); }
/** * active item 設定 * * @param key * @param ids */ public static void setActiveItems(String key, String[] ids) { appCCloud.Purchase.setActiveItems(key, ids); }
/** * item数取得 * * @param id * @return */ public static int getItemCount(String id) { return appCCloud.Purchase.getItemCount(id); }
/** * item数設定 * * @param id * @param count */ public static void setItemCount(String id, int count) { if (appCCloud.Purchase != null) { appCCloud.Purchase.setItemCount(id, count); } }