java application connecting to a server
I don't know how or where to start so ill present you with a scenario and hopefully youll tell me how i can do this using java.
i start my java application. the application manages pictures. lets say i change the name of hte picture or even edit the pic itself. then i press upload. a small pop up window appears asking me to enter my login info. i do so and press CONNECT. the application connects me to a server and uploads the picture to it.
thts it.
how do i do this? i already wrote the code that handles the pictures. searching sorting etc. but how do i do the connection part. the server is a new pc that ill b buying next week. ill read on how to turn a pc to a server. but after that im totally clueless.
Help?
i saw some sections that i could post this in but i realy am new to this. i wouldnt even no where to post it really.
Re: java application connecting to a server
You'll want to look at the Socket Class. It tells you how to set up a Java socket to a server. I'm not positive, but I think JavaEE is designed to allow for easy development of server and client software. If you want to quickly develop something, it may be worth it to look into JavaEE.
Re: java application connecting to a server
There are some semi-good tutorials on networking out there.
Writing the Server Side of a Socket (The Java™ Tutorials > Custom Networking > All About Sockets)
You could of course use some JavaEE if you wish and just have your client connect using RMI etc. However if you are passing this data straight over the internet you might want to have a look at sockets and I guess that would be the best newbie way to go as well.
You can also have a look at Apache MINA - Index
// Json