I have this library that needs an additional file in json format only in B4J. Is there a way to extract the file from the library and copy it to the Files folder if the version of the file in the library is newer?
SP Ping allows you to run the ping command on B4A, B4J and B4I. The characteristics of each operating system require different external libraries and change the amount of information returned after execution. In red we show you the fields that are empty in each operating system. Ping Events...
You can extract the file from the library. but you only copy it to other folders as aeric said
B4X:
Dim r As Reflector
r.Target = Me
r.Target = r.RunMethod("getClass")
Dim In As InputStream = r.RunMethod2("getResourceAsStream", "/Files/" & "os.lang.ping.json", "java.lang.String")
Dim out As OutputStream
out=File.OpenOutput(File.DirApp, "os.json", False)
File.Copy2(In, out)
In.Close
out.Close
You can extract the file from the library. but you only copy it to other folders as aeric said
B4X:
Dim r As Reflector
r.Target = Me
r.Target = r.RunMethod("getClass")
Dim In As InputStream = r.RunMethod2("getResourceAsStream", "/Files/" & "os.lang.ping.json", "java.lang.String")
Dim out As OutputStream
out=File.OpenOutput(File.DirApp, "os.json", False)
File.Copy2(In, out)
In.Close
out.Close