Skip to content

Commit 8b7ae97

Browse files
committed
Fixed Android mode
1 parent d6ee9bf commit 8b7ae97

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

app/src/processing/app/Platform.java

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -577,18 +577,25 @@ static public boolean deleteFile(File file) throws IOException {
577577

578578
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
579579

580+
/**
581+
* These methods were refactored to use the Preferences system instead of
582+
* actual environment variables, since modifying environment variables at runtime
583+
* proved problematic. This approach provides similar functionality
584+
* while being compatible with various platforms and execution environments.
585+
*
586+
* This abstraction maintains a consistent API for environment-like variable storage
587+
* while implementing it differently under the hood to work around runtime limitations.
588+
*/
580589

581-
// static public void setenv(String variable, String value) {
582-
// inst.setenv(variable, value);
583-
// }
584-
//
585-
//
586-
// static public String getenv(String variable) {
587-
// return inst.getenv(variable);
588-
// }
589-
//
590-
//
591-
// static public int unsetenv(String variable) {
592-
// return inst.unsetenv(variable);
593-
// }
590+
static public void setenv(String variable, String value) {
591+
Preferences.set(variable, value);
592+
}
593+
594+
static public String getenv(String variable) {
595+
return Preferences.get(variable);
596+
}
597+
598+
static public int unsetenv(String variable) {
599+
throw new RuntimeException("unsetenv() not yet implemented");
600+
}
594601
}

0 commit comments

Comments
 (0)