Before answering, please read all of this so you don't miss any details.
I have been looking on the internet for days, and trying to look through the javadocs, but I cannot find the answer anywhere.
How can I get connected devices through USB by using the java API. I do not want to use any libraries as they aren't reliable enough for the purpose I am using it for.
How do USB java libraries do it, what Java API does it use to connect to USB devices?
I know it may be complicated to actually work with it, but it will still be very useful.
I did seen the use of File.getRoots(), but it just gives storage, like C:/, H:/, etc. I want to be able to communicate with any USB device, like mouses, keyboards, custom hardware, etc.
Also include examples of code as well. It helps a lot in understanding it better. Make sure to also get to the point, it helps by saving time.
Update: I still have no clue on how to start.
Update 2: I found something with javax.usb, is it part of the java api, when I do say java api, I mean stuff that is already with java and where you don't need to download anything but the JRE. I am not sure as if it was, I would think someone would of mentioned something about it here. Going to try to find more into it. I can't find anything on the official java-14 docs, so guessing not.
Update 3: Haven't found an answer yet. Everything is redirecting to usb4java, which has not been updated in a couple years, 3 years in fact. Which is actually one of the main reasons I don't want to use any external library as it might get abandoned and will cause some issues with my code in the future. Hopefully someone can help soon, I desperately need an answer and the internet is no help and everything seems to redirect to libraries, which again, I don't want.
Update 4: Still on the hunt for an answer, still haven't found anything useful.
Update 5: I am seeing that I have tons of uses to do this, but don't know how to do it from scratch.
Update 6: Still on the hunt for an answer. I have been looking hard but found nothing. Looking through the USB4JAVA library code has been proven to not help much. But, I am going to keep looking, hopefully I find something soon. Found something though, it's libusb, a C program that USB4JAVA uses. Even though I won't use Java libraries, I might just use C libraries for Java, if that makes sense.
Related
Now I am researching how to implement email-based sing-up in Play Java. However, I couldn't get any useful information, so can anyone tell me the information? In other words, can anyone show some links or the easy example of it?
This is the example written in Scala, but unfortunately I can't understand well, I am not familiar with Scala...
Any comment is welcome.
EDIT: Some people dislike this question. Maybe they think this is not a good question because I am supposed to reach some answers of this question.
However, in fact there seems to be no information that help me build email-based authentication when using Java. In Play Scala, you have many options. But I want to know how to realize it in Java, not Scala. So, this question is so meaning for some people who try to build a web app in Play Java.
You can do this using the Play Authenticate library: http://joscha.github.io/play-authenticate/
I was wondering if anyone knows a good tutorial that explains how to use SQLite with libgdx. All the ones I have found don't explain it well and I'm having trouble figuring out how to use it. So if you know of one that explains everything decently please give me the link to it. Thanks in advance.
Notice that the extensions available won't work for multi-platform, at max you'll be able to support Android and Desktop. My advise is for you to create your own classes for methods for accessing info stored as files on the device trough the LibGDX File API. You won't get to use SQL and it will certainly take longer but you'll get try multi-platform support (if that is what you're looking too of course).
https://code.google.com/p/libgdx-users/wiki/SQLite
Try this, although it is rather a suggestion of implementation rather than a full blown tutorial.
A Libgdx user proposed an SQLite extension several months ago. Its definitely a work-in-progress, but might be a good place to get some ideas or borrow some code from: https://github.com/libgdx/libgdx/pull/222
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to encrypt a .jar file
I know obfuscation but what it does is only to make the code harder to understand. It doesn't really encrypt the code. Is there a way to encrypt Android code? Or is there any alternative to make the code more irrecoverable when decompiled?
I am asking this question to know if what I'm looking for is possible. Right now, my mind suggest that it is impossible to encrypt the code since if we encrypt it, Dalvik also won't be able to understand the code and run it. But I'm not really sure about it. It is possible that I didn't know something.
Please post what do you think about this or if you have any suggestions? Also, please consider a financial application wherein having access to a human readable code means being able to understand the flow of the financial process going-on on the backend. Thank you!
There are different efforts to make life harder for standard DEX decompiler tools, by hiding code, inserting dummy instructions, etc. It is all pretty much research stage ATM, but you can find papers an presentations about it online, with some sample tools.
There is also DexGuard (not free) by the author of ProGuard which can encrypt strings (standard obfuscation does not) to make it harder to search for things in decompiled code. I haven't personally used it, but you might want to give it a try.
Ultimately though, to be able to run something you have to decrypt/descramble/whatver so you can feed it to the VM. If you have complete control over the device (i.e., root privileges and physical access), you can dump memory, introduce hooks in system libraries, etc. and get the actual runnable code. As suggested by others, if you have really sensitve code, it should live on your servers.
By definition, the machine has to be able to read your code. Therefore...anyone with a machine can read your code.
The only alternatives to this are e.g. forcing users to contact your third-party site and get information from you there somehow.
I need to find the coordinates of windows open even when they are not launched by my application, and after some searching I came across quartz window services. However, the reference document I linked to does not mention where this is located, and it was the only document I could find about it. I have looked through other frameworks reference documents, but none of them so much as mention it.
The problem obviously arrises solely out of my own ignorance, and I did not really want to ask. But, I have searched all over the internet, and have been able to find absolutely no reference to the location of quartz windows service.
Where is it? Is it part of a framework, and if so what class is it in? All I know is what functions it contains, and that they look like exactly what I need!
Thank you in advance for any help. Also, if you know how I could figure this out for myself in the future, I would appreciate that as well.
Note: I don't know if it matters, but I am planning to use JNA to call it from Java as opposed to using it from C.
Yeah, that's a little less than obvious. By searching for "Quartz Window Services" I was able to find the link to the overview, such as it is: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CGWindow_Reference/Reference/Introduction.html
That shows that it's in the ApplicationServices framework.
Well first off, I'm not 100% certain how you're going to access C methods from Java (I've never done it myself), but if it's possible to do the bridging, you can use the Accessibility API in order to get the windows for all of the running applications (see the answer to this related question). Once you have that list of windows, you can get the frame (coordinates) of where each of those windows lives on-screen.
Another thing about using the Accessibility API, the user has to "OPT IN" to allowing it. It's not normally turned on by default.
Here's another question that closely matches yours, but the accepted answer only provides a solution to retrieve the windows for your own (currently running) application.
I have client which has a problem with printing from JAVA applications, using old Brother printers. The exception he gets is "Printer is not accepting jobs".
Other applications (not java applications) manage to print using these printers. He switched to a new printer (also Brother), without changing the driver and then it worked.
The idea is that he cannot change all the printers, also he does not want to reinstall all of them, as he has a network of hundreds of computers and printers.
I have read on different forums that there is a bug in java version 1.5 and 1.6, but this application only works with java 1.5 or above... so he cannot switch to java 1.4 (with java 1.4, the printing worked).
Can you please help me somehow and give me some possible solution to this problem?
Found a workaround using byte code manipulation at http://copy-con.blogspot.com/2009/12/printer-is-not-accepting-job.html
It appears that this is this bug. Unfortunately, it is marked as low priority, and since nobody has bothered to vote for it, it is being put off.
This forum thread gives some useful background (reply #11) and a workaround (reply #9) that ignores the printer status when trying to print a file.
If you want this bug fixed in Java 7, there is still time to submit a patch.
EDIT
I was aware that someone disputed the workaround, but I didn't get my head around the problem. Whatever, it should be possible to develop a better version, either using the same approach or a different one. If subclassing and using reflection to tweak private state don't work, then you can download the Java 6 source code, fix the bug and rebuild.
I'm sure it would be nice if someone had a solution for you, but lets be realistic. This looks like a problem that affects very few people. IMO, your best chances of success are:
self help,
paying for an Oracle support contract, or
hiring an independent technical expert.
Of these, self help has the best chance of giving you a quick resolution ... assuming you have people with the skills for doing this kind of work in-house.