onPause do not calls - google-tv

My steps:
create log
#Override
protected void onPause() {
Log.e("on Pause", "onPause");
super.onPause();
Start application
Click home on keyboard
Start another application (choose in down bar)
As a result, log do not appears. Is it possible?
Update: There was problem with Log Cat - not all logs appears

Your code is correct but perhaps the way you are looking for the log entry is incorrect. Are you using logcat in a terminal or in an ide? The tag you are using for the log message "on Pause" is a little bit odd.
Make sure you are not filtering your log level in logcat beyond error (unlikely but possible). I recomend setting your logcat filtering to "verbose". If you are using a terminal you can grep for "onPause" if there is a lot of noise in your log dump.

No. When you execute googleTV home (step 2 in your question), onPause log will appear.

Related

How to clear all console logs from different runs in eclipse?

I have almost 10 running micro services, each printing their logs in console. for a specific reason, instead of traversing between console logs and hit clear button, I want to clear all once. Is there straightforward way?
IMHO there is no way to clear all consoles at once. You can write your own plugin to do this.
Also note that you can traverse(loop through) each console just by clicking on console icon() in the console view toolbar again and again. No need to use down arrow button of console icon then switch to each console then clear.

How to save the life of my process?

I have the following problem: I want to run a really cumbersome calculation on a server via Putty in Matlab. Now I do not want to keep my notebook the whole time connected to this server, which is why I am searching for a solution to this problem. I know that screen in general works but I am not sure whether this could help me here too. The problem is the following: Each time I start this Matlab program I have no longer control over the terminal, since the Matlab program is still running. Therefore I am always forced to abort the process, which is what I do not want to happen. Is there anything that could help me.
What I need this:
1.)Start Matlab Application on server
2.)Disconnect from Server
3.)Connect to Server
4.)Have access to Matlab again
I would highly appreciate it, if somebody could give me a reference to some commands that might be helpful in this situation.
As #Peter said, screen is one good solution. A brief tutorial:
Connect to server
screen -S SectionName
matlab -nosplash -nodesktop or -nodisplay or -nojvm depending if you have allowed X11 forwarding on putty (you can check this by simply open a figure and check if you can see it with -nodesktop option)
Ctrl+a d to detach
Log out
Reconnect to server
If you are using X11 forwarding, you may need to update your display on the screen, so: echo $DISPLAY, copy its result
screen -rd SectionName
If you are using X11 forward, update display on screen export DISPLAY="value echoed outside screen" (I think the opposite also works, you set the log display into the screen display)
Finish Screen
Exit matlab and type exit
List open screens
screen -ls
Terminate unresponsive screen
Ctrl+a Ctrl+k and answer y
Navigate through screen screen:
Ctrl+esc and then use arrows or: ctrl+u to go half screen up and ctrl+d to half screen down
Exit broken connection screen
~ .
Note: You can have more than one screen section running, or you can open multiple screen windows by using Ctrl+a Ctrl+c
Note2: screen command may be very addicting, use it with cautious. Don't forget to read its man page.

Running my program from PyDev with one click?

I am developing using the PyDev plugin in Eclipse. My program uses several classes in several files. I usually run the program using the green "play" icon or using Control+F11. The only problem is that it will run the file, which is currently in "focus". Usually this is not the one containing the starting point of my application. As I run my program something like 200 times a day, this means that I need 200 extra click on the mouse and often forget about this.
Is there any way of setting the default file to launch?
Yes, change the launching to rerun the last launched, so Ctrl+F11 will launch the last one -- and use F9 to launch the one with focus -- See instructions and details at: http://pydev.org/manual_101_run.html
For me, the shortcut is Ctrl+Shift+F9. I don't think I've changed any keybindings, so its strange that it would be different from the official documentation.
Go to Run->Run History, and select the run that is your 'main' run. Now you should be able to use Ctrl-Shift+F9 from any other file to rerun your main. If it isn't Ctrl+Shift+F9 for you, look on the console window that should be at the bottom of your screen showing the stdout after every run. There is an icon on the top of it that has the green start arrow with a yellow arrow underneath it pointing to the right. That is the command to relaunch with the same configuration. If you hover over that, it should tell you the keyboard shortcut you need.

Restarting an app in Eclipse

Is there any way to restart a program in Eclipse? (preferably 1-click)
I really wish the console view had something like a restart button that would kill the app and restart it with the latest changes.
This always takes me at least three clicks. I click the down arrow next to the green circle with white triangle (play button) to open the dropdown menu, then I click to choose the Java main that I want to run, and then to stop I click the red square terminate button in the console view. Is there any easier way to do this that requires fewer clicks?
In Eclipse 4.1
open:
windows->Preferences->keys
in the filter text type: terminate and relaunch
In the binding add your binding (i use shift-F5)
For "when" select "In Windows"
This will do it in single shorcut for you.
Or install relaunch plugin:
https://bitbucket.org/mantis78/relaunch-plugin/wiki/Home
which will enable you to restart anywhere
If you use "build automatically", there is a good chance that your changes are applied on the running program, on the fly. As such, most changes will be effective directly without a need to restart.
If there is a structural difference and Eclipse can't inject the new code (for example if you change anonymous classes, or inheritance patterns), then you will be prompted with a dialog inviting you to restart the application in one click:
Exceptions are when you change the value of a static variable (or of the initialization of a class that won't be executed again until you restart the application). In this case indeed, you will need to restart explicitly with another method.
the console view has a terminate button (a red square) which stops the execution. then another click on the Run button (the green circle with triangle) begins execution again.
thats what i do - 2 clicks :)
If you're using Eclipse with Spring you could download the "Spring Tools X" plugin.
This will automatically add a start and relaunch button to the top bar menu.
It should be available on any perspective.
I haven't found an elegant solution for this problem, but if your program is short running and you can live with a few instances here and there, you can just use the run command. Its default shortcut is Ctrl+F11. Every time you press this, your application will restart. BUT! If you press this while your application is still running, another instance will be run because the "old" instance won't be automatically terminated.
There are ways to really terminate your application using shortcut keys, but that requires setting breakpoints and then using the "terminate" command, and that isn't very elegant.
When developing my own network application, I have added a code to check if the older instance is running, and if so, then send an agreed command over network socket for graceful shutdown. While this approach may not be the best as universal solution, it allows clean shutdown of the previous instance, rather than just killing it.
Easy way without plugin, every Eclipse !
Click the project from of this icon at this time hold the shift Button, Project will restart (Terminate and relaunch) with server port also.

Where do Eclipse sub-processes (launched with the "run" menu) show up?

I'm using Eclipse 3.4.1, moving my first steps. When I run my project (a server process) a console opens. But for some reasons after a while I can't find it anymore (even if the process is still up). I'd like to find it to be able to see its output and/or kill it.
Is there a place in Eclipse where I can find all running sub-processes?
There is a small button that looks like a monitor in the console panel. It lists all open consoles.
I'm ashamed I didn't find it myself before posting the question, but maybe it will be useful to someone.
If you are talking about "eclipse console", there is only one "console view", but several console instances.
You can browse the different consoles by clicking on the second button from the left in the console view (the one looking like a monitor)
Your console may 'disappear' because another message is displayed in the main console (stdout) process, while your server still runs with the other console instance.
An easier way if you are dealing with lots of processes is to use the Debug view (note: NOT the debug perspective, just the debug 'view' or 'window').
It shows a list of running processes, including processes started with Run instead of Debug. Selecting a process in the Debug view will open the corresponding Console, and visa-versa.
I put the Debug view above the Console view and size it to show just a few lines.