In this blog I'll show how to host a Java Servlet in Apache Tomcat 7.0, build a basic android APP and then establishing communication between the two. I have come up with a basic android app "Double Me" for this tutorial, which just sends an integer to server and the server doubles it and returns it back to the android app.
Here is an easy and quick way to encrypt and decrypt data. I needed it for one of my project where I building an Anonymous Voting System on android. The technique shown here could be used else where on your Java projects as well.
Here is an easy way to upload any file from your Java application to a PHP site hosted somewhere. I had to do this for one my project in which I was required to upload a bunch of files based on a schedule of once in 24 hrs. I also had to implement a retry logic if the upload failed due to loss of network or some network congestion. I will blog on that logic some other time, but for now I'll show here how to upload a file from java and receive it in the PHP site.
This is a no brainer approach for getting CPU and Memory usage of the running processes under Linux. All we do is execute Linux shell commands programmatically in Java and extract its output. I had to use this when I was developing a monitoring software for Linux. Of course there are lots of libraries available to accomplish this and I ended up using them as well to complete my project. One such library is Sigar Api. Well, if you are forced to do it the crude way, you can use code below. However, it also is a good introduction for executing Linux commands from Java if you haven't done it already.