How to Initialize a DataOutputStream

DataOutputStream was added in API Level 1
Wraps an existing OutputStream and writes big-endian typed data to it. Typically, this stream can be read in by DataInputStream. Types that can be written include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and MUTF-8 encoded strings.

1. Declare a DataOutputStream named myDataOutputStream.

2. In the MainActivity.java file, in the onCreate method, add the line below. This will initialize the myDataOutputStream object to null.

myDataOutputStream = null;

3. Compile and run!

Resources:
developer.android.com/reference/java/io/DataOutputStream.html
http://android-er.blogspot.com/2011/01/simple-communication-using.html