I checkde this link for show mjpeg on my android device.
I tested two links. One is sample link in example code. Other is my cam (APM-H804-WS) link.
The problem happened only on using my cam link.
First executing works well. Turn off the screen, or press home button will make example app disactive. The problem happens here.
Other screen which I see cam's stops. If nothing doing and wait, it disconnected. If I kill example app by like task killer, screen re-starts to move. Even if resume app, it works same. The only way that problem doesn't happen is quickly reload app and wish it connects well. (with log 2. Request finished, status = 200)
No problem when use sample link. Also no problem when use 'IP Camera viewer lite'.
I don`t know where I should fix it...
Related
I have similar problem like this.
On start my app displays a splash screen and checks via network if the current user is still premium.
My problem: I started my app right before I went to bed and minimized it by pressing the home button. In the morning I launched the app again and it resumed the activity from the night. The app never really quit, my splash screen was not shown and and it couldn't check if the user is still premium.
So how can I achieve my app to be closed after a certain time (e.g. when the app is minimized)?
But the problem is there is a portion in the app where I can view videos in full screen and here I use android's default player. So when the app is minimized while watching and then again open the app onResume will not be called and cannot check whether it is a registered user or not. The video player will continue to play the video. Is there any method so that I can kill the app when the video is playing and minimised?? is there any method which is called when the app is minimised using home key press?? Is it possible in every device to detect the home keypress event and write some code there?? Please help with some fresh ideas!!!
Now I know why my reputation is always low. Thanks Dan Hulme. You are right I just want to use the app lifecycle correctly. I want to use onRestart not onResume. And that have done the work for me. Thanks all.
I want to create an android app which does one thing (change a setting and save that it did that) and then stops (exits? Stops ? gets destroyed?) before a form is loaded or shown.
Then when I run the app again, I read wether the app has chaged the setting, and then undo's that and then stops (exits? Stops ? gets destroyed?) before a form is loaded or shown.
You can compare it with an existing flashlight app: you click the icon and the flaslight (led) goes on (and no form is shown) and when you click the icon again, the flaslight (led) goes off.
Sounds easy, but I'm not sure I how to do this. Looking at the activity flow (http://developer.android.com/reference/android/app/Activity.html) didn't really help....
When I try to exit the app with navigator.app.exitApp(); the app exits succesfully. But when I go to the task overview (with long pressing the home button) on my Galaxy s3, it still shows the last page that I was on when the app was on.
It works properly, because when I launch the app again from the task overview, it launches the app again as cold start. The problem is that the task overview reveals confidential information and I do not want that.
The work around that I have now is that the app first navigates to another page, without confidential information, just before calling navigator.app.exitApp();. However this results in a quick navigation between screens, and gives a bad user experience.
Is there any way to remove the app from the task overview when exiting the app in Cordova, or is this just how Samsung or the Galaxy series works?
As a summary answer of comments provided:
According to jcesarmobile, there is no way to remove them from the apps list programmatically even if quit.
There seems, though, to be possibility to use this to exclude it from the recent apps in the first place.
I've been having reports from users saying that they can no longer open our app; and I have now seen this on my own phone.
When I tap the app icon the screen goes black (showing the title but that's it), then quickly the black screen disappears and you're back in the OS.
Logcat shows zero issues when this happens.
Anyone know what could be happening? This issue has only become apparent within the last few weeks before that there were no reports from users on this particular issue.
EDIT: I've tried restarting the phone, force-stopping the app and clearing the cache+data to no avail.
If your app having use internet or http request over network then write code in method onResume otherwise for http request use asynchronous task
I was just bored of iOS and I recently changed to Android. I have a Nexus 5 device, and I've just finished installing my favourite apps in my device.
One of those apps is Line, the famous communication app from naver. I installed it and I configured it with a passcode in order to secure access to it, so no one despite me could see the "confidential" conversations inside.
The problem is even if I have the passcode enabled on line, if someone presses the "Recent list applications" button, they can see perfectly a screenshot of Line with my last conversation, so anyone could see what I was doing in Line.
I made the same test on iPhone and .. surprise ... iOS is taking the snapshot AFTER the passcode screen is enabled, so anyone could see nothing. It seems that in Android the snapshot is taken BEFORE passcode screen is enabled so anyone could see what last line screen looks like :)
So, having read other threads on this forums, I'm supposed to have several ways to solve this:
Wait for LINE's company NAVER to add an option to prevent this app to show on recent app list (adding android:excludeFromRecents="true" on THEIR manifest) [that won't be soon]
Wait for LINE's company NAVER to force the snapshot after passcode screen is enabled [maybe soon but not in company'sroadmap]
Decompile apk and change manifest on my own - or use FLAG_SECURE - (I tried it but when I launch the new app it suddenly dies on startup with a message "Application stopped". I thing LINE's server verifies on startup that the client app is what is expected to be, comparing sizes or something else)
So I don't know more ways to get around this. Do you have any more idea? I'm stucked on it.
Thank you a lot.
Detect when LINE has left foreground
Create a background service that detects if LINE is on foreground and when it leaves the foreground. (https://stackoverflow.com/a/14044662/1683141)
When line has left foreground, you should take action:
A. Stop the line app completely
OR
B. Open & "close" the line app so it will show a locked state in the multitask thumbnail
A possible way to accomplish situation B:
Optionally: detect which app the user has now opened and remember it
Wait a few seconds and open the LINE app again after the user closed it (by intent for example)
Now the LINE app will show the lock screen
Now let the background service open the home screen (or make an intent to the remembered activity)
Now the LINE app is back to the background and it will have a multitask-thumbnail showing the locked screen.
Ofcourse, this will create a loop, and this isn't a stable solution
-Option A is a relatively reliable, and a (in my opinion) good way to accomplish what you want: no one can see your secure chat. Disadvantage is that the application is now removed from multitasking.
-Option B is only an idea, but maybe, if it's done the right way, It could work.
Edit: Option A will not work. The application will not be removed from multitasking if the task is killed.