Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Should i use AsyncTask to load and scale photos from external storage? or there is easier way to do it? Main reason why im trying to do this is becouse im getting lag when scrolling my listview. Im displaying and scaling photos using its path.
Yes.
It can be a long running task if the photo has a lot of detail. Be careful when dealing with detailed photos on Android, you can run out of memory.
Use the Async Task or Thread to process the photos, but keep the user notified at all times, with a progress bar or notification.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Basically I have an old RecyclerView with an Adapter that uses the Cursor directly. As far as I understand it, this isn't ideal because any time I do a Cursor operation like moveToNext() or similar, it performs disk IO, right? and that is happening on the UI thread.
So what is the recommended way for me to implement an infinite (basically keep loading items as the user scrolls) RecyclerView with ContentResolver to display videos or images stored on the phone?
Thanks.
I think that Jetpack's Paging library could be a good solution. As you found yourself it is possible to use it with a ContentProvider
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Whats the threshold to move code execution to a background thread (asynctask, services, threads etcc) in Android ?
Say if we know a task will complete in 50 milliseconds, should we offload it to background ?
What is the limit ?
The official documentation Keep your app responsive says:
Generally, 100 to 200ms is the threshold beyond which users will
perceive slowness in an application.
But it also depends on what you are doing on the screen. The screen is refresh at 60Hz (16.6ms), which can be a problem if you are playing an animation.
They also gives many advices to fix this issues on the ANR Documentation
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am not very good at Android development and need some help here.
My application uses listview in which each row contains an image which is to be loaded from the server. What I want is:
The images should be loaded in the order of their position on the listview.
The images should be cached until the user closes the application.
Until the image is not loaded, a default image should be used.
All of this should be Asynchronous.
Is there a library which could help me with this ?
Any help would be appreciated. Thanks.
Here's a very easy and straight forward tutorial for your problem.
Using UIL Library to handle your images
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Many heavy games have a loading splash screen before the game starts. I wonder, what does a load page actually load (so maybe I can use such an optimization in my app)? Are they loading images? If they are then memory will run out quickly.
Thank you
Loading pics, deserializing data, requesting data from db... it depends on what app actually do.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
In my Android app, I have to display 10 imageButton in the User Interface each time the user selects an option. My question is:
Is it okay to create the UI while developing the app itself and add it to the layout folder or to create and add the imageviews to the View at the run time?
The main issue I am considering is performance? Which will give a better performance.
If you want to optimize performance, it's better to use XML and Java. If you're displaying 10 buttons wouldn't using XML be the easiest way to format them anyway?