7 package com.google.appinventor.components.runtime.util;
9 import android.util.Log;
14 import java.util.List;
17 import org.json.JSONException;
19 import redis.clients.jedis.Jedis;
20 import redis.clients.jedis.JedisPubSub;
23 private static final boolean DEBUG =
false;
25 private Thread myThread;
26 private static String LOG_TAG =
"CloudDB";
33 myThread = Thread.currentThread();
37 public void onSubscribe(String channel,
int subscribedChannels) {
39 Log.d(LOG_TAG,
"onSubscribe " + channel +
" " + subscribedChannels);
44 public void onMessage(String channel, String message) {
46 Log.d(LOG_TAG,
"onMessage channel " + channel +
", message: " + message);
50 List<Object> data =
null;
53 Log.d(LOG_TAG,
"onMessage: data = " + data);
55 String tag = (String) data.get(0);
56 List<Object> valueList = (List<Object>) data.get(1);
57 for (Object value : valueList) {
61 if (retValue ==
null) {
67 }
catch (JSONException e) {
68 Log.e(LOG_TAG,
"onMessage: JSONException", e);