James Ko
James Ko

Reputation: 34559

What percentage of Android phones are little-endian?

edit: This is different from Endianness of Android NDK because that question asks how to find the endianness, not how many devices are big/little-endian. Mods, please don't mark this as a dupe.


Just curious, is it worthwhile to support both big/little-endian Android phones? I have some code in my app that's endian-sensitive, for those of you who are curious it involves serializing a long to a byte stream. I think my phone is big-endian because ByteBuffer.getLong() is reading in a big-endian fashion from the byte stream I've written to.

Is it worthwhile to support big/little-endian Android phones? I'm not sure how common big-endian is compared to little-endian. Is there data available that tells us the relative percentages of each?

Thanks.

Upvotes: 10

Views: 3514

Answers (1)

yshavit
yshavit

Reputation: 43391

Android is always little-endian. This is documented on its page for ABIs (Application Binary Interfaces):

  • The endianness of memory stores and loads at runtime. Android is always little-endian.

Upvotes: 15

Related Questions