i do some changes. and:
1. get longitude and latitude information seems to be correct
2. the output stream needs not to be closed immediately, but be closed
when the service is stopped, so the output file will not be covered