I was wondering if Android phones have a MAC address when connected to the internet over 3G? I'm assuming they do, so I guess 开发者_运维知识库my real question is whether or not there is anyway of accessing it? I haven't found anything from looking through the APIs or by googling, but maybe I missed something.
Thanks in advance
MAC address is specific to network technologies that implement the IEEE 802 standard, such as ethernet. 3G is not an IEEE 802 network, so MAC address really doesnt apply.
That said, there should be very few reasons to use the MAC address in your app, unless youre writing a network driver or doing something specific with the TCP/IP network.
Often people reach for MAC address thinking that it represents a unique device id, when really you should use something like http://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID to get a unique id that will work across all of the different hardware combinations for android, some of which might include no IEE 802 network whatsoever.
I have never seen any reference to a 3G MAC address anywhere. The closest thing to a 3G MAC address that I know of is the IMEI/MEID code.
android.telephony.TelephonyManager.getDeviceId() will return the IMEI/MEID code.
If you are trying to uniquely identify app installs then see: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html
精彩评论