本文整理汇总了Java中com.androidquery.util.AQUtility.debug方法的典型用法代码示例。如果您正苦于以下问题:Java AQUtility.debug方法的具体用法?Java AQUtility.debug怎么用?Java AQUtility.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.androidquery.util.AQUtility
的用法示例。
在下文中一共展示了AQUtility.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClient
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private static DefaultHttpClient getClient()
{
if (client == null || !REUSE_CLIENT)
{
AQUtility.debug("creating http client");
HttpParams httpParams = new BasicHttpParams();
//httpParams.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
HttpConnectionParams.setConnectionTimeout(httpParams, NET_TIMEOUT);
HttpConnectionParams.setSoTimeout(httpParams, NET_TIMEOUT);
//ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new ConnPerRouteBean(NETWORK_POOL));
ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new ConnPerRouteBean(25));
//Added this line to avoid issue at: http://stackoverflow.com/questions/5358014/android-httpclient-oom-on-4g-lte-htc-thunderbolt
HttpConnectionParams.setSocketBufferSize(httpParams, 8192);
SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
registry.register(new Scheme("https", ssf == null ? SSLSocketFactory.getSocketFactory() : ssf, 443));
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager(httpParams, registry);
client = new DefaultHttpClient(cm, httpParams);
}
return client;
}
示例2: expired
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
@Override
public boolean expired(AbstractAjaxCallback<?, ?> cb, AjaxStatus status)
{
int code = status.getCode();
if (code == 200)
return false;
String error = status.getError();
if (error != null && error.contains("OAuthException"))
{
AQUtility.debug("fb token expired");
return true;
}
String url = cb.getUrl();
if (code == 400 && (url.endsWith("/likes") || url.endsWith("/comments") || url.endsWith("/checkins")))
{
return false;
}
if (code == 403 && (url.endsWith("/feed") || url.contains("method=delete")))
{
return false;
}
return code == 400 || code == 401 || code == 403;
}
示例3: work
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private void work()
{
Location loc = getBestLocation();
Timer timer = new Timer(false);
if (networkEnabled)
{
AQUtility.debug("register net");
networkListener = new Listener();
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, interval, 0, networkListener, Looper.getMainLooper());
timer.schedule(networkListener, timeout);
}
if (gpsEnabled)
{
AQUtility.debug("register gps");
gpsListener = new Listener();
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, interval, 0, gpsListener, Looper.getMainLooper());
timer.schedule(gpsListener, timeout);
}
if (iteration > 1 && loc != null)
{
n++;
callback(loc);
}
initTime = System.currentTimeMillis();
}
示例4: fileGet
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected T fileGet(String url, File file, AjaxStatus status) {
try {
byte[] data = null;
if (isStreamingContent()) {
status.file(file);
} else {
data = AQUtility.toBytes(new FileInputStream(file));
}
return transform(url, data, status);
} catch (Exception e) {
AQUtility.debug(e);
return null;
}
}
示例5: async
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
/**
* Starts the async process.
*
* @param context the context
*/
public void async(Context context) {
if (status == null) {
status = new AjaxStatus();
status.redirect(url).refresh(refresh);
} else if (status.getDone()) {
status.reset();
result = null;
}
showProgress(true);
if (ah != null) {
if (!ah.authenticated()) {
AQUtility.debug("auth needed", url);
ah.auth(this);
return;
}
}
work(context);
}
示例6: doInBackground
import com.androidquery.util.AQUtility; //导入方法依赖的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;
}
示例7: add2list
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
public void add2list(String artist,String yearS,String trackS,String title,String album,String composer,
String path,String folder, long lastModified,String filename,int duration,int albumId){
int year = 0;
int track = 0;
try {
if (!yearS.equals("")) {
if (yearS.length()>3) {
yearS = yearS.substring(0,4);
}
year = Integer.parseInt(yearS.replaceAll("[^\\d.]", ""));
}
if (!trackS.equals(""))
track = Integer.parseInt(trackS.replaceAll("[^\\d.]", ""));
} catch (Exception e) {AQUtility.debug(e.toString());}
allTracks.add(new Track(
artist.equals("") ?"unknown": StringUtils.capitalizeFully(artist),
title.equals("") ?filename:StringUtils.capitalizeFully(title),
album,
composer,
year,
track,
duration,
path,
folder,
lastModified,
albumId));
}
示例8: setScrollListener
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private Common setScrollListener()
{
AbsListView lv = (AbsListView) view;
Common common = (Common) lv.getTag(AQuery.TAG_SCROLL_LISTENER);
if (common == null)
{
common = new Common();
lv.setOnScrollListener(common);
lv.setTag(AQuery.TAG_SCROLL_LISTENER, common);
AQUtility.debug("set scroll listenr");
}
return common;
}
示例9: makeSharedFile
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
/**
* Create a temporary file on EXTERNAL storage (sdcard) that holds the cached content of the url.
* Returns null if url is not cached, or the system cannot create such file (sdcard is absent, such as in emulator).
* <p/>
* The returned file is accessable to all apps, therefore it is ideal for sharing content (such as photo) via the intent mechanism.
* <p/>
* <br>
* <br>
* Example Usage:
* <p/>
* <pre>
* Intent intent = new Intent(Intent.ACTION_SEND);
* intent.setType("image/jpeg");
* intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
* startActivityForResult(Intent.createChooser(intent, "Share via:"), 0);
* </pre>
* <p/>
* <br>
* The temp file will be deleted when AQUtility.cleanCacheAsync is invoked, or the file can be explicitly deleted after use.
*
* @param url The url of the desired cached content.
* @param filename The desired file name, which might be used by other apps to describe the content, such as an email attachment.
* @return temp file
*/
public File makeSharedFile(String url, String filename)
{
File file = null;
try
{
File cached = getCachedFile(url);
if (cached != null)
{
File temp = AQUtility.getTempDir();
if (temp != null)
{
file = new File(temp, filename);
file.createNewFile();
FileInputStream fis = new FileInputStream(cached);
FileOutputStream fos = new FileOutputStream(file);
FileChannel ic = fis.getChannel();
FileChannel oc = fos.getChannel();
try
{
ic.transferTo(0, ic.size(), oc);
}
finally
{
AQUtility.close(fis);
AQUtility.close(fos);
AQUtility.close(ic);
AQUtility.close(oc);
}
}
}
}
catch (Exception e)
{
AQUtility.debug(e);
}
return file;
}
示例10: onClick
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
@Override
public void onClick(DialogInterface dialog, int which)
{
Account acc = accs[which];
AQUtility.debug("acc", acc.name);
setActiveAccount(act, acc.name);
auth(acc);
}
示例11: httpDelete
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private void httpDelete(String url, AjaxStatus status) throws IOException
{
AQUtility.debug("get", url);
url = patchUrl(url);
HttpDelete del = new HttpDelete(url);
httpDo(del, url, status);
}
示例12: hide
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private void hide()
{
if (dialog != null)
{
try
{
dialog.hide();
}
catch (Exception e)
{
AQUtility.debug(e);
}
}
}
示例13: auth
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected void auth()
{
if (act.isFinishing())
return;
boolean ok = sso();
AQUtility.debug("authing", ok);
if (!ok)
{
webAuth();
}
}
示例14: extractToken
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
private String extractToken(String url)
{
Uri uri = Uri.parse(url.replace('#', '?'));
String token = uri.getQueryParameter("access_token");
AQUtility.debug("token", token);
return token;
}
示例15: reauth
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
@Override
public boolean reauth(final AbstractAjaxCallback<?, ?> cb)
{
AQUtility.debug("reauth requested");
token = null;
AQUtility.post(new Runnable()
{
@Override
public void run()
{
auth(cb);
}
});
return false;
}