John Dallman
2018-11-01 18:16:46 UTC
I need to get some kind of unique identifier for each of the Android
devices in my testing setup from native code. I need to be able to do this
on API 21 or later, on 64-bit ARM. The [ro.serialno] property will do
nicely, since that's what "adb devices" displays.
From a bit of searching, the recommended way to get system properties from
native code seems to be to use the functions in sys/system_properties.h.
__system_property_find() will find a property, and get a prop_info* for it,
but I'm floundering on how to get the string from that. The
__system_property_read_callback function only appears at API 26. The
obvious alternative is to use the deprecated __system_property_get(), but
is there a better way?
Thanks,
John
devices in my testing setup from native code. I need to be able to do this
on API 21 or later, on 64-bit ARM. The [ro.serialno] property will do
nicely, since that's what "adb devices" displays.
From a bit of searching, the recommended way to get system properties from
native code seems to be to use the functions in sys/system_properties.h.
__system_property_find() will find a property, and get a prop_info* for it,
but I'm floundering on how to get the string from that. The
__system_property_read_callback function only appears at API 26. The
obvious alternative is to use the deprecated __system_property_get(), but
is there a better way?
Thanks,
John
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgkbiPmjhhNUshfpmnEO%2Bq4w9AYHcoGa340EGzzfZ_OMYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgkbiPmjhhNUshfpmnEO%2Bq4w9AYHcoGa340EGzzfZ_OMYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.