As I have seen in the Forum, there is some need to get the Drives and Serial the easy way.
For my one needs, I have written a Library in Java to do this.
You need Java 8 for this to avoid problems.
Version 1.2 now also is giving back a return value.
You can use the Values from the Events or the Return Value.
It's easy to use.
Not much to explain here.
To use see Code part.
I hope it is useful to somebody.
For my one needs, I have written a Library in Java to do this.
You need Java 8 for this to avoid problems.
Version 1.2 now also is giving back a return value.
You can use the Values from the Events or the Return Value.
It's easy to use.
Not much to explain here.
To use see Code part.
I hope it is useful to somebody.
B4X:
Sub AppStart (Form1 As Form, Args() As String)
'******** Your Startup Code here ********************
Dim diskserial As DiskUtil
diskserial.Initialize("DiskSerial")
log(diskserial.getSerialNumber("c:\"))
log(diskserial.getAllDrives())
End Sub
Private Sub DiskSerial_result(Successful As Boolean, DriveSerial As String)
If Successful = True Then
Log(DriveSerial)
Else
Log("No Serial Found")
End If
End Sub
Private Sub DiskSerial_drives(Successful As Boolean, DriveNames() As Object)
Dim counter As Int
Log(DriveNames.Length)
If Successful = True Then
For counter = 0 To DriveNames.Length -1
Log(DriveNames(counter))
Next
Else
Log("No Drives Found")
End If
End Sub
End Sub
Attachments
Last edited: