diff --git a/app/src/main/java/org/ratchetrockers1706/bluetransfer/BluetoothServerService.java b/app/src/main/java/org/ratchetrockers1706/bluetransfer/BluetoothServerService.java index 14fd8d6..0bbc31b 100644 --- a/app/src/main/java/org/ratchetrockers1706/bluetransfer/BluetoothServerService.java +++ b/app/src/main/java/org/ratchetrockers1706/bluetransfer/BluetoothServerService.java @@ -122,7 +122,7 @@ public void run() { charsRead += in.read(buffer, charsRead, length - charsRead); } if (charsRead == length) { - File myDir = getDataDirectory(); + File myDir = getUploadDirectory(); File outFile = new File(myDir, filename); writeFile(outFile, new String(buffer)); } @@ -308,6 +308,13 @@ public static File getDataDirectory() { return myDir; } + public static File getUploadDirectory() { + File directory = Environment.getExternalStorageDirectory(); + File myDir = new File(directory + "/Documents"); + myDir.mkdirs(); + return myDir; + } + @Override public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId);