本文整理汇总了Java中com.androidquery.callback.AjaxCallback类的典型用法代码示例。如果您正苦于以下问题:Java AjaxCallback类的具体用法?Java AjaxCallback怎么用?Java AjaxCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AjaxCallback类属于com.androidquery.callback包,在下文中一共展示了AjaxCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_find_id_input);
okBtn = (Button)findViewById(R.id.okBtn);
inputCode = (EditText)findViewById(R.id.input_code);
aQuery = new AQuery(getApplicationContext());
params = new HashMap<>();
okBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
aQuery.ajax("http://52.79.134.200/signin", params, String.class, new AjaxCallback<String>(){
@Override
public void callback(String url, String object, AjaxStatus status) {
}
});
}
});
}
开发者ID:JoMingyu,项目名称:Daejeon-People,代码行数:22,代码来源:EntryID.java
示例2: login
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void login() {
aQuery.ajax(passwd, null, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
String pass = null;
if (json != null) {
try {
pass = json.getString("password");
} catch (JSONException e) {
e.printStackTrace();
}
}
if (status.getCode() == 200 && status.getCode() < 300) {
if (pass.contentEquals(password)) {
facultySubjectMapping = new FacultySubjectMapping(empid, context, sharedPreferences, toast);
facultySubjectMapping.run();
}
}
}
});
}
开发者ID:CoepPortal,项目名称:PortalApp,代码行数:22,代码来源:FacultyLogin.java
示例3: loadImages
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
/**
* Using AQuery(a helper class) to load status images and store them on
* sdcard
*/
private void loadImages() {
if (imageUrlList != null && imageUrlList.size() > 0) {
for (Map.Entry<String, String> mapEntry : imageUrlList.entrySet()) {
AQuery aquery = new AQuery(getBaseContext());
final String idValue = mapEntry.getValue();
aquery.ajax(mapEntry.getKey(), Bitmap.class,
new AjaxCallback<Bitmap>() {
@Override
public void callback(String url, Bitmap object,
AjaxStatus status) {
super.callback(url, object, status);
Log.i("store images", url);
storeImages(url, object, idValue);
}
});
}
}
}
开发者ID:laaptu,项目名称:twitterwidget,代码行数:23,代码来源:TwitterService.java
示例4: doInBackground
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
@Override
protected String doInBackground(Void... params) {
Activity activity = activityContainer.get();
if (null == activity) {
return "";
}
try {
versionCode = activity.getPackageManager()
.getPackageInfo(activity.getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
locale = activity.getResources().getConfiguration().locale.toString();//Locale.getDefault().toString();
AQUtility.debug("locale", locale);
String response = "";
AjaxCallback<String> cb = new AjaxCallback<String>();
cb.url(MESSAGEURL).type(String.class);
aq.sync(cb);
response = cb.getResult();
return response;
}
开发者ID:recoilme,项目名称:freemp,代码行数:25,代码来源:UpdateUtils.java
示例5: updateUser
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
private void updateUser(String userId) {
// TODO Auto-generated method stub
if (userId.equals(app.getUserData("userId"))) {
UserInfo currentUserInfo = new UserInfo();
currentUserInfo.setUserId(app.getUserData("userId"));
currentUserInfo.setUserName(app.getUserData("userName"));
currentUserInfo.setUserAvatarUrl(app.getUserData("userAvatarUrl"));
headers.put("user_id", currentUserInfo.getUserId());
app.setUser(currentUserInfo);
sendBroadcast(new Intent(ACTION_USERUPDATE));
handler.sendEmptyMessage(MESSAGE_UPDATEUSER);//当切换用户id时,重新加载页面
} else {
String url = Constant.BASE_URL + "user/view?userid=" + userId;
AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.url(url).type(JSONObject.class)
.weakHandler(this, "getBandUserInfoResult");
cb.SetHeader(app.getHeaders());
aq.ajax(cb);
}
}
开发者ID:joyplus,项目名称:joyplus-tv,代码行数:21,代码来源:Main1.java
示例6: placeOrder
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
private void placeOrder(int itemId) {
String cookieValue = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString(Constants.COOKIE_VALUE_PREFS_KEY, "");
int userId = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getInt(Constants.USER_ID_PREFS_KEY, 0);
if (!TextUtils.isEmpty(cookieValue)) {
String url = Constants.PLACE_ORDER_URL;
Map<String, Object> params = new HashMap<String, Object>();
params.put(Constants.ITEM_ID_API_KEY, itemId);
params.put(Constants.USER_ID_API_KEY, userId);
if(mOptionsRadioGroup != null) {
params.put(String.valueOf(mAQ.id(mOptionsRadioGroup.getCheckedRadioButtonId()).getTag()),
1);
}
AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.url(url).type(JSONObject.class).weakHandler(this, "placeOrderCallback").params(params);
cb.cookie(Constants.LUNCHTIME_SESSION_API_KEY, cookieValue);
mAQ.ajax(cb);
} else {
Toast.makeText(this, R.string.not_logged, Toast.LENGTH_SHORT).show();
}
}
开发者ID:smdremedy,项目名称:kni-lunchtime,代码行数:23,代码来源:ItemDetailsActivity.java
示例7: onCreate
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.address_book_listview);
final ActionBar chatting = getActionBar();
chatting.setCustomView(R.layout.custom_address_book);
chatting.setDisplayShowTitleEnabled(false);
chatting.setDisplayShowCustomEnabled(true);
chatting.setDisplayShowHomeEnabled(false);
backBtn = (Button) findViewById(R.id.backBtn);
AQuery aq = new AQuery(getApplicationContext());
aq.ajax("http://52.79.134.200/friend", String.class, new AjaxCallback<String>() {
@Override
public void callback(String url, String response, AjaxStatus status) {
if(status.getCode() == 200) {
try {
JSONObject res = new JSONObject(response);
} catch(JSONException e) {
e.printStackTrace();
}
} else {
}
}
}.method(AQuery.METHOD_GET).cookie("UserSession", SessionManager.getCookieFromDB(getApplicationContext())));
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), Main.class));
}
});
}
开发者ID:JoMingyu,项目名称:Daejeon-People,代码行数:38,代码来源:FriendList.java
示例8: getInfo
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getInfo() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("emp_id", empid);
aQuery.ajax(getInfo, params, JSONObject.class,new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
if (json != null) {
try {
int length = json.getInt("length");
String in = json.getString("ResultSet");
JSONObject reader = new JSONObject(in);
for (int i = 0; i < length; i++) {
JSONObject obj = reader.getJSONObject(String.valueOf(i));
ID = obj.getString("ID");
}
}catch (Exception e){
e.printStackTrace();
}
}else {
Log.d("id", "NULL");
}
if(status.getCode() == 200 && status.getCode() < 300){
if(ID.equals("")) {
//insertInfo();
sendOTP();
} else {
toast = Toast.makeText(context, "Account is registered on another device", Toast.LENGTH_SHORT);
toast.show();
}
}
}
});
}
开发者ID:CoepPortal,项目名称:PortalApp,代码行数:41,代码来源:FacultySignUp.java
示例9: getFacultyInfo
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getFacultyInfo() {
Map<String, String> params = new HashMap<>();
params.put("emp_id", empid);
aQuery.ajax(facultyinfo, params, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
if (json != null) {
try {
String ResultSet = json.getString("ResultSet");
JSONObject jsonObject = new JSONObject(ResultSet);
JSONObject reader = jsonObject.getJSONObject("0");
emp_name = reader.getString("EmployeeName");
emp_email = reader.getString("CoepEmail");
} catch (JSONException e) {
e.printStackTrace();
}
}
if (status.getCode() == 200 && status.getCode() < 300) {
// SharedPreferences.Editor editor = sharedPreferences.edit();
// editor.putString("employeeregcode", empid);
// editor.putString("employeename", emp_name);
// editor.putString("employeeemail", emp_email);
// editor.commit();
getInfo();
}
}
});
}
开发者ID:CoepPortal,项目名称:PortalApp,代码行数:31,代码来源:FacultySignUp.java
示例10: commonHeader
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
/**
* 添加公共的请求头
* @param callback 请求的回调
*/
private static <K> AjaxCallback<K> commonHeader(AjaxCallback<K> callback, String authorization) {
return callback.header(HEADER_ACCEPT, "*/*")
.header(HEADER_CONNECTION, "Keep-Alive")
.header(HEADER_AUTHORIZATION, authorization)
.header(HEADER_USER_AGENT, "Android")
.header(HEADER_REFERER, "http://www.fpliu.com");
}
开发者ID:leleliu008,项目名称:Newton_for_Android_AS,代码行数:12,代码来源:AndroidQueryRequest.java
示例11: post
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public <K> T post(String url, JSONObject jo, Class<K> type, AjaxCallback<K> callback)
{
try
{
StringEntity entity = new StringEntity(jo.toString(), "UTF-8");
return post(url, "application/json", entity, type, callback);
}
catch (UnsupportedEncodingException e)
{
throw new IllegalArgumentException(e);
}
}
开发者ID:libit,项目名称:lr_dialer,代码行数:13,代码来源:AbstractAQuery.java
示例12: put
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public <K> T put(String url, JSONObject jo, Class<K> type, AjaxCallback<K> callback)
{
try
{
StringEntity entity = new StringEntity(jo.toString(), "UTF-8");
return put(url, "application/json", entity, type, callback);
}
catch (UnsupportedEncodingException e)
{
throw new IllegalArgumentException(e);
}
}
开发者ID:libit,项目名称:lr_dialer,代码行数:13,代码来源:AbstractAQuery.java
示例13: sync
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
/**
* Ajax call with that block until response is ready. This method cannot be called on UI thread.
*
* @param callback callback
* @return self
*/
public <K> T sync(AjaxCallback<K> callback)
{
ajax(callback);
callback.block();
return self();
}
开发者ID:libit,项目名称:lr_dialer,代码行数:13,代码来源:AbstractAQuery.java
示例14: checkVersion
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
/**
* Perform a version sync.
*/
public void checkVersion()
{
String url = getQueryUrl();
AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.url(url).type(JSONObject.class).handler(handler, "marketCb").fileCache(!force).expire(expire);
aq.progress(progress).ajax(cb);
}
开发者ID:libit,项目名称:lr_dialer,代码行数:11,代码来源:MarketService.java
示例15: detailCb
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
@SuppressWarnings("unused")
public void detailCb(String url, String html, AjaxStatus status)
{
if (html != null && html.length() > 1000)
{
String qurl = getQueryUrl();
AjaxCallback<JSONObject> cb = new AjaxCallback<JSONObject>();
cb.url(qurl).type(JSONObject.class).handler(this, "marketCb");
cb.param("html", html);
aq.progress(progress).ajax(cb);
}
}
开发者ID:libit,项目名称:lr_dialer,代码行数:13,代码来源:MarketService.java
示例16: request
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public static void request(Context context, final Callback callback) {
new AQuery().ajax("http://" + IP + "/test", MediaListInfo[].class, new AjaxCallback<MediaListInfo[]>() {
@Override
public void callback(String url, MediaListInfo[] object, AjaxStatus status) {
callback.onSuccess(object);
}
});
}
开发者ID:bblue000,项目名称:ExoPlayerDemo,代码行数:9,代码来源:MediaListManager.java
示例17: getUsersPage
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getUsersPage(final Context context, String userId, final SyncResult syncResult) {
AQuery aq = new AQuery(context);
aq.ajax(USERS_URL+userId, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
try {
updateLocalUserData(context,json, syncResult);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:MaxSmile,项目名称:JsonSyncAdapter,代码行数:14,代码来源:UsersSyncHelper.java
示例18: getVideoPage
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getVideoPage(int page,final SyncResult syncResult) {
AQuery aq = new AQuery(getContext());
aq.ajax(VIDEO_URL+"&page="+page, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
try {
VideosSyncHelper.updateLocalVideoData(getContext(), json, syncResult);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:MaxSmile,项目名称:JsonSyncAdapter,代码行数:14,代码来源:SyncAdapter.java
示例19: getAppsPage
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getAppsPage(int page,final SyncResult syncResult) {
AQuery aq = new AQuery(getContext());
aq.ajax(APPS_URL+"&page="+page, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
try {
AppsSyncHelper.updateLocalAppData(getContext(), json, syncResult);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:MaxSmile,项目名称:JsonSyncAdapter,代码行数:14,代码来源:SyncAdapter.java
示例20: getCommentsPage
import com.androidquery.callback.AjaxCallback; //导入依赖的package包/类
public void getCommentsPage(int page,final SyncResult syncResult) {
AQuery aq = new AQuery(getContext());
aq.ajax(COMMENTS_URL+"&page="+page, JSONObject.class, new AjaxCallback<JSONObject>() {
@Override
public void callback(String url, JSONObject json, AjaxStatus status) {
try {
updateLocalCommentData(json, syncResult, CommentObject.getCONTENT_URI(), CommentObject.getProjection());
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
开发者ID:MaxSmile,项目名称:JsonSyncAdapter,代码行数:14,代码来源:SyncAdapter.java
注:本文中的com.androidquery.callback.AjaxCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论