How is it possible to save a file to the android phone rather than the sdcard? I know that for sdcard the way you do it is by calling Environment.getExternalStorageDirectory().getAbsoluteDirectory(); or something like that anyway I have it working that way. But I want to be able to save to my phone instead, do I need a permission in my manifest to do that? I have tried replacing the getexternalst…. to getDataDirectory instead but that didnt seem to work.
As always, please and thank you 🙂
EDIT—————
03-15 21:29:26.213: W/dalvikvm(21686): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
03-15 21:29:26.213: E/AndroidRuntime(21686): FATAL EXCEPTION: main
03-15 21:29:26.213: E/AndroidRuntime(21686): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.alphaphonefinder/com.alphaphonefinder.Main}: java.lang.NullPointerException
You can use
Context#getFilesDirTo get the full path as String (assuming
thisis the Activity):