While selecting an image the app restarts on S3 - android

I am developing an app that need to upload images to the server using WebView. But when user clicks on File Chooser button and selects Gallery or Camera to select the photo. My app restarts.
This is surely a memory issue, because if I restart my mobile phone, it starts working fine.
This issue is only seen on S3 and a few other devices. On most of the devices it works fine.
Edit:
The issue is not related to the IMAGE SIZE. Even if I choose the gallery to select the image and when the gallery opens I just click back button to go back to the app and the app restarts.
That means it has nothing to do with the image size. When the gallery opens in full screen and my app goes to background, Android kills my app because of low memory or something like that. But I don't know how to handle it.
i am saving my webview state and restoring it....but its not helping

It's normal for the system to terminate your activities. What you can and should do is to write your app so that it can restore its state correctly. See the Android documentation Recreacting an Activity for more information.

It is tough to say what should be causing the error, as you are unable to post your logcat output. However, here are a few answers to the similar issue, try this and this, and see if you are able to solve your issue.

Related

Camera issues in Samsung j5 (2016) only

Currently working on an app in which a functionality of camera interaction is there. I just need to do is to click on a button which opens the camera & the captured picture is shown in an image view after uploading it to the server. The app works totally fine in other Android Devices, but it got stuck in particular Samsung J5 2016. So the question is, it is an issue of ONE UI of samsung or anything else in that particular device. Any help/comment will be appreciable.
RESET THE CAMERA APP ITSELF...
Apparently, it’s the camera app that has a problem so after the first two steps and the error remains, then you have to go after the app that has an issue. The best thing to do is reset it so it will be brought back to its default settings…
From any Home screen, tap the Apps icon.
Tap Settings.
Tap Applications.
Tap Application manager.
Tap Camera in the default list or tap MORE > Show system apps to display built-in apps.
Tap Storage.
Tap Clear cache.
Tap Clear data and then tap OK.
Restart your.

Does Android take a screenshot if the current Activity gets backgrounded (like iOS does)?

On iOS if you press the home button of the device, iOS takes a screenshot of the current app screen. When switching back to the app it then shows that screen and while the screen is shown it really loads the actual app state. The increases perceived performance.
The screenshot however can contain sensitive information (think of a banking app for instance). As the screenshot is saved unencrypted, some iOS apps remove sensitive information from the screen as soon as the app as backgrounded.
Does Android have a similar mechanism? If yes: how to prevent it or work around it?
Android doesn't do that. The application is still in memory but might be killed later. In that case everything will be restored with no screenshot taken by the system.
The only case where you want to hide sensitive information is when the user holds home button to show all running applications. You can hide the content of your activity where card details are entered by adding the following line in onCreate:
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);

Motorola Droid 3 Camera app kills backgournd apps

I have application that opens native camera app and get the captured picture.
I have seen that when my application open native camera application it kills all background running applications(including my application).
This issue is also tested in other flow like : I have opened 3-4 other applications. After that I have opened native camera application directly from the home screen. In this case also it kills all the previously opened application.
I would like to have background app remains opens. Can anybody help me here.
I have tested same scenario with Samsung Galaxy ACE and HTC Desire HD. It's working fine.
Device configuration :
Motorola Droid 3 , Android version : 2.3.4
Yes got it. I have found the solution for it. My problem was like when I open Motorola Droid 3 camera application , it closes all the background running applications. After searching through blogs and apply some logic and found that it was Native camera issue.
So for the solution, I have saved my application state to bundle using method of
protected void onSaveInstanceState(Bundle outState)
and retrieve saved state from onCreate method again and it works. Now my application does not crash. But one more problem here is like whatever image I have captured from the native camera is not displayed to my screen because it is alreaded restarted so onActivityResult method will not be called.
To solve this issue we have to clear the data of native camera app and have to forced stop it once. After that I open native camera app from my application and it works for 2-3 times and again stops working. Again I clear data and force stop native camera apps and it works.
Other solution to this is I have installed Camera360 application and it works fine for me and no need to use default camera application.
I know this is again a work around but if anybody can give me other better solution then it's fine.
Enjoy.

Phonegap persistent app in background, how to?

i have a Phonegap and JQM app.
Problem is, if I switch to another app and then back to my app, App is completely reloaded and start again.
Is posible this disable?
Thanks for any advice.
This is happening because there is a lack of memory for the app to run. So as soon as u go to home the app dies and on opening again it reloads the app from the start. To confirm that this is indeed happening i would suggest that you close all running apps on your phone and then run your app. Im sure it would run properly even after switching to home screen and coming back.I don't think its possible to get around this behavior. Design your app so that it has a small startup time so that its usable even on phones with less ram where such problems would come.

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