App is Lagging/Hanging. Why? [closed] - android

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I made a simple profile in my android app and after uploading image to firebase storage my app is lagging in speed, the image uploaded is in KBs size and in my profile I am using a Navigation Drawer whose sliding animation is also hanging. I am unable to figure out whats going wrong.

Maybe your are using the Main thread for doing all the job. This is one reason for UI thread to hang(i.e) the app didn't hang but it waits for the main UI thread to complete its work.
Generally, the app hangs for this reason. As suggested by Commonsware track methods. Also, try using background threads instead of main thread.

Related

app corrupts when onTouch is triggered while changing activity [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I made a little game touch the screen to move up, release to go down. However, the player can die by colliding with the screen bounds. On collision, a new activity starts. 'Unfortunately the app has stopped' appears when I keep pressing after the collision. Using onTouchEvent.
What can I do?
I am using Eclipse, and appreciate every answer
Take a look at the code that you execute in response to the onTouch event. Can it execute if the Activity is being destroyed or has already been destroyed , e.g. are you using a background thread or an AsyncTask? You need to respect the Activity lifecycle, otherwise you may be attempting to access an Activity that is no longer in an active state.

QT QML: memory does not decrease when item is destroyed [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have dynamically created a qml page.
I used a JS file to create it.
Then I have tried to destroy the created object.
But I have observed that the amount of memory always increases instead of decreasing after the destroy call.
First of all, Qt doesn't guarantee that Item will be removed instantly. You should expect real deletion later.
How did you observe it? Did you look at virtual memory or physical memory? Do you understand this? And can you provide example?

Need a bit of assistance [closed]

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
I need help with my app, I created an app but it runs slowly, i guess because of the background and the images, now i read somwhere i should use threads and a loading screen until all app images are loaded so it runs faster. I dont know how to use threads, could you elp me or at least send me somewhere I can learn how to do it. One more thing i get an error whne i am using Activity extends fragment at loading sql something at getappid or something like that. is there an easy way to fix it? This app is made for android 4.0 - android L
My application can be found at the link below:
https://www.dropbox.com/s/22kchus06l2lf0u/app-release.apk
If you need more info like main xml and main java code i can paste it here...
Thanks anyway !
A very basic example of a Thread:
Thread thread = new Thread(
public void run(){
// Do stuff here
}
).start();
Everything inside the body of run() will be executed separately from the UI thread.

Why things get different on Activity and fragment? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I want to fetch data and show it in grid view which is in Fragment but I am getting error.But when I tried to implement same thing in Activity it is working fine why it is happening so?..
Why things get different when implemented in Activity and Fragment?
Can Anyone tell what is to be changed and where we can get stuck?
Thanks.
Slow down. Fragments are tough to grasp and implement when you just got started. To get a better understanding work yourself through this guide. Also make sure you experiment with this example project. Both link to the official Android Developers site.
EDIT: To get the basic picture, make sure you understand the Activity lifecycle and how this lifecycle connects to the Fragment lifecycle. To save yourself from frustration over getting stuck, watch this video and concentrate on the image at 6:10. If you want your Activity and Fragment objects to communicate smoothly, you will need to know when and where you can make method calls and callbacks. There's plenty of other useful material, just keep on searching.

debugging Android apps? [closed]

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 3 years ago.
Improve this question
I am now trying to improve my programming skills and specially I would like to now how you debug those situations where the app lags a bit. I tried to move most of the critical parts to threads but still I get some ANR. I guess my app is leaking memory somewhere.
So, how to debug this?
I think you should spend some time reading this http://developer.android.com/reference/android/os/StrictMode.html
From Strict Mode reference page:
StrictMode is most commonly used to
catch accidental disk or network
access on the application's main
thread, where UI operations are
received and animations take place.
Keeping disk and network operations
off the main thread makes for much
smoother, more responsive
applications. By keeping your
application's main thread responsive,
you also prevent ANR dialogs from
being shown to users.
Take a look at Traceview
It's now even included in the eclipse android dev tools plugin.

Categories

Resources