本文整理汇总了Java中com.mob.tools.utils.Hashon类的典型用法代码示例。如果您正苦于以下问题:Java Hashon类的具体用法?Java Hashon怎么用?Java Hashon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Hashon类属于com.mob.tools.utils包,在下文中一共展示了Hashon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadEmojiMap
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
protected void loadEmojiMap() {
try {
InputStream is = MobSDK.getContext().getAssets().open("bbssdk/emoji.json");
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String text = new String(buffer);
Map<String, String> mapfromjson = new Hashon().fromJson(text);
listEmoji = new ArrayList<Map.Entry<String, String>>(mapfromjson.entrySet());
Collections.sort(listEmoji, new Comparator<Map.Entry<String, String>>() {
@Override
public int compare(Map.Entry<String, String> lhs, Map.Entry<String, String> rhs) {
return lhs.getValue().split("\\/")[0].compareTo(rhs.getValue().split("\\/")[0]);
}
});
for (Map.Entry<String, String> entry : listEmoji) {
mapEmoji.put(entry.getKey(), entry.getValue());
mapEmojiReversed.put(entry.getValue(), entry.getKey());
}
} catch (IOException e) {
// Should never happen!
throw new RuntimeException(e);
}
}
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:27,代码来源:EmojiManager.java
示例2: rawGet
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public void rawGet(String str, RawNetworkCallback rawNetworkCallback) throws Throwable {
HttpUriRequest httpGet = new HttpGet(str);
HttpClient sSLHttpClient = str.startsWith("https://") ? getSSLHttpClient() : new
DefaultHttpClient();
HttpResponse execute = sSLHttpClient.execute(httpGet);
int statusCode = execute.getStatusLine().getStatusCode();
if (statusCode == 200) {
if (rawNetworkCallback != null) {
rawNetworkCallback.onResponse(execute.getEntity().getContent());
}
sSLHttpClient.getConnectionManager().shutdown();
return;
}
String entityUtils = EntityUtils.toString(execute.getEntity(), Constants.UTF_8);
HashMap hashMap = new HashMap();
hashMap.put("error", entityUtils);
hashMap.put("status", Integer.valueOf(statusCode));
sSLHttpClient.getConnectionManager().shutdown();
throw new Throwable(new Hashon().fromHashMap(hashMap));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:NetworkHelper.java
示例3: doCustomerProtocol
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
protected void doCustomerProtocol(String str, String str2, int i, HashMap<String, Object> hashMap, HashMap<String, String> hashMap2) {
HashMap a = f.a((Platform) this).a(str, str2, hashMap, hashMap2);
if (a == null || a.size() <= 0) {
if (this.listener != null) {
this.listener.onError(this, i, new Throwable());
}
} else if (a.containsKey("ret")) {
if (((Integer) a.get("ret")).intValue() != 0) {
if (this.listener != null) {
this.listener.onError(this, i, new Throwable(new Hashon().fromHashMap(a)));
}
} else if (this.listener != null) {
this.listener.onComplete(this, i, a);
}
} else if (this.listener != null) {
this.listener.onError(this, i, new Throwable());
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:QZone.java
示例4: b
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public HashMap<String, Object> b(String str, String str2) {
Object obj = !TextUtils.isEmpty(str) ? 1 : null;
String str3 = obj != null ? "/t/add_pic_t" : "/t/add_t";
String str4 = "https://graph.qq.com" + str3;
ArrayList arrayList = new ArrayList();
arrayList.add(new KVPair("oauth_consumer_key", this.d));
arrayList.add(new KVPair("access_token", this.f));
arrayList.add(new KVPair("openid", this.e));
arrayList.add(new KVPair("format", "json"));
arrayList.add(new KVPair(Utils.RESPONSE_CONTENT, str2));
String a = obj != null ? this.g.a(str4, arrayList, new KVPair("pic", str), str3, c()) : this.g.b(str4, arrayList, str3, c());
if (a == null || a.length() <= 0) {
return null;
}
HashMap<String, Object> fromJson = new Hashon().fromJson(a);
if (((Integer) fromJson.get("ret")).intValue() == 0) {
return fromJson;
}
throw new Throwable(a);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:f.java
示例5: e
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public HashMap<String, Object> e(String str) {
ArrayList arrayList = new ArrayList();
arrayList.add(new KVPair("access_token", str));
ArrayList arrayList2 = new ArrayList();
arrayList2.add(new KVPair(Network.USER_AGENT, System.getProperties().getProperty("http.agent") + " ArzenAndroidSDK"));
String a = this.g.a("https://graph.qq.com/oauth2.0/me", arrayList, arrayList2, null, "/oauth2.0/me", c());
if (a.startsWith(com.alipay.sdk.authjs.a.c)) {
while (!a.startsWith("{") && a.length() > 0) {
a = a.substring(1);
}
while (!a.endsWith("}") && a.length() > 0) {
a = a.substring(0, a.length() - 1);
}
}
return (a == null || a.length() <= 0) ? null : new Hashon().fromJson(a);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:17,代码来源:f.java
示例6: a
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
private boolean a(cn.sharesdk.framework.statistics.a aVar, HashMap<String, Object> hashMap, HashMap<String, Object> hashMap2) {
try {
if (hashMap.containsKey("error")) {
if (!ShareSDK.isDebug()) {
return false;
}
Log.e("ShareSDK request platform config ==>>", new Hashon().fromHashMap(hashMap));
return false;
} else if (hashMap.containsKey(ShareConstants.RES_PATH)) {
Ln.i("snsconf returns ===> %s", aVar.b(this.j, String.valueOf(hashMap.get(ShareConstants.RES_PATH)).replace("\n", "")).trim());
hashMap2.putAll(new Hashon().fromJson(r2));
return true;
} else if (!ShareSDK.isDebug()) {
return false;
} else {
Log.e("ShareSDK platform config result ==>>", "SNS configuration is empty");
return false;
}
} catch (Throwable th) {
if (!ShareSDK.isDebug()) {
return false;
}
th.printStackTrace();
return false;
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:27,代码来源:k.java
示例7: importData
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public void importData(String str) {
try {
HashMap fromJson = new Hashon().fromJson(str);
if (fromJson != null) {
Editor edit = this.db.edit();
for (Entry entry : fromJson.entrySet()) {
Object value = entry.getValue();
if (value instanceof Boolean) {
edit.putBoolean((String) entry.getKey(), ((Boolean) value).booleanValue());
} else if (value instanceof Float) {
edit.putFloat((String) entry.getKey(), ((Float) value).floatValue());
} else if (value instanceof Integer) {
edit.putInt((String) entry.getKey(), ((Integer) value).intValue());
} else if (value instanceof Long) {
edit.putLong((String) entry.getKey(), ((Long) value).longValue());
} else {
edit.putString((String) entry.getKey(), String.valueOf(value));
}
}
edit.commit();
}
} catch (Throwable th) {
Ln.w(th);
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:PlatformDb.java
示例8: h
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
private long h() {
if (!f.h()) {
return 0;
}
String str = "{}";
try {
str = this.k.httpGet(b(), null, null, null);
} catch (Throwable th) {
Ln.e(th);
}
HashMap fromJson = new Hashon().fromJson(str);
if (!fromJson.containsKey("timestamp")) {
return f.a();
}
try {
long currentTimeMillis = System.currentTimeMillis() - R.parseLong(String.valueOf(fromJson.get("timestamp")));
f.a("service_time", Long.valueOf(currentTimeMillis));
return currentTimeMillis;
} catch (Throwable th2) {
Ln.w(th2);
return f.a();
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:24,代码来源:a.java
示例9: a
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public void a(String str, ArrayList<HashMap<String, String>> arrayList) {
if (f.h()) {
HashMap hashMap = new HashMap();
hashMap.put("type", str);
DeviceHelper instance = DeviceHelper.getInstance(this.a);
hashMap.put("plat", Integer.valueOf(instance.getPlatformCode()));
hashMap.put("device", instance.getDeviceKey());
hashMap.put("list", arrayList);
Ln.d(" upload apps info == %s", new Hashon().fromHashMap(hashMap));
ArrayList arrayList2 = new ArrayList();
arrayList2.add(new KVPair("m", Data.Base64AES(r0, "sdk.sharesdk.sdk")));
ArrayList arrayList3 = new ArrayList();
arrayList3.add(new KVPair(Network.USER_AGENT, c));
ArrayList arrayList4 = new ArrayList();
arrayList4.add(new KVPair("http.socket.timeout", Integer.valueOf(30000)));
arrayList4.add(new KVPair("http.connection.timeout", Integer.valueOf(30000)));
String httpPost = this.k.httpPost(d(), arrayList2, null, arrayList3, arrayList4);
Ln.i("> APPS_UNFINISHED resp: %s", httpPost);
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:a.java
示例10: b
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public HashMap<String, Object> b(int i, int i2, String str) {
ArrayList arrayList = new ArrayList();
arrayList.add(new KVPair(SocialConstants.PARAM_SOURCE, this.c));
if (this.f != null) {
arrayList.add(new KVPair("access_token", this.f));
}
Object obj = 1;
try {
R.parseLong(str);
} catch (Throwable th) {
obj = null;
}
if (obj != null) {
arrayList.add(new KVPair(SocializeProtocolConstants.PROTOCOL_KEY_UID, str));
} else {
arrayList.add(new KVPair("screen_name", str));
}
arrayList.add(new KVPair("count", String.valueOf(i)));
arrayList.add(new KVPair("cursor", String.valueOf(i2 * i)));
String a = this.h.a("https://api.weibo.com/2/friendships/friends.json", arrayList, "/2/friendships/friends.json", c());
return a != null ? new Hashon().fromJson(a) : null;
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:i.java
示例11: c
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public HashMap<String, Object> c(String str) {
ArrayList arrayList = new ArrayList();
arrayList.add(new KVPair(SocialConstants.PARAM_SOURCE, this.c));
if (this.f != null) {
arrayList.add(new KVPair("access_token", this.f));
}
Object obj = 1;
try {
R.parseLong(str);
} catch (Throwable th) {
obj = null;
}
if (obj != null) {
arrayList.add(new KVPair(SocializeProtocolConstants.PROTOCOL_KEY_UID, str));
} else {
arrayList.add(new KVPair("screen_name", str));
}
String a = this.h.a("https://api.weibo.com/2/users/show.json", arrayList, "/2/users/show.json", c());
return a != null ? new Hashon().fromJson(a) : null;
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:21,代码来源:i.java
示例12: d
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public HashMap<String, Object> d(String str) {
ArrayList arrayList = new ArrayList();
arrayList.add(new KVPair(SocialConstants.PARAM_SOURCE, this.c));
arrayList.add(new KVPair("access_token", this.f));
Object obj = 1;
try {
R.parseLong(str);
} catch (Throwable th) {
obj = null;
}
if (obj != null) {
arrayList.add(new KVPair(SocializeProtocolConstants.PROTOCOL_KEY_UID, str));
} else {
arrayList.add(new KVPair("screen_name", str));
}
String b = this.h.b("https://api.weibo.com/2/friendships/create.json", arrayList, "/2/friendships/create.json", c());
return b != null ? new Hashon().fromJson(b) : null;
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:i.java
示例13: doCustomerProtocol
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
protected void doCustomerProtocol(String str, String str2, int i, HashMap<String, Object> hashMap, HashMap<String, String> hashMap2) {
try {
HashMap a = i.a((Platform) this).a(str, str2, (HashMap) hashMap, (HashMap) hashMap2);
if (a == null || a.size() <= 0) {
if (this.listener != null) {
this.listener.onError(this, i, new Throwable());
}
} else if (!a.containsKey("error_code") || ((Integer) a.get("error_code")).intValue() == 0) {
if (this.listener != null) {
this.listener.onComplete(this, i, a);
}
} else if (this.listener != null) {
this.listener.onError(this, i, new Throwable(new Hashon().fromHashMap(a)));
}
} catch (Throwable th) {
this.listener.onError(this, i, th);
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:SinaWeibo.java
示例14: follow
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
protected void follow(String str) {
try {
HashMap d = i.a((Platform) this).d(str);
if (d == null) {
if (this.listener != null) {
this.listener.onError(this, 6, new Throwable());
}
} else if (!d.containsKey("error_code") || ((Integer) d.get("error_code")).intValue() == 0) {
if (this.listener != null) {
this.listener.onComplete(this, 6, d);
}
} else if (this.listener != null) {
this.listener.onError(this, 6, new Throwable(new Hashon().fromHashMap(d)));
}
} catch (Throwable th) {
this.listener.onError(this, 6, th);
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:SinaWeibo.java
示例15: run
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public void run() {
try {
String a = i.a(this.a).a(this.a.getContext(), this.b);
} catch (Throwable th) {
Ln.e(th);
return;
}
if (a == null) {
this.c.c.onError(new Throwable("Authorize token is empty"));
return;
}
HashMap fromJson = new Hashon().fromJson(a);
Bundle bundle = new Bundle();
bundle.putString("access_token", String.valueOf(fromJson.get("access_token")));
bundle.putString("remind_in", String.valueOf(fromJson.get("remind_in")));
bundle.putString("expires_in", String.valueOf(fromJson.get("expires_in")));
bundle.putString(SocializeProtocolConstants.PROTOCOL_KEY_UID, String.valueOf(fromJson.get(SocializeProtocolConstants.PROTOCOL_KEY_UID)));
this.c.c.onComplete(bundle);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:g.java
示例16: prepare
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public static void prepare(final Context context, final Runnable afterPrepare) {
Runnable act = new Runnable() {
public void run() {
synchronized (DB_FILE) {
if (hanzi2Pinyin == null || hanzi2Pinyin.size() <= 0) {
try {
int resId = ResHelper.getRawRes(context, DB_FILE);
if (resId <= 0) {
hanzi2Pinyin = new HashMap<String, Object>();
} else {
InputStream is = context.getResources().openRawResource(resId);
GZIPInputStream gzis = new GZIPInputStream(is);
InputStreamReader isr = new InputStreamReader(gzis);
BufferedReader br = new BufferedReader(isr);
String json = br.readLine();
br.close();
hanzi2Pinyin = new Hashon().fromJson(json);
}
} catch (Throwable t) {
SMSLog.getInstance().w(t);
hanzi2Pinyin = new HashMap<String, Object>();
}
}
if (afterPrepare != null) {
afterPrepare.run();
}
}
}
};
if (afterPrepare != null) {
new Thread(act).start();
} else {
act.run();
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:SearchEngine.java
示例17: onSuccess
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void onSuccess(API api, int action, Map<String, Object> result) {
// 解析数据
result = (Map<String, Object>) result.get("result");
try {
int curPage = com.mob.tools.utils.R.parseInt(com.mob.tools.utils.R.toString(result.get("curPage")));
total = com.mob.tools.utils.R.parseInt(com.mob.tools.utils.R.toString(result.get("total")));
if (curPage != pageIndex + 1) {
return;
}
} catch (Throwable t) {
throw new RuntimeException(t);
}
// 追加数据
pageIndex++;
ArrayList<HashMap<String, Object>> resultList = forceCast(result.get("list"));
Hashon hashon = new Hashon();
for (HashMap<String, Object> res : resultList) {
HashMap<String, Object> recipe = forceCast(res.get("recipe"));
if (recipe == null) {
recipe = new HashMap<String, Object>();
}
String tmp = forceCast(recipe.get("ingredients"));
if (tmp != null) {
recipe.put("ingredients", hashon.fromJson("{\"list\":" + tmp + "}").get("list"));
}
tmp = forceCast(recipe.get("method"));
if (tmp != null) {
recipe.put("method", hashon.fromJson("{\"list\":" + tmp + "}").get("list"));
}
}
menus.addAll(resultList);
// 显示数据
notifyDataSetChanged();
}
开发者ID:stytooldex,项目名称:stynico,代码行数:39,代码来源:MenuAdapter.java
示例18: JsInterfaceForumImage
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public JsInterfaceForumImage(String[] imageUrls, int index, JsViewClient viewClient, ForumImageViewer.OnPageChangedListener listener) {
hashon = new Hashon();
this.imageUrls = imageUrls;
this.index = index;
this.curIndex = index;
refViewClient = new WeakReference<JsViewClient>(viewClient);
this.onPageChangedListener = listener;
}
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:9,代码来源:JsInterfaceForumImage.java
示例19: getImageUrlsAndIndex
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
@JavascriptInterface
public String getImageUrlsAndIndex() {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("imageUrls", imageUrls);
map.put("index", index);
return new Hashon().fromHashMap(map);
}
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:8,代码来源:JsInterfaceForumImage.java
示例20: JsInterfaceForumThread
import com.mob.tools.utils.Hashon; //导入依赖的package包/类
public JsInterfaceForumThread(Context context, JsViewClient viewClient, ForumThread forumThread) {
if (viewClient != null) {
refViewClient = new WeakReference<JsViewClient>(viewClient);
hashon = new Hashon();
}
this.forumThread = forumThread;
this.context = context;
}
开发者ID:MobClub,项目名称:BBSSDK-for-Android,代码行数:9,代码来源:JsInterfaceForumThread.java
注:本文中的com.mob.tools.utils.Hashon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论