B4J Library jGetMac (Gets MAC Address)

giga

Well-Known Member
Licensed User
This is a simple library that returns the MAC Address of the current PC. Designed to work on B4J
**Does not work on B4A**

example.
B4X:
Dim S As String
Dim ti As jGetMac

S = ti.MacAddressFromClient

lbl1.Text = S
 

Attachments

jmon

Well-Known Member
Licensed User
Does it work on Linux and Mac?

I think that if you have more functions like this, (like jDiskspace) you should regroup them in a library called jOsUtils or something like that.

Thanks for sharing, I will use it for sure :)
 

giga

Well-Known Member
Licensed User
I have not tested it on Linux or Mac, only Windows. I am in the process of combining libraries since JGetMac is a single return it makes sense to combine. I have a few more utilities coming to the forum. Just cleaning up the bugs before I release them.
 

tsteward

Well-Known Member
Licensed User
Does not return MAC Address on a MAC.:(
This is a mixture of window, android and the last one is a MAC
ScreenClip.png
 

tsteward

Well-Known Member
Licensed User
I have no idea I emailed my program to a friend to test my registration procedure for me.
Your library returned
MacBook-Pro.local: MacBook-Pro.local: nodename nor servname provided, or not known
 

giga

Well-Known Member
Licensed User

Nokia

Active Member
Licensed User
I get error if I have no active internet connection..

Program started.
Error occurred on line: 179 (Main)
java.lang.NullPointerException
at giga.getMac_getMac.GetMACAddress.getMacAddressFromClient(GetMACAddress.java:50)
at b4j.example.main._appstart(main.java:308)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:607)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:36)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
 
Top