Android application icon click different behavior - android

I've faced the different behavior of my app while clicking its icon if it was already launched before.
If I install the app via Eclipse or apk manager, launch it, press home button and then launch the app again clicking the application icon - it will bring the first activity from stack to front.
If I install the same version from the Play Market and follow the same steps - the application is relaunched completely from the very beginning (splash screen activity).
Is there a difference between intents which are used to start the app in this two cases?
How can I simulate the Play Market behavior to ensure that everything is fine before the release?
Thanks in advance.

This sounds like its to do with the android lifecycle. Read more here:
http://developer.android.com/training/basics/activity-lifecycle/index.html
Your activity will go through different stages when it starts back up depending on if it has been completely destroyed or if it has just been stopped. Pressing the home button will only stop your app rather than completely destroying it. If you're phone is running out of resources android might destroy your app in order to free up the resources its using.
Running from eclipse will start your app from a brand new start up (The same as people will get when they install from the market). So if it works when you run it from eclipse. It should work when other people install it too.

Related

Regarding improper functionality of emulator in android studio

i am new here, but i checked the site, it does not contain my question, hence not duplicate. Actually, in my android studio v 1.1.0, emulator does not launch default activity automatically when started in android studio. What i mean is that when i click the green (play) button to run my project, my emulator is launched. When it loads and is ready to be unlocked, after unlocking my default activity should run automatically but it does not. Just The Home screen is shown no matter how much i keep waiting. No error reported in LogCat, neither any exception or anything wrong with code. So to run, I have to right click on my activity and click run MainActivity from the available options. So, how do i make the emulator automatically launch my default activity?

Is there somethign similar to the Windows Task Manager for the android emulator

I was studying some tutorials on Android programming and I realized that pressing the Home button on the emulator takes me tot he phones Desktop, but my sample that was running at the time only goes to the background and does not get destroyed. However, if I press the return button, the app is destroyed as well. So I am assuming there might be other apps running int he background as well, those which I am not aware of. Is there something in the android emulator resembling the task manager from windows, which shows what apps are currently running on the phone? I don't have a smartphone with me, but I remember seeing something like that on my friend's smartphone a few days ago. It wasn't an external app but was something built into the phone, I could access it by going to Settings or something.
Is there a task manager built into the android emulator, or is there any other way I can see such things through the SDK debugger?
Inside the settings, there is a list of currently running processes.
First , Leaving the activity does not mean the process ends, It is just not invisible . When the Os needs more memory ,it will be recovered.
If you want to have a backup process, you can start a back service.
http://developer.android.com/reference/android/app/Service.html
Here is how I end a process (only works on Android 4.0+).
Instead of pressing home, press recent and swipe away the process you want to end. Then press home (or back).
You can also use this to close those nasty apps that prevent you from closing them by not allowing back button to work on their main screens.
This is much quicker than having to go to settings, etc.

Android app auto reset on minimize

We have designed an hybrid app which is a bit heavy (9 MB). Problem is that at times, minimizing this app (home button) makes the app reset in background i.e. its app cache is lost and app reloads from splash screen. After minimizing we worked with other apps in tablet (Galaxy 800).
We saw this problem only if we tried to launch app from the icon in launcher. This problem did not happen when we tried to launch it from the minimized list(recent apps button).
This problem is not specific to the tab. It also happened in Galaxy 3 and Droid Razr also.
Any guidance?
Problem is that at times, minimizing this app (home button) makes the app reset in background i.e. its app cache is lost and app reloads from splash screen.
This is perfectly normal.
Computers, phones, and tablets do not have infinite RAM. Android's approach to this problem is to keep your process around for a while after the user has left it, but eventually Android will terminate your process to free up RAM for other applications and their processes. You can read more about the Android process model in the documentation.
It can be possible that ‘deep clean' option is enabled by mistake on your phone. What deep clean does is, whenever you minimize an app , it releases all the memory associated with that app, and hence when you again open that app, it will start as if it is new. To check the 'deep clean' option,
go to the
Developer options -> 'Don't keep activities' -> disable it
If it is not disable please disable it.

Signed android app behaves different from when run manually on device from Eclipse?

I'm feeling screwed up now after working on this problem for the last century. Thanks in advance for your help!
What Happened: I develop an app, which is a game that contains a game
activity that uses CountDownTimers for timed game rounds. Pausing,
exiting the app from this activity (via pressing the power button,
home button etc.) works fine when tested on my Samsung Galaxy Tab 7",
running the unsigned app from Eclipse before it has been signed.
Ecstatic that I've completed my work, I go ahead and sign the freaking apk in
CMD. I test the signed app just to check that it works fine by
copy+pasting the signed .apk into the SD card of the same Galaxy Tab
and then installing it after removing all the old data of the app run from
Eclipse but OF COURSE IT DOESN'T WORK.
Things going wrong include the activity not pausing when I press the
power button when the timed round is being run (after I power the device back on I discover that the timer has been running while the screen was powered off and is still running, and my pause game dialog is nowhere to be found), the activity being
closed when I press the home key (after I press the home key and open
the app again the app restarts from the introductory splash screen of
the app) and lastly, when I pause the game midway, power off and on
the screen, hit resume on the pause game dialog - the game timer goes from something like
18.42s straight to 0.00s and continues from there into the next activity.
Okay, so that is very much more of a story than a question about code - but here's the technical question - why is my signed app behaving differently from the unsigned one that was run from Eclipse? I'm not providing any code here of how i did those things, since that should be irrelevant considering that they work in the first place (as in by running the app on my device while developing in Eclipse).
So very nearly there... URGH
Not sure if this is actually your problem ... but the most common reason that a signed app does not work when the unsigned/Eclipse version does is that building the signed app generally includes a Proguard obfuscation/optimization step.
One of the consequences of Proguard optimization is that some of the classes/methods referenced in either your XML layouts or using reflection may no longer have the same name (or may have been optimized out altogether).
The easiest/fastest way to check is to look at the logcat trace - there'll be a ClassNotFoundException or MethodNotFoundException or somesuch.

Android: Changing entry point activity to app messes up app update

This is the second time this has happened to me now. I changed the starting activity of my app, and put out an update, and now the icon on people's phone will not open my app. The only way they can open it is through the downloads section of their Android Market app, or if they uninstall and reinstall the app, causing them to lose ALL their data.
I have no problem with updates on my N1, but every other Android phone has a problem with this. Why?
The only way they can open it is
through the downloads section of their
Android Market app, or if they
uninstall and reinstall the app,
causing them to lose ALL their data.
Powering their phone off and on should work as well.
I have no problem with updates on my
N1, but every other Android phone has
a problem with this. Why?
It's a question of when the home screen app elects to reload its launcher data. Different home screen implementations handle this differently. You will have the same problem with any user-created shortcuts and the like.

Categories

Resources