Welcome to the androidquery GitHub home.
Click here for wiki at GoogleCode or visit: http://code.google.com/p/android-query/wiki/AsyncAPI
AndroidQuery
Home Page: http://code.google.com/p/android-query/
Welcome to the androidquery GitHub home.
Click here for wiki at GoogleCode or visit: http://code.google.com/p/android-query/wiki/AsyncAPI
targetWidth options are ignored when we request multiple image downloads simultaneously.
For example, we requests following 3 image downloads simultaneously.
request#1: url=https://www.google.com/images/srpr/logo3w.png, targetWidth=20
request#2: url=https://www.google.com/images/srpr/logo3w.png, targetWidth=0
request#3: url=https://www.google.com/images/srpr/logo3w.png, targetWidth=10
These all requests show same image whose width is 20.
Maybe the cause of this is that multiple requests arranged as one requests. In BitmapAjaxCallback.java,
if(!queueMap.containsKey(url)){
addQueue(url, v);
super.async(v.getContext());
}else{
showProgress(true);
addQueue(url, v);
}
Hi,
This is not an issue but a feature request.
Is it possible to write a shouldDelay
method that take a file or a path instead of an url in order to load asynchronously an image that has not be cached by AQUery before ?
For exemple, I'm writing an app where I download myself a .zip containing images. Then I save them in a folder in the sdcard and I want to display them in a list/gridview with the benefits of the shouldDelay
method.
Thanks again for this awesome lib, I use it a lot in Traktoid : https://github.com/florianmski/Traktoid
A service I am calling returns status code 422 for invalid login (wrong password, etc)
However, it still returns a valid JSON response along with it, which includes error messages.
AjaxCallback does'nt seem to return the JSON in that case
I see this in the source:
if(code < 200 || code >= 300)
On google code site, in download section the newest version is 0.26.8, but in source code there's still 0.25.9.
Don't know what kind of version is in sonatype repository and / or maven central but version should be fixed.
Thanks
if the user quits the view or clicked [x] something one might want to abort ajax
http://stackoverflow.com/questions/18152055/how-to-abort-ajax-query-in-android-query
https://androidquery.appspot.com/api/market response has wrong korean translation.
"title" : "Update Notice" need to be "title" : "새로운 기능"
btw, any plan to open source appspop's code?
Is it possible to add image transparency because when I load a transparent gif from the web the transparent part is white, this happens on devices with Android 4.4. Code used:
AQuery aq = new AQuery(view);
Bitmap preset = aq.getCachedImage(url);
if (preset != null)
view.setImageBitmap(preset);
else
aq.id(view).image(url, true, true);
More details and attachments here:
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Expect ah is not null, but ah is null
What version of the product are you using? On what operating system
Release 0.25.8
Please provide any additional information below.
AbstractAjaxCallback 's ah is set to AbstractAQuery's ah in AbstractAQuery's invoke() function.
Hello
When the server send status code other than 200, the body always null!
for example:
<?php
header("HTTP/1.1 433 OK");
$response = array();
$response['key'] = 'value';
echo json_encode($response);
?>
In AQuery, this will show status code 433 but the body is null!
Could you please help in this?
Thank you.
I am looking for solution for enabling holding cookie using Android Query (not native Android HTTPClient).
If I'm getting cookie information from first request, how to use it in other requests?
Here I described my problem with more details:
http://stackoverflow.com/questions/20786545/set-cookie-using-adroid-query-ajaxcallback
I know that, many people has this issue, and I also saw that there is issue about it on Google Project page, without solution. I mean this 2:
http://code.google.com/p/android-query/issues/detail?id=94
http://code.google.com/p/android-query/issues/detail?id=28
It would be nice to have persisted session on default, same as browsers has.
I would like to add a boolean method like isVisible() like
[code]return view != null && view.getVisibility() == View.VISIBILE[/code]
This would be extremely useful for developers like in Android when they have to check portrait and landscape specific view.
Hello and thanks for your library! :-)
How can I load and cache an image to receive a bitmap in a callback without necessity to point an AQuery instance to some ImageView?
E.g. you may want to download and cache an image to set it as a compound drawable for some TextView (like drawableLeft).
Actually you have to use a fake ImageView something like:
mAq.id(new ImageView(getActivity())).image(mSetAvatarCallback);
// set the loaded and cached bitmap as a compound drawable in the callback
instead of a simpler and cleaner one:
mAq.image(mSetAvatarCallback);
Thanks
If I want to send a multi-part form request, I have to pass a file, sometimes the file is just optional, this is not supported in the library.
Release Notes have 0.25.7 BETA info,but I can't find code google dowloads .
Method
AbstractAjaxCallback#transform( String, byte[], AjaxStatus )
should give chance to custom Transformer before all other transformations, since it's most logical and probably correct way to handle custom things, even if we want to use "output" type already covered with your code.
I suggest that you move lines
702-704:
if(transformer != null){
return transformer.transform(url, type, encoding, data, status);
}
in front of other checks, somewhere around line 631.
If I have more than one image in listview row, first image's progress dialog get hidden as expected but others still show after images loaded.
Progress bar indication goes wrong when AQuery downloads big size file.
In Progress.java, line 94
p = (10000 * current) / bytes;
The result of (10000 * current) has the potential to become greater than Integer.MAX_VALUE.
I receive this stacktrace from my app on Google Play. Lib ver 0.21.5
java.lang.NullPointerException
at com.androidquery.callback.LocationAjaxCallback.stop(LocationAjaxCallback.java:206)
at com.androidquery.callback.LocationAjaxCallback.check(LocationAjaxCallback.java:107)
at com.androidquery.callback.LocationAjaxCallback.access$0(LocationAjaxCallback.java:85)
at com.androidquery.callback.LocationAjaxCallback$Listener.onLocationChanged(LocationAjaxCallback.java:283)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:227)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:160)
at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:183)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
So there are 2 policies:
public static final int CACHE_DEFAULT = 0;
public static final int CACHE_PERSISTENT = 1;
I added 1 more:
public static final int CACHE_TEMPORARY = 2;
AQuery works little different than I was expecting. Expiry parameter of ajax() means only that file should be fetched from the Internet when it expired. It is not removed from the disk when it expired. (IMHO it's and error) Files are removed based on the last time they were used only.
my CACHE_TEMPORARY causes every file downloaded with this policy to be removed as soon as AQUtility.cleanCacheAsync() is invoked, regardless of cache trigger parameters. I use it for downloading huge, short living bitmaps.
Example usage:
AjaxCallback cbBmp = new AjaxCallbackLoadingBitmap();
cbBmp.url(url).showLowQualityImages(true).type(Bitmap.class)
.header("User-Agent", getUserAgent().fileCache(true).memCache(false).policy(AQuery.CACHE_TEMPORARY);
aq.ajax(cbBmp);
showLowQualityImages(true) is another parameter, which I added here:
Malachiasz@504fd08
It adds support of Config.ARGB_4444 bitmaps. It's useful when we're tight on memory.
(http://stackoverflow.com/a/8527745/2075875)
I am calling an API that requires sending parameters in the body of a HTTP DELETE method, however, it seems AQuery does not provide an overload that allows me to do this.
I don't control the API so I can't change the server side.
I notice that there already have a getClient function been created in recent release, if aq provide interface to inject httpClient, we could easily take the advantage to utilize for example okhttp lib , it's not a big change, isn't it?
I have a problem while using cached Images as preset.
Bitmap cached = aq.getCachedImage(url, 0);
if(cached != null){
aq.id(view).image(url, true, true, 0, R.drawable.no_image, cached, 0);
}
The error message
"resolveUri failed on bad bitmap uri: http://farm5.staticflickr.com/.....jpg"
is printed by the ImageView. I dont know why but the ImageView want to load the Drawable by his Uri by calling "resolveUri". But the Uri is set tu the Url of the original image and not to the filesystem.
If the server returns an empty body (as in a 204 response), AQuery hits a NPE trying to get the length of the response.
To reproduce, make any request that returns only a head, but no body. It fails on the line int size = Math.max(32, Math.min(1024 * 64, (int) entity.getContentLength()));
in httpDo()
.
it's would be a widely used functionality be used, esp. in China. picture (or any large size file) download only allowed in wifi(or 3G ) enviorment, and of course, this is a option user can choose. this would be a functions without any dependency. good to have.
I need use typeface with my TextView, anything like
aq.id().typeFace("myFont.ttf"); would be great :-)
I have already post this issue on google code repo , I don't know where it's better :-s
It used to detect when a new version has been uploaded but not anymore. it hasn't showed the update dialog in my app for a few months now.
This is how the code n my app looks and has always been the same:
protected void onCreate(Bundle savedInstanceState) {
....
MarketService ms = new MarketService(this);
ms.level(MarketService.MINOR).checkVersion();
}
In AbstractAjaxCallback.httpMulti() is not using AbstractAjaxCallback.ssf and as the result, it's impossible to uploade file to https-server with self-signed certificate.
What steps will reproduce the problem?
What is the expected output? What do you see instead?
No exception.
What version of the product are you using? On what operating system?
android-query-full.0.25.10.jar
android 4.2.2
Please provide any additional information below.
E/AndroidRuntime(31589): FATAL EXCEPTION: main
E/AndroidRuntime(31589): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
E/AndroidRuntime(31589): at com.androidquery.auth.FacebookHandle.decodeUrl(FacebookHandle.java:352)
E/AndroidRuntime(31589): at com.androidquery.auth.FacebookHandle.parseUrl(FacebookHandle.java:363)
E/AndroidRuntime(31589): at com.androidquery.auth.FacebookHandle.access$0(FacebookHandle.java:359)
E/AndroidRuntime(31589): at com.androidquery.auth.FacebookHandle$FbWebViewClient.checkDone(FacebookHandle.java:240)
E/AndroidRuntime(31589): at com.androidquery.auth.FacebookHandle$FbWebViewClient.shouldOverrideUrlLoading(FacebookHandle.java:277)
E/AndroidRuntime(31589): at com.androidquery.WebDialog$DialogWebViewClient.shouldOverrideUrlLoading(WebDialog.java:158)
E/AndroidRuntime(31589): at android.webkit.CallbackProxy.uiOverrideUrlLoading(CallbackProxy.java:270)
E/AndroidRuntime(31589): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:377)
E/AndroidRuntime(31589): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(31589): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(31589): at android.app.ActivityThread.main(ActivityThread.java:5195)
E/AndroidRuntime(31589): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(31589): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(31589): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime(31589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
E/AndroidRuntime(31589): at dalvik.system.NativeStart.main(Native Method)
It would be nice to have in
public synchronized void callback(String url, Bitmap bitmap, AjaxStatus status) {
status, an option to save to cache under given url editet version. Now it's possible only to invalidate.
For example I load bitmap and want to resize it in callback (in callback, because I need to know image size) and save to cache in order for resizing to be unnecessery next time
Suggestion:
in function AbstractAjaxCallback#copy, there shuold catch exception and remove incomplete cache file
Is there any way to generate CURL from androidquery request?
I write this methods but over dirty hack with public static in InmageOptions...
Pls^ take a look if you have time may you implement this code in right way
Thank you
Hi, is it possible to get the status of a download as a float? or int between 0 and 100?
Didnt found any way... and .progress(R.id.progress) just hides the progressbar after loading... no percentage... please help.
Edit:
I don't want to have a Dialog, i just want to show the user, that ist 12% at the moment.
Aquery v0.22.10
in list adapter:
AQuery aq = listAq.recycle(convertView);
Bitmap placeholder = aq.getCachedImage(R.drawable.image_ph);
returns NullPointerException.
For avoiding it i need to use smth like
aq.id(R.id.name).text(photo.title);
after recycle method. But it doesnot make sence if i need only async Image loading in this adapter.
Full stack trace:
08-05 14:40:11.513: ERROR/AndroidRuntime(9947): FATAL EXCEPTION: main
java.lang.NullPointerException
at com.androidquery.callback.BitmapAjaxCallback.getMemoryCached(BitmapAjaxCallback.java:384)
at com.androidquery.AbstractAQuery.getCachedImage(AbstractAQuery.java:2030)
at fm.soundtracker.ui.AsyncItemAdapter.getView(AsyncItemAdapter.java:47)
at android.widget.AbsListView.obtainView(AbsListView.java:2040)
at android.widget.GridView.onMeasure(GridView.java:1041)
at android.view.View.measure(View.java:12881)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:599)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:381)
at android.view.View.measure(View.java:12881)
Sometime,when I check version app in google play Its not correct version code
06-18 10:55:05.577: W/AQuery(15656): version:1.6->1.7:8->8
version name is right but version code is must be 9., I don't know why.may be cached?
Would you tell me how to resolved it?
thank for your help
I found progress Bar can show current progress,but I want to get current progress value and set the text, How Can I do it?
As far as the docs are concerned, GET & POST are supported, is there support for PUT & DELETE?
HttpURLConnection requires only two properties.
conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("Content-Type", "multipart/form-data;charset=utf-8;boundary="+ boundary);
Headers passed by parameter should be contained.
When I get latest from master at GitHub, I end up with 25.10 after compiling and building. But the downloads section has version 26.7. Where do I get the source code for version 26.7?
When loading an image for an imageview from the network, the fallback image is not being shown if the url parameter was null. It is being shown if the url is "".
How would one send raw POST data via Android Query? (ie: raw json, without a requisite parameter name)
I want to do something like AjaxCallback.setNumberRetries() but I can't find anything like that.
Is it possible to set a value so that all ajaxcallback instances have that value without having to set in each individually?
Hi,
I'd like to reference your library from a Maven-compatible repository. Do you have any plans to upload each version to Maven Central or another OSS repo?
Thanks,
Ben
the error occurs in Eclipse IDE in the file "AbstractAQuery.java" in line 115
the mentioned code is:
"
result.act = act;
"
Is there any way to use ARG_4444 or any other non 8888 option? I haven't seen a way to do it.
Thanks.
Hi Peter,
there are missing brackets in the If-condition in the private Method httpDo. So you will get an NullPointerException iff header is null.
private void httpDo(...)
...
- if(GZIP && headers == null || !headers.containsKey("Accept-Encoding")){
+ if(GZIP && (headers == null || !headers.containsKey("Accept-Encoding"))){
regards,
David
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.