xunice / libs-for-android Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/libs-for-android
License: Apache License 2.0
Automatically exported from code.google.com/p/libs-for-android
License: Apache License 2.0
What steps will reproduce the problem?
1.Array with 200-400 images midle quality
2. Fast scrolling top/down
3. Crash with outOfMemory
What is the expected output? What do you see instead?
Crash outOfMemory exception
What version of the product are you using? On what operating system?
Latest
Please provide any additional information below.
It reproduce on slowly devices and emulators, If the user behaves like a monkey.
Original issue reported on code.google.com by istin2007
on 21 Mar 2011 at 11:16
What steps will reproduce the problem?
1. Use file-cache and image-loader together for image cache
new ImageLoader(HttpResponseCache.capture(new BitmapContentHandler(), null),
HttpResponseCache.capture(HttpResponseCache.sink(), null));
public class HttpResponseCache extends FileResponseCache {
@Override protected File getFile(final URI uri, final String requestMethod, final Map<String, List<String>> requestHeaders, final Object cookie) {
...
}
public static void install(final Context context) {
...
}
}
2. Cache an image when online
3. Go offline and the cached image could not be loaded.
What is the expected output? What do you see instead?
The cached image should be loaded as expected for file-cache, but there's an
inconsistent behavior between file-cache and HttpEngine that caused HttpEngine
incorrectly identified the cache as unavailable.
What version of the product are you using? On what operating system?
Android 4.0.4.
[Workaround]
Explicitly add an null entry in response header to fulfill the expectation of
HttpEngine about status line:
public class HttpResponseCache extends FileResponseCache {
...
@Override public CacheResponse get(final URI uri, final String requestMethod, final Map<String, List<String>> requestHeaders) throws IOException {
final CacheResponse response = super.get(uri, requestMethod, requestHeaders);
if (response == null) return null;
/* Workaround for HttpEgnine to correctly identify cache source */
final Map<String, List<String>> headers = response.getHeaders();
final List<String> status = headers.get("status");
status.set(0, "HTTP/1.0 " + status.get(0));
headers.put(null, status);
return response;
}
}
Original issue reported on code.google.com by oasisfeng
on 4 Jun 2012 at 10:11
When binding to multiple ImageViews within a BaseAdapter, ImageLoader will
throw a NullPointerException if another activity is loaded over the current one
when async bind requests are still pending.
What steps will reproduce the problem?
1. Request to bind a number of remote images to ImageViews within a BaseAdapter
2. Load another activity on top before all requested images have finished
loading
3. Boom goes the dynamite
What is the expected output? What do you see instead?
A different activity loaded on top of the previous one, which was utilizing
ImageLoader on a ListView. Instead, get a NullPointer of app-death.
What version of the product are you using? On what operating system?
SDK Tools 11, targeting 1.6. Not sure which version of ImageLoader, but it was
the most recent version no earlier than a month ago.
Please provide any additional information below.
Thread [<1> main] (Suspended (exception NullPointerException))
ListView.layoutChildren() line: 1662
ListView(AbsListView).onLayout(boolean, int, int, int, int) line: 1147
ListView(View).layout(int, int, int, int) line: 7035
FrameLayout.onLayout(boolean, int, int, int, int) line: 333
FrameLayout(View).layout(int, int, int, int) line: 7035
ActionBarHost(LinearLayout).setChildFrame(View, int, int, int, int) line: 1249
ActionBarHost(LinearLayout).layoutVertical() line: 1125
ActionBarHost(LinearLayout).onLayout(boolean, int, int, int, int) line: 1042
ActionBarHost(View).layout(int, int, int, int) line: 7035
FrameLayout.onLayout(boolean, int, int, int, int) line: 333
FrameLayout(View).layout(int, int, int, int) line: 7035
PhoneWindow$DecorView(FrameLayout).onLayout(boolean, int, int, int, int) line: 333
PhoneWindow$DecorView(View).layout(int, int, int, int) line: 7035
ViewRoot.performTraversals() line: 1045
ViewRoot.handleMessage(Message) line: 1727
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]
Original issue reported on code.google.com by [email protected]
on 11 Jul 2011 at 6:05
ImageLoader bind method currently has an overload which takes a BaseAdapter.
Unfortunately as BaseExpandableListAdapter doesn't inherit from BaseAdapter
this method can't be used with ExpandableListViews.
It would be great if this functionality could be added (I couldn't work out
how to put this in as an enhancement rather than a defect)
Original issue reported on code.google.com by [email protected]
on 9 Jun 2011 at 10:23
HtmlView.ImageTask does not use ResponseCache support in HttpURLConnection. I
cannot find any way to activate the file cache for HtmlView outside lib code.
Maybe just adding HttpURLConnection.setUseCaches(true) is good enough?
Original issue reported on code.google.com by oasisfeng
on 5 Jun 2012 at 6:21
What steps will reproduce the problem?
1. Create HtmlView and get HTML data.
2. Call setHtml() with the data.
3. Call Linkify.addLinks(htmlView, Linkify.ALL).
What is the expected output? What do you see instead?
The expected output is that URLs found in the HTML data are converted into
clickable links. Instead, I only see phone numbers picked up, but haven't tried
with email addresses or maps.
What version of the product are you using? On what operating system?
Commit 3cd5a7 on Dec 9, 2011. Testing on Galaxy Nexus (running stock 4.0.4).
Please provide any additional information below.
The "linksClickable" attribute found in TextViews does not appear to exist for
HtmlViews, which could be a cause for the problem.
Original issue reported on code.google.com by [email protected]
on 23 May 2012 at 9:47
What steps will reproduce the problem?
1. Make multiple requests for the same URL before the first request completes.
2. Observe network traffic.
3. The image is redundantly fetched over the network multiple times.
What is the expected output? What do you see instead?
Making multiple requests for the same item should result in a single fetch over
the network.
What version of the product are you using? On what operating system?
Unknown - no version information in jar.
Running on various Android versions from 2.3 to 4.2.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 5 Feb 2013 at 11:37
It would be great if ImageLoader could work with a drawable in the same way it
works with ImageViews.
This would allow it to be used with the Html.ImageGetter interface which is
used by the Html.fromHtml() method to render inline images and is currently
pretty difficult to use with remote images.
I imagine it would involve creating some sort of delayedLoadDrawable which
could then be passed to the ImageLoader to bind asynchronously and returned
from ImageGetter.getDrawable(). Once the ImageLoader retrieves the image it
could then update the drawable.
Original issue reported on code.google.com by [email protected]
on 16 Jun 2011 at 8:31
The git repository includes a jar for Android 2.2. Can I use filecache in lower
versions of Android, such as 1.6?
Original issue reported on code.google.com by [email protected]
on 1 Mar 2011 at 3:42
in com.google.android.demos.jamendo.app.JamendoApp
// 50% of available memory, up to a maximum of 32MB
private static final long IMAGE_CACHE_SIZE =
Math.max(Runtime.getRuntime().maxMemory() / 2,
32 * 1024 * 1024);
x Math.max => o Math.min
Original issue reported on code.google.com by [email protected]
on 30 Jul 2011 at 1:27
What steps will reproduce the problem?
1. Set a callback on bind
2. Image has been previously loaded and cached
3. onImageLoaded never gets called
What is the expected output? What do you see instead?
Callback to be called
What version of the product are you using? On what operating system?
Latest
Please provide any additional information below.
Line 524 add:
if(callback != null) {
callback.onImageLoaded(view, url);
}
Original issue reported on code.google.com by [email protected]
on 9 Dec 2011 at 5:37
It is really useful to get a callback from the prefetch() method to let you
know when it has completed successfully or encountered an error.
I patched my copy of the ImageLoader class to support this, so I've attached it
in case you want to include this functionality in the library.
Original issue reported on code.google.com by [email protected]
on 7 Jul 2011 at 11:06
Attachments:
What steps will reproduce the problem?
1. Try to load lots of previously cached images in a ListView by quickly
scrolling back and forth
2. Some images will fail to load
What is the expected output? What do you see instead?
Files (in this case bitmaps) should be read from cache, but instead we get an
EOFException like the following:
05-23 15:52:41.540: E/ImageLoader(32059): java.io.EOFException
05-23 15:52:41.540: E/ImageLoader(32059): at
libcore.io.Streams.readAsciiLine(Streams.java:203)
05-23 15:52:41.540: E/ImageLoader(32059): at
libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:547)
05-23 15:52:41.540: E/ImageLoader(32059): at
libcore.net.http.HttpEngine.readResponse(HttpEngine.java:787)
05-23 15:52:41.540: E/ImageLoader(32059): at
libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:27
4)
05-23 15:52:41.540: E/ImageLoader(32059): at
libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java
:168)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.BitmapContentHandler.getContent(BitmapContentHand
ler.java:39)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.BitmapContentHandler.getContent(BitmapContentHand
ler.java:1)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.filecache.FileResponseCache$FileResponseCacheContentHandler.g
etContent(FileResponseCache.java:546)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.ImageLoader$ImageRequest.loadImage(ImageLoader.ja
va:763)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.ImageLoader$ImageRequest.execute(ImageLoader.java
:798)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.ImageLoader$ImageTask.doInBackground(ImageLoader.
java:992)
05-23 15:52:41.540: E/ImageLoader(32059): at
com.google.android.imageloader.ImageLoader$ImageTask.doInBackground(ImageLoader.
java:1)
05-23 15:52:41.540: E/ImageLoader(32059): at
android.os.AsyncTask$2.call(AsyncTask.java:264)
05-23 15:52:41.540: E/ImageLoader(32059): at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-23 15:52:41.540: E/ImageLoader(32059): at
java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-23 15:52:41.540: E/ImageLoader(32059): at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-23 15:52:41.540: E/ImageLoader(32059): at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-23 15:52:41.540: E/ImageLoader(32059): at
java.lang.Thread.run(Thread.java:864)
It appears that the same problem occurs with not just bitmaps but also any
other file.
Original issue reported on code.google.com by [email protected]
on 23 May 2012 at 7:53
What steps will reproduce the problem?
This is not always reproduceable.
1. Open up an Activity that has an HtmlView in its layout. The HtmlView should
load up a page that has links.
2. Click on a link within the html page that opens up the Android browser.
3. Perform an orientation change of the device.
4. While still with a changed orientation, press back to exit the browser and
return to the original Activity. The error may sometimes appear.
What is the expected output? What do you see instead?
The original Activity should reappear. Instead I see a force close.
What version of the product are you using? On what operating system?
Android ICS
Please provide any additional information below.
Here is the stack trace:
05-25 01:26:43.200: E/Parcel(6947): Class not found when unmarshalling:
com.google.android.htmlwidget.HtmlView$SavedState, e:
java.lang.ClassNotFoundException:
com.google.android.htmlwidget.HtmlView$SavedState
05-25 01:26:43.200: D/AndroidRuntime(6947): Shutting down VM
05-25 01:26:43.200: W/dalvikvm(6947): threadid=1: thread exiting with uncaught
exception (group=0x40a59228)
05-25 01:26:43.210: E/AndroidRuntime(6947): FATAL EXCEPTION: main
05-25 01:26:43.210: E/AndroidRuntime(6947): android.os.BadParcelableException:
ClassNotFoundException when unmarshalling:
com.google.android.htmlwidget.HtmlView$SavedState
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readParcelable(Parcel.java:1971)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readValue(Parcel.java:1859)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readSparseArrayInternal(Parcel.java:2128)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readSparseArray(Parcel.java:1581)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readValue(Parcel.java:1916)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Parcel.readMapInternal(Parcel.java:2099)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Bundle.unparcel(Bundle.java:223)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.os.Bundle.getSparseParcelableArray(Bundle.java:1225)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:805)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080
)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.ja
va:1416)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentMa
nager.java:431)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePager
Adapter.java:160)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.view.ViewPager.populate(ViewPager.java:804)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.view.ViewPager.dataSetChanged(ViewPager.java:714)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.support.v4.view.ViewPager$PagerObserver.onChanged(ViewPager.java:2060)
05-25 01:26:43.210: E/AndroidRuntime(6947): at
android.database.DataSetObservable.notifyChanged(DataSetObservable.java:35)
Original issue reported on code.google.com by [email protected]
on 24 May 2012 at 5:33
What steps will reproduce the problem?
1. Create many ImageViews (more than the task limit).
2. Use an ImageLoader to bind each of them to different URLs.
3. Wait.
What is the expected output? What do you see instead?
In older versions of ImageLoader (somewhere pre-r125), all of the ImageViews
would eventually load or error out using the ErrorCallback.
In the newest version, a few images get loaded or error and the rest never
finish or call either callback.
What version of the product are you using? On what operating system?
Latest SVN version (r153) on Android 2.2.
Please provide any additional information below.
It looks like the thread/queue handling was redone in r125, and I don't think
the new code works when binding many ImageViews in quick succession.
ImageRequest.execute() has a check to see if mCallbackRef is still valid, and
short-circuits if not. However, this WeakReference is to an ImageViewCallback
created during the ImageRequest constructor, which clearly has no strong
references, so of course it will get garbage collected. When only a few
ImageViews are bound at a time, the execution beats the garbage collector and
works fine. Or, in my case, when many ImageViews are bound, the first few
succeed. After that, the ImageViewCallbacks get GCed, and the execution of the
remaining tasks gets aborted.
I assume the initial intention of this check was actually for a weak reference
to the ImageView or Callback itself to see if they had been GCed, but creating
a weak reference to a new object that points at them doesn't work. Changing
mCallbackRef to a normal reference fixes this issue completely.
Original issue reported on code.google.com by [email protected]
on 16 Jun 2011 at 1:54
What steps will reproduce the problem?
1. Mixing FileResponseCache with other users of java.net.ResponseCache
2. The foreign UrlConnection class (that does not extend HttpUrlConnection)
opens a connection and then invokes responseCache.put(uri, this)
3. FileResponseCache#isCacheable throws a class cast exception
What is the expected output? What do you see instead?
The #put() method should return null if it doesn't want to cache non-http urls. There is an unchecked cast there.
What version of the product are you using? On what operating system?
Revision 132 of filecache.jar
Original issue reported on code.google.com by [email protected]
on 21 Mar 2011 at 12:07
I haven't managed to consistently reproduce this I'm afraid but here is the
stack trace:
java.util.NoSuchElementException
at java.util.LinkedList.removeFirstImpl(LinkedList.java:690)
at java.util.LinkedList.removeFirst(LinkedList.java:677)
at java.util.LinkedList.poll(LinkedList.java:896)
at
com.google.android.imageloader.ImageLoader.flushRequests(ImageLoader.java:384)
at
com.google.android.imageloader.ImageLoader$ImageTask.onPostExecute(ImageLoader.j
ava:916)
at
com.google.android.imageloader.ImageLoader$ImageTask.onPostExecute(ImageLoader.j
ava:859)
at android.os.AsyncTask.finish(AsyncTask.java:417)
at android.os.AsyncTask.access$300(AsyncTask.java:127)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
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:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Original issue reported on code.google.com by [email protected]
on 14 Jun 2011 at 3:07
Could you publish the libs-for-android jars in a Maven repository?
I've attached a pom.xml file that you could use to do this, but it's very rough.
Original issue reported on code.google.com by [email protected]
on 17 Mar 2011 at 6:05
Attachments:
What steps will reproduce the problem?
Scrolling in list view with decent number of binded ImageViews is not so
smooth; probably because of synchronous bitmap loading from cache files.
Could you please enhance the library to use async tasks for cache loading too.
Original issue reported on code.google.com by [email protected]
on 19 Mar 2012 at 3:37
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.