how to get mac address

cwt

Active Member
Licensed User
Longtime User
I am creating an in house app to communicate with a soap server. In the app setup the user saves his username and password which is sent to the server for verification when he posts soap packets. I want further validation of the user and thought maybe sending the device phone number to be used for validation on the server but then tablets don't have phone number and I want the app to be used on both phones and tablets. So I figure every device will have a MAC address.

How do I get the MAC address of the Android device? I did a search and did not find an answer.

Of course, the MAC address will need to be saved in the users profile on the server so it can be compared to the device MAC address.

Thanks
 
yes - you are right - the phone, or maybe even the tablet, may not have wi-fi and would not have a mac address. But does a tablet have an Android ID? I need a unique device identifier whether the device is a phone or a tablet.

Thanks
 
Upvote 0
it is giving me the following error when I try to compile
Code: Copy
Compiling code.                         Error
Error compiling program.
Error description: Unknown member: getsettings
I am using Phone v1.75 lib.
Sorry my bad, its solved.
i was using p as phoneId. And not Phone. I changed it to phone...and its working...

Thanks.
 
Upvote 0
You can use ABWifi library.

ABWifi library can get mac address.
 
Upvote 0
That ID is unique to all devices and all devices have it.

I don't think.
Once while rooting my phone i bricked it :sign0137: .I downloaded original version by the device vendor then then unbricked it using Odin. When i checked old android id in a file i made and current android id both were different and changed.There are millions of android devices may be this new id will match any.

Since then i tried 2-3 times all times android id's were different.So i think that it is not unique for all devices it doesn't depends upon hardware.

And probably MAC address's are also changed and even they can be changed using superuser permission. :cool:
 
Upvote 0
You could use the Android ID (needs a reference to the Phone library)
Code: Copy
Dim p As Phone

MsgBox("The device's ID is: " & p.GetSettings("android_id"), "")

Hi NJDude,
the p.GetSettings("android_id") method, don't return me the MAC address.
How can I get it?
 
Upvote 0

Similar Threads

Replies
4
Views
3K
Replies
6
Views
11K
  • Question Question
Android Question MAC Address
Replies
1
Views
4K
  • Article Article
Android Code Snippet UDP Broadcast Address
Replies
0
Views
10K
  • Question Question
Android Question MAC address Android 6
Replies
12
Views
6K
Back
Top