I've been searching on how to add a barcode scanner to my Java Project using my phone by connecting my software and scan the code using zxing app. Does anybody know of any examples or know how to do this easily? Any help is greatly appreciated.
Seems like you want to your database keep alive every time.I see two option there.
One Option
You have to keep on the computer where your wamp server run. Just like regular server. never stop keep running. This solution is some kind of stupid but its works for your problem.
Two Option
This is the best option. Configure your database in the hosting service. There are lot of free servers available.
Ex https://www.000webhost.com one of the free hosting services.
You can create free database instance using this service and map your db configuration details in your software.(host_url, username, password etc.)
you can keep on your db for ever.
Hard to understand what are you looking for but i think this will help you.
Related
I would like to connect a Java application to the Nest-Cloud via the Firebase-Api. The application is as simple as reading the setpoint of a nest thermostat.
I spent a lot of time on developer.nest.com and firebase.com to find the required information, but failed.
What is actually the base url, where the firebase is located? seems not to be home.nest.com
How can I authenticate without user interaction? I tried FirebaseSimpleLogin, but the implementation depens on Android, which is not my platform.
Thanks for your help.
For 1) I don't know for sure, but have you tried https://api.home.nest.com and https://developer-api.nest.com?
2) The user has to authenticate and allow the client you're developing at least once. You'll need to get an authorization code, which you get from the client page on the Nest developer site. The code is six characters I think, and you'll have to include that in your code or assign to a variable and call it.
Take a look at another entry I made. If nothing else, it might help you get a little farther down your rabbit trail.
I'm wondering the easiest way to go about this. I've used retro fit for java before to post and get from endpoints in web service my friend wrote in python.. However I've never wrote server side stuff. I have phpmyadmin running on a vitural server... Havnt used it yet however. I just need people to be able to like or dislike a poem on my database. I know how to create the database... What is the best way for me to do this? I've looked this up on Google with so many results but not sure where to start!
Found out the easiest way to go about a restful service. Google app engine! You can easily create endpoints and add objects like a breeze!
Now, I have some problems here:
I looked several times in Google and so on, but I can't find an "easy" way to get this done. And currently having a migraine... not helping me... though
I have a java eclipse program (Swing application to be a "controller" for production-machines).
I need to design an Android app, which needs to take data from the eclipse program in a wireless network (and also send them back).
Just found solutions like JPARSON or setting up a real server, but that is way too complicated... i donĀ“t need?! (or want :D ) to set up a whole website with php or something...
Can someone of you help me out with a better solution? It doesn't need to be code-specific, I just want to exchange like 10 strings for these machines.
If you want to exchange data you need a communication medium. The easiest way to do this is via TCP/IP protocol suite. If you decide on having a Server-Client architecture, your serwer has to listen for what phones have to say. He can do this by listening on specified port and you would have to handle "protocol", or you can use somewhat easier approach which is to write php script, or Java Servlet. PHP script is easier becaouse there is like a gazzilion php hosting providers and it's cheap. If you would like to write your own serwer, you wold need some sort of Virtual Private Server, and deploy your app there. Plus it would be helpfull if you explained a little more your environment and what you are trying to achive.
There's built in httpserver http://docs.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/index.html so you can easily implement a simple webservice in standalone java. Then just use URLConnection from android to post/get data, probably in json or your own format.
I'm starting a new project. It consists of:
Java desktop application downloadable from the internet with a client database.
PHP website on the internet with a server database.
The user who downloaded the app will use it to add items (not important what are they now) to the local database offline. When/If he is online, the item will be added to the server database so other connected users (through the desktop app or through the website) will see it.
I googled the issue and found it's more complected than I guess. One of the solution is to use some ready tools like SymmetricDS and Daffodil to gain in term of security, performance and scalability, but they're difficult to configure and install in both client and server side, and need the access to command prompt which requires me to pass to a dedicated host (well, that is not a real problem). Also, all what I want is just what I've described, not all what these tools actually provide.
Can I achieve that by myself within my Java application and maybe with the help of
the web server PHP?
I'm using MySQL for the info.
Edit: what really matters is to send items to the server database. Reading it can be less tricky using RSS Feed reading, for example.
Basically, you can use HTTP/HTTPS API. When a user online, send items to your php file and mark the items "sended" at local database. But you have to control edited or deleted statuses. So, yes that is much complicated but a solution.
Well the easiest solution that comes to my mind would be to save for each item a last edit date (on the server as well as on the client). Additionaly you have to keep track when a client got his last update from the server.
So whenever a client goes online the server sends him all updates.
But for that you have to make sure that the time on the client and the server are the same, and it doesn't solve the problem what happens if two clients edit the same item.
CouchDB solves the distributed synchronization problem very nicely, but it is a NoSQL DB. Depending on what your application should do, using it would boil down to using instances of CouchDB both locally inside very application, and on the central server.
You'd have to deal with conflicts nevertheless. The only thing CouchDB will support you with is easier detection of conflicts, and the data of both conflicting edits, so your application can work it out either automatically, or with user help.
On the other hand, generatin a unique id on the central server can be as easy as adding the creating user's id to each item id.
I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.
Extra details: The main part of the project is actually a device that I will develop that connects to the computer's usb port. Sorry if it was a bit vague in my original question. This device will perform simple functions such as turning lights on etc. At first I will just attempt to switch the lights remotely using the internet. Later on I will add commands that can control certain aspects of the computer such as the music player. I think doing a full remote desktop connection to control my device is therefore not quite necessary. Does anybody know of any open source projects that can perform these functions?
So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.
I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?
Thank you
VNC
SSH
Remote Desktop (Windows)
You can write a WEB APPLICATION. The encryption part is solved by simple HTTPS usage. On the server side (your home computer with USB devices attached to it) you should use Python (since you're quite experienced with it) and a Python Web Framework you want (I.E. Django).
While it is an interesting programming question, perhaps you should ask it on ServerFault instead? There you can probably get a lot of nice input on web-based administration / control tools.
Unless this is a "for fun" project for you, there are about a jillion things out there that already do this. And if you want to control a computer from a web browser, be prepared to require installing some kind of custom plugin - since browsers can't touch arbitrary files on the local filesystem, execute local applications, or do other things that are flagrant security risks.
I've been using VNC for over a decade - free and easy.
http://en.wikipedia.org/wiki/Virtual_Network_Computing
Well, I think that java can work well, in fact you have to deal with system calls to manage usb devices and things like that (and as far as I know, PHP is not the best language to do this). Also shouldn't be so hard to create a basic server/client program, just use good encryption mechanism to not show commands around web.
I you are looking for solution you could use from any computer anywhere in the worls without the need to install any software on client pc, try logmein.com (http://secure.logmein.com).
It is free, reliable, works in any modern browser, you don't have to remmeber IPs and hope they won't change, ...
Or if this is a "for fun project" why not write a php script, open port 80 in your router so you can access you script from outside, possibly dynamically link some domain to your IP (http://www.dyndns.com/). In the script you would just login and then for example type the orders in textfield in some form in your script. Lets just say you want to do some command prompt stuf, so you will basically remotely construst a *.bat file for example. Then the script stores this a fromtheinternets.bat to a folder on your desktop that is being constantly monitored for changes. And when such a change is found you just activate the bat file.
Insecure? Yes (It could be made secureER)
Fun to write? Definitely
PS: I am new here, hope it's not "illegal" to post link to actual services, instead of wiki lists. This is by no means and advertisement, I am just a happy user. :)