简体   繁体   中英

What are the portability implications of using the NDK?

I need some operations that are to be performed on large long[]s to be very fast. The only option I can see is to use the Android NDK. Can anyone give a summary on what using the NDK does to my app in terms of which devices can use the app and what the implications are to maintaining my app?

I saw that you need to specify which architecture you want to compile your C code for, like ARM and Intel. What happens when new architectures for Android appear? Will I have to update my app every time a new architecture appears?

Can anyone give a summary on what using the NDK does to my app in terms of which devices can use the app

Only devices running on a CPU for which you have an NDK .so will be able to run your app.

and what the implications are to maintaining my app?

Testing on multiple CPU architectures may require hardware for each architecture. I say "may" because...

What happens when new architectures for Android appear?

...we really have no idea. Other than adding ARM7 support, the NDK has not changed its targets.

Right now, there are two major non-ARM platforms for Android that I can think of:

  • Intel Atom, being used by Google TV devices. At the time of this writing, the NDK does not support this. However, you can't ship apps for Google TV yet, either. So, it may be that the NDK will be updated by the time we get to write Google TV apps.
  • MIPS. At the time of this writing, the NDK does not support this. I have no idea what the plans might be in this area.

It is conceivable that emulators will appear to emulate those CPUs. After all, the existing Android emulator emulates ARM5. However, unless and until this happens, you will need test hardware for every architecture you intend to support.

Will I have to update my app every time a new architecture appears?

Only if you want to support the new architecture. Until there is a critical mass of devices for it that can access your app, any new architecture is not going to be terribly important. "Critical mass" could be from general device sales, or it could be because you strike an OEM deal to have your app bundled on somebody's device.

The code is simple though and will work on all archs.

Watch your endian-ness.

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