I have a serial to USB device and more than one of those can be connected to the computer. I need to query and retrieve a list of COM ports that the devices are connected to. In Windows Device Manager you can get the COM port + friendly name of devices that are connected at the present time. This list is dynamic.
Reading from the registry did not work because the information stored is stale and static, not dynamic.
Devcon (from Microsoft) does list the ports that devices are connected to, but it cannot be used in my app because it is not re-distributable.
Any ideas or preferably, a solution?
I had to solve a similar issue just some weeks ago. I came accross the Jawin-Project that provided everything you need to use WMI-Queries. It is already quite old but works like a charm if you follow the documentation. A nice German walkthrough can be found codegods blog.
For me, it did not solve all problems (I had some very specific things to find out about the target device), I finally created an own JNI (Java Native Interface) Class and DLL in C incorporating the windows API.
I hope this is what you searched for.
Did you try this jUSB API or This example ?
I hope this will help you.
Use JNA (https://github.com/twall/jna) and take a look at the following page. It might be a useful point to start from.
http://www.digitalinferno.com/wiki/Wiki.jsp?page=JNAPrintDevices
I am looking at Java Native Access as it provides access to the windows API from pure Java code - no JNI to deal with. I was concerned about the LGPL license; whether it can be included in a commercial product but from what a few posts in the newsgroup say, it can be.
After I try it out in the next few weeks, I shall post back here.
Related
I have Java application using Futronic FS80H.
Working successfully with one device.
But now i have 2 of them plugged in the same PC.
I want one to enroll, and the other must only read.
But i can't find a way to diferentiate them.
I'm using the SDK Worked Example for Windows, available at https://www.futronic-tech.com/download.php, and building my software upon that.
Can someone help me?
I got in touch with tech support via the email inquiry#futronic-tech.com.
Team futronic were very kind and supportive and helped me to accomplish the taks.
There's everything available in their dll api, and they sent me access to their ftp with Java code example to handle multiple FS80 readers plugged in the same PC.
I would like to thank team Futronic.
Let's say I have a USB magnetic card reader
(http://image.ec21.com/image/szttce09/oimg_GC03950917_CA03950946/Triple_Track_USB_Magnetic_Credit_Card_Reader.jpg)
I am running windows 10 on my machine. All I want to do is read data from the magnetic card and use that data in a java Application. How can I do this ? I heard the java communications api is suitable for what I want. How exactly do I use this api or any other api to read data from the card reader and show that data in my java application. Assume I have eclipse opened. Now what? Do I import the communications api ? If yes , what do I do next ? If you can give a simple example of how to do this it would be greatly appreciated.
The first thing to do is search the internet for a Java library, which allows you to communicate with that device. Put in the model and serial number, and see what comes up. If nothing comes up, and that is quite likely to happen, you will need to find the native driver, and wrap it in Java.
This is not normally a straight forward or easy process. When dealing with third party hardware, most vendors don't supply a little Java library that you can use. If you can find the native drivers, you can wrap them from C to Java, but you might not even be able to find the drivers at all.
Start by going to the manufacturer's page, and looking around. If you find the driver, great. If you find documentation for the driver, even better. You will need to read the documentation, and understand how to use the driver from C code, which implicitly requires you to have a basic understanding of C.
Then you will need to link it in to Java, using the Java Native Interface.
In Summary: If it didn't say "For Java developers" in the description when you bought it, you're going to have to do a lot of work just to get it usable in Java.
I am making a secure application which should not run if the mobile device is stolen/lost, or the sim card is changed. If I programatically uninstall my app it prompts user whether she wants to uninstall it or not. I want this thing in a hidden way.
One more thing is to keep a file in assets/raw folder and when sim card is changed i must remove that file and my app will not run without that file. But deleting the files from both folders is not possible on run time.
All suggestions highly appreciated!
I know about password protection, cryptography, Pro-Guard, Dex-Guard, keep minimum functionality on phone. Guys I must need a way to remove the App! Please help on that point
Thankx in advance!
One more secure solution is to run your app on some Android x86 servers and to pipe in only the user interface to the phone.
Disclaimer: I've never used those guys, so I don't know how good they are. I just saw their lightning talk presentation at the most recent AnDevCon in San Francisco, and I just thought it was a clever idea.
One added advantage that this solution provides is that your employee's personal content doesn't get mixed in with the content of your company's. In hindsight, it's an old solution that has worked quite well for PCs and remote workers.
I'm not sure if this is exactly what you are asking for, but it may address your concerns. In general, the big concern with a stolen phone would be data. If you are concerned about someone else running your application, it seems that authentication should address that. A secondary concern is that someone could de-compile your code to learn details that could lead to exploitation. So here are 2 suggestions that address these concerns.
Use Progaurd to obfuscate your code. That way if the device is rooted and the APK is obtained, it cannot be de-complied (at least not into easily understandable code). Reference.
If you store any data in a database on the device, be sure to encrypt it. SQLCipher is a free library that will allow you to do so. Reference.
Answering some other interesting comments I was pinged about:
A couple of things:
I am that guy who gave the lightning talk in AnDevCon Stephan Branczyk mentioned, but I'm not a heavy stackoverflow user so I do not have the privilege to reply. 50 Upvotes for this comment and I may be able to answer inline :)
I will however give my insights on this, so if you are "paranoid" about security and want to read more about it from the founder of a "paranoid security vendor" - you can continue reading it.
Otherwise goto 7.
It is very important to understand that there is no catch-all solution - so do not be naive about it. All Android security best practices are great - but up to some point, as your Operating System (ROM, MOD,...) can, and will be compromised. I do not want anyone to panic - but there is NO perfect solution.
Stephan is right about Nubo's security design concept - if you violate the terms - your are out of the game. If you're out of network, or doing something suspicious - well - the device is not in control, no matter what. We aim towards satisfying both the user in their personal space, and the IT managers in the remote Android space.
It is very important for me to say clarify it is NOT a remote desktop. It's not even close to it - we have developed a Display protocol for Android from scratch - intended for the mobile environment. This is nothing like Remote Desktop/X11/VNC/... for "PC".
Should you need a "perfect" solution, you need to have a "trusted" device, which involves hard-core hardware support + secure bootloader + block verification chains etc. You can learn from the ChromeOS project if you are interested but I assume you are not willing to take it that far.
Answering the original answer: It depends on what phone. If you want
to use the PackageManager - you need your app to have a System
certificate, which means that unless you bundle it with your own
device, or do other tricky stuff I will not get into in this post -
you can't. What you can do is to use the BIND_DEVICE_ADMIN permission in your manifest,
and essentially register your app as an administrator (Something like MDM, etc.). Then, with some more trickery stuff you can handle your problem on the nominal case. You could bundle another app with that capability, and just invoke it from your app if you want to be on the very safe side.
*This post is already way too long and referring to too many questions so if you have further questions please go ahead and ask. I will try to reply before 2014...
step 1 : write a process to run in background
step 2 : make the process be active when cell starts
step 3 : check for internet connection or balance
step 4 : if internet available mail yourself phone specific details like IMEI ,MAC ,IP whatever you think is important ,
step 5 : locating GPS location would be very helpful
step 7 : recieve these mails from the mail id registered in your app
My boss has asked me to implement a project that includes writing a "mobile code" using java programing language. This code will be transferred on the network of nodes ,going from the source code node to other nodes, and at a point returning to it with certain information.
Since its the first time somebody asks me to implement a networking project ..i have no idea what "mobile codes " are.
So i tried to do a lil research and it turned out that "mobile code is software transferred between systems, e.g. transferred across a network or via a USB flash drive, and executed on a local system without explicit installation or execution by the recipient." (from wikipedia)
however i couldnt find anything useful related to mobile codes transferred on the network that explains them in details and that gives open source examples so i know what kind of programming i will be doing.
all im asking for is to give me resources ( urls, books, .. ) just anything that i could read, understand and build upon.. because at this point, all i know about mobile codes are the definition i pasted above !! thank you :)))
PS: please let the resources u;ll be giving me be specific to the project i have to implement.
lookin forward for you replies :)
Assuming I understand your boss, what he wants are "agents". There are several libraries to make writing agents easier.
IBM's aglets
JADE (Java Agent DEvelopment Framework)
JavaTM
Did you ever see The Matrix? The description Morpheus gives Neo for "agents" describes software agents much more closely than it does government agents.
I am sure JADE is active, but not very sure if Aglets are still maintained.
Just wondering if it is possible to access the Mac OS X Address Book API's from pure Java 6 code? I want to keep this completely platform independent as my program is built for Windows & Linux also (open source & free: http://jsmsirl.sourceforge.net/).
Any help is much appreciated!
There is no way, as far as I know. Apple has a guide for accessing the address book through JNI though, which is available here. The sample code for MyFirstJNIProject is available here.
The guide also shows how to check the underlying operating system and only call the JNI code when running on Mac OS X platforms.
sqlite3 AddressBook-v22.abcddb
and You have access to all data from Address Book, now some SQL statements and You're done:
select * from ZABCDCONTACTINDEX;
for example
HF
I figured out a way of doing it by using the Rococoa library.
I've described how it's done here.
I know previous post (the one downvoted to -1 about sqlite3) isn't related to the question beeing asked (and also isn't this one), however it was helpful for me. I'm working in a program where I'm given a .abbu file and I need to import the data to my product AddressBook and that post was my "salvation".