Android Question [SOLVED] Using Reflection to retrieve android.bluetooth.device.extra.DEVICE

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hi,

Please could you help me with using Reflection to get the MAC address when a device connects to a phone ? I have already tried with StartingIntent.GetExtra but I am provided only Null. The StartingIntent.ExtrasToString is Bundle[{android.bluetooth.device.extra.DEVICE=00:18:A4:25:A6:8A}]

Of course I was able to parse the string but the provided information change depending on the smartphone. So I would like to retrieve the MAC address for sure.

For example, I can test if StartingIntent.HasExtra("android.bluetooth.device.extra.DEVICE")
But StartingIntent.GetExtra("android.bluetooth.device.extra.DEVICE") returns null...

Erel mentioned the method in this post but I am not smart enough to understand how to use Reflection.

I have only found one post about Intent.getParcelableExtra. What is the <key> to use in the code ?

Many thanks
 
Last edited:

lemonisdead

Well-Known Member
Licensed User
Longtime User
Many thanks Erel. For some reason I missed this post
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…