I have just bought a HTC
Desire from
Telstra. So as a result I have been learning a lot of new programming skills using Android and Java. One of the first obstacles I bumped into was when trying to write files programatically to the SdCard. I obtained the location of the SD card file using Environment.getExternalStorageDirectory but then when going to check if I can write to it using the canWrite method of File it always returned false. I read in a lot of places that setting the permissions in the manifest file for my project would resolve this. After some trial and error I found this is true, but the location of the WRITE_EXTERNAL_STORAGE in the manifest effects if it will function. See the picture below for an example.
For the past ten years I have been programming in c++, so one thing that is annoying for me is the lack of rigidly defined lifetimes of objects I create. I am used to having destructors let me free memory when objects on the stack go out of scope and I am used to being responsible for memory I am using on the heap and freeing it as necessary. In Java there is no use of the stack and anything I create may or MAY NOT be freed in the life of my program depending on the garbage collector. To me this seem like a feature designed for a dumber class of programmer and it takes away some power from me. Having said that I do appreciate that there are many tasks I can accomplish in a few lines of Java code that would have needed a lot of native code. Time will tell if it is worth it.