Skip to content

Commit

Permalink
(wip) add export save functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Mar 20, 2024
1 parent bddb1ea commit 3508e81
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,27 @@ protected void onCreate(Bundle savedInstanceState) {
makeShortcut();
});
findViewById(R.id.export_save).setOnClickListener(v -> {
String appPath = FileUtils.getPrivatePath();
String inputPath = FileUtils.getPrivatePath() + game.getTitle() + "/SaveData";
String outputPath = "/storage/emulated/0/";
String outputName = "export.zip";

// Create an instance of ZipBuilder
ZipBuilder zipBuilder = new ZipBuilder(outputPath, outputName);

try {
// Begin the zip file creation process
zipBuilder.begin();

// Append files or folders to the zip file
zipBuilder.append(inputPath);

// End the zip file creation process
zipBuilder.end();

System.out.println("Zip file created successfully.");
} catch (Exception e) {
System.err.println("Error creating zip file: " + e.getMessage());
}

});

Expand Down

0 comments on commit 3508e81

Please sign in to comment.