Should I never use native (C/C++) libraries for interacting with devices?
Please read this question for a bit of background of what I am trying to achieve. While looking on internet for the answer I found this thread. In this thread a Google's employee says this about using native (C/C++) libraries for accessing camera
You CANNOT do that. Please, understand that Native APIS ARE NOT PUBLIC
(sorry for shouting).
All these APIS may/will go away or change in ways that will make your
application *crash* in the near future.
We are not, and will not, try to maintain binary compatibility on native APIs.
Y开发者_运维百科ou *can* use native code if you wish, but you ABSOLUTELY CANNOT call
into Android native APIs. That's a no-no. And you won't find help from
the Android team here about this subject.
My question: does this mean one should never try to deal with any devices like accelerometer, camera, compass, etc using native libraries in any case?
Yes. Just as he wrote, those APIs are internal, and might change between versions and models. Each vendor may change ANYTHING there, and soon enough your application will cease to function on many devices.
精彩评论