简体   繁体   中英

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.

Almost all of the supported architectures are little-endian, with one possible exception.

Android lists its supported ABIs (Application Binary Interfaces) here . There are essentially three categories:

  • ARM-based; and for those the page says the each "follows the little-endian ARM GNU/Linux ABI."
  • x86-based; and those are all little-endian
  • mips-based; the page specifies that standard mips is little-endian. It doesn't say anything about mips64 other than linking to its official page

So mips64 is the only question mark. It supports a bi-endian architecture. It seems the first mips64 smartphone chips came out in 2016. I couldn't find which (if any) phones actually use this, but it doesn't seem to be very common.

As to whether it's worthwhile to support both: that's a judgement call you'll have to make. Who knows what the future will bring?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM