continous screen recording for bug reporting - java

We have a desktop client with several hundreds of users in our company. Sometimes it throws exceptions and crashes, but it's been hard to get the users to report their issues. To track these exceptions we are catching them and e-mailing the stacktrace and user specific data relating to the crash to a server wherefrom we then can view a log of all the crashes.
What would be really nice, is if we could log, not only the exception details, but also a screen recording video clip, of say the last 2 minutes up until the exception.
It shouldn't be very hard, all we need is some software that continuously records the screen and saves the video on drive, but erases everything older than a certain number of minutes. When the crash occurs we have can simply pick the current videoclip and attach it along with the exception details.
Anyone know of such a software, or anything similar that would solve our issue?
----------Solved:
I used both AndrewThompson´s and pjvds answers below. Andrews strategy outline, but with C# instead of Java, simply because our application is written in C#. The Code Project article pjvds linked helped me on how to do it in C#.

Here is one strategy:
Define a ScreenGrab object that encapsulates a BufferedImage and other relevant information (e.g. the time in millis or the mouse location).
Gain a screenshot using either the Robot or by establishing a BufferedImage the size of the content pane, and painting the content pane to the Graphics instance obtained from the image.
Create a ScreenGrab object and add it to an ArrayList
If the array list has exceeded a certain size, delete the first ScreenGrab in the list.
Rinse & repeat, perhaps at 2FPS, until an error occurs.
Either:
Use an adapted version of JpegImagesToMovie (uses the JMF) to transform the images (with pseudo mouse drawn in) to a MOV.
Zip all the ScreenGrab objects and send the archive instead.
Tweaks on this technique. The advantage of sending the ScreenGrab archive are multiple.
It can record the GUI perfectly, without the 'lossy' effect typical of JPEG compression.
If the user leaves the computer, neither the screen nor mouse position will change. So compare each one to the last and if the details are the same, skip storing it. The MOV would have to be at constant frame rate, but the Zip of custom objects could record at whatever rate best suits the user activity.

I remember I tried some code from a Code Project article years ago to accomplish the same. Capture Activities on Screen in a Movie.
We removed it from our software a release later due a lot of complains. People don't like it when their boss records their screen ;-)

Related

How to make JTree to only display strings and not a file structure

I'm currently working on a client-server project where the client sends a request to the server and the server runs a database statement based on the information from the client. As there's no static length for the output I add all the data to a ArrayList<String> and send it back to the client.
The data that the client requests has a certain hierarchy so that one could also display it using an XML file (however the output to a GUI is wanted here instead of file creation). There's several ways of displaying I came up with. One would be using a simple text area, however using this, I need to do applying the layout myself and the option of folding where I can expand and collapse certain items is not possible.
Another possibility of course would be using a simple JList, however I read on Stackoverflow that using a JList to display hierarchical things is way easier done using a JTree.
When I decided trying to implement JTree I also found the Genealogy.java file provided by Oracle in their documentation of JTree. As to be seen in the first examples of this documentation there is always a filestructure being displayed and hence also a filestructure kind of representation (using folder- and file-symbols) is shown. In contrast to this Genealogy.java only shows the names of the persons so I tried to adapt the implementation from Genealogy.java to my case however I'm completely clueless of how to do this as I don't even know where these symbols come from and where I could possibly disable them and also don't really get what some of the methods I need to implement do.
As I'm currently really clueless of how to possibly accomplish that I really need some detailed help (only telling me to come up with my own implementation of JTree or TreeNode doesn't really help me at this point). Is there any simpler way or is the need to implement any of the before mentioned interfaces inevitable and if so, how would it be done?
EDIT:
This is how it currently would be displayed (example taken from the Oracle documentation, showing folder- and file-symbols in front of the string):
And this is how I want it to be displayed (also from the documentation, this time only displaying a string as node):
The answer almost certainly will be found via the (icon of the) TreeCellRenderer used for the tree nodes. See the File Browser GUI for tips. It shows how to set the icons in the FileTreeCellRenderer. Admittedly the point here is almost exactly opposite what it was there, but it still comes down to the same thing - the icons.
The section of the tutorial that covers it is How to Use Trees: Customizing a Tree's Display.

Jasper Reports cutting large String between pages

I don't know if "cutting" is the right term...
I've got to finish doing a large and complex report based on an Applet legacy system, a fellow and I decided trying reuse all the logic in the applet to avoid the complexity of doing a lot of sub-reports. What we did was copy all the logic in the applet that include a lot of condictionals/SQL and make a huge and properly formated String, so that in our Jasper file it would just have a method called "myVo.getBody()" besides the header and footer stuff.
Unfortunately we found out a problem that some part of text get lost between pages. I think that as the text get bigger and reach Jasper page limit for some reason it keeps being writed in a "no visible area" and when the next page content starts some part was lost.
For example, there is a list of 19 items and what happens is:
End of 2nd page
1 - item
2 - item
beggining of 3rd page
18th - item
19th - item
Items from 3 to 17 are not being showed.
Is there any Jasper configuration for this situation?
We tried:
Position type: Fix Relative to the Top and Float
Stretch Type: Relative to the Tallers Object and Relative to Band Height
Stretch With Overflot: true or false
I don't think showing Java code would be useful as it just use a StringBuffer to build the String, put it on body property in a PreparedDocumentVO so that Jasper model can consumes it. It seems to be some Jasper setting, or the idea of creating a huge String is not so good as we thought.
I would consider breaking the result up.
Jasper formats information based on a relative page size. This means that at some point in time, when dealing with information that is not likely to fit on a page, Jasper will probably make an assumption that doesn't hold (and your data will likely not be formatted into the page).
If you have an exceptionally long string, consider splitting it up. Besides, people scroll web pages down, not the side, so a heavy side-scrolling document is likely to cause user issues unless every record scrolls to the side just as heavily.

Android Osmdroid get poins of interest from own database

This is my first time using stackoverflow because I am really desperate to solve this issue.
I am developing an app that contains information about bus stops in my country (Google maps does not work if I try to go from X to Y on a bus) so I decided to do it myself. I already tracked every stop of many buses.
I show each bus stop as overlays in my osmdroid map view, I get this information from a internal database that as I said I collected the information and is not online.
What I want to do now, is to get the user's location (lat, long) and tell him/her the closets bus stops to him/her location. I already looked at Osmdroid bonuspack and the POI feature, but what I understood is that these places (restaurants, bus stops, hospitals, etc) are already on a server.
How can I implement a POI function on my application with local information. I would appreciate any help, this is something I want to do for my community.
Thank you everyone and sorry for my poor English. I am doing my best.
You already have the coordinates of bus stops in your database, and they are displayed in an overlay. You can also get the current users location. What you want to achieve is a matter of calculating the geographical distance between two points (the user's location and a bus stop).
You don't have to implement a suitable formula yourself, e.g. have a look at the GeoPoint class. There's a distanceTo(final IGeoPoint other) method. You can instantiate a GeoPoint with known coordinates or simply use Overlay methods.
You could also achieve the same thing by querying only the bus stops that are within a certain radius of the user's location (maybe have a look at the BoundingBox)
If you want to use libraries like the BonusPack, look at the provider implementations. You could simply write your own provider for your bus stops. Have a look at e.g. this one.
> How can I implement a POI function on my
> application with local information
I assume that your question is about "how to render busstops on local device" and not "how to query my local database" and not "how to do some server-side support."
If you want to render the busstops on you local android device you can use osmbonuspack
which contain an example app that shows how to render interactive poi-s.
Unfortunately currently there is no precompiled osmbonuspack aar at jcenter/mavencentral so you have to include the sources as a local subdirectory of your project.

Check state of and information about an external application

Here (http://www.desktop-macros.com/) is a program which records sequences of mouse clicks and key strokes on a PC and then plays it back to perform some user-defined actions.
Now, what I'd like to achieve is a bit more demanding: I'd like for example to launch a browser with mouse clicks, wait until it's started (i.e. its application screen is visible) and then again perform some mouse&keyboard actions.
Of course it would also be useful to obtain also other information, like position and dimensions of the window.
Is it possible to make such fancy OS-related operations (like checking whether an application is fully-loaded) with Java? Maybe there are some non-standard libraries with useful API?
If not, could you recommend some way/language of solving such an issue?
I use Autohotkey that has the command WinWait that waits for windows having the good title. But I rely on Send {Enter}, not on mouse, to do things.

Java identifying more than 2 monitors

I am developing an Java swing based application which will 3 distinct main JFrames and each one of these will have to be displayed on one of the three display-monitors present in the system. Moreover application is going to have capability to alertif a particular display-monitor gone disconnected or reconnecetd.
Each main-JFrame must be displayed on a specific display-screen. This is due to the place where these monitors are going to be located. More like a point of sale scenario where one monitor can show things for sale-person and other for client and other for a security person.
Now the main issue is how to know which monitor is which. I solved this issue by getting serial-no of each monitor by calling a VBScript from within Java.
But still another problem is how map serial-no information of the monitor in Java. In Java what I can get corresponding to each monitor is a java.awt.GraphicsDevice instance and I have no idea how I can map serial-no information to this as the only way to have these instances of java.awt.GraphicsDevice is GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() and this function does not ensure that it will return the devices in a sepecific sequence, each time the function is called.
Thanking in anticipation
Java supports multiple monitors via a GraphicsEnvironment and GraphicsDevice objects. Check the GraphicsDevice javadoc for more info.
Does the GraphicsDevice.getIDString() method give you a stable value that you can compare against the serial numbers? If so, you can write all identified serial numbers to a property file, and do a comparison each time your program starts (if the ID isn't already the serial num). This property file could also store the position of each display (left, center, right or top, middle, bottom, etc)
If you cannot determine the correspondance between the id and the serial number, you could trigger a 'display setup routine' whenever you see an display id that is not in your properties file.
This routine would prompt the user to confirm the display model number and enter the position of each display (consider the display orientation settings in Win,OS X, Linux etc). If you can draw widgets to a specific display, you should be able to collect this information. Also, if the user rearranges the physical position of their displays (perhaps swapping the position of two displays), then they could manually execute this routine.

Categories

Resources