Is there a standarized API for taking pictures using Android NDK?
Or is it really necessary to go through Java for that?
Yes. It is necessary to go through Java. Since NDK access will be specific to particular hardware.
Inspite there are few realizations through NDK.
Check the following links for relevant details.
http://nhenze.net/?p=253
http://osdir.com/ml/android-ndk/2010-10/msg00518.html
In Android 7 (API 24) Google has added support for native camera access (Camera2 API).
In ndk-r12:
Headers:
$NDK_ROOT/android-24/$ARCH/usr/include/camera/Ndk*.h
$NDK_ROOT/android-24/$ARCH/usr/include/media/Image*.h
Libs:
libcamera2ndk.so
libmediandk.so
1) There was an access to Camera.h in older releases like Froyo, 2.3.3.
Now, I see a Camera.h in KitKat, 4.4.4. It changed completely.
This is an unofficial API, so it's subject to change. Be ready to code and deploy different versions for different Android releases.
2) There is a Camera component in OpenMAX. People managed to create an OpenMAX recorder for Raspbery Pi. I yet have to find a working solution for Android.
These two questions are unanswered:
OpenMAX recorder on Android
Access camera via OpenMAX in Android
and I'm going to try OpenMAX.
3) We ran into an Android device where video4linux2 works (one can access /dev/video0).
Post Android 7 or API version 24 : Camera 2 APIs are possible not just in Java space but in the native(NDK/C++) space too. This article give you all the details with code.
Related
I was very tired when making a call recording application for Android.
I know the official Android SDK has not allowed using VOICE_CALL. So my recording is based entirely on the MIC source.
I tried the Android NDK but I also fell into a deadlock.
Someone, please give me away. If you have the source code, it's great. Thank you very much!
Android has officially blocked the SDK method since Marshmallow. After that a work around was introduced with the NDK to solve the problem. This seemed to work in android 6, 7 and 8. The NDK based approach is also blocked in Pie. So technically it is impossible to record calls.
Source
Record a call in Android could be a strenuous work, this because not all Android version support the call recording.
Question 1
Question 2
Question 3
So I'm trying to work on pure native android application as i need the performance of C/C++. I want to access the camera in a NativeActivity, grab the frames and process them using OpenCV and custom library. I have found multiple answers for using the new JavaCameraView with the cvCameraViewListener2 but in my opinion doing a JNI call to C++ everytime is completely unnecessary and time consuming - and a lot of the forums even post that JNI are expensive!
So my question is if there is either a way to integrate OpenCV in Android SDK Version 23 (6.0 Marshmellow) or another way of accessing the camera natively as i did not have any success finding an alternative. I am running android 6.0.1 on a Samsung Galaxy S7.
Thanks for your help in advance!
so incase anyone was wondering how i solved it...upgrade to Android 7 was necessary. Android 7 introduced NdkCamera headers as #y30 has answered in this post.
I want to work on SIP and Android. I am supposed to make it possible for two users to call eachother using iptel.org. One way to do this, I can use the demo provided with 2.3 but it needs a real device. As I don't have a real device, I wan't to work at 2.1 platform. I am a beginner, so I need a good step to start so that it would be easy for me to complete it.
PJSIP ( http://www.pjsip.org/) is a good and portable SIP framework. It doesn't still have support for android (even if it is just a matter of time) but you could check out this : http://code.google.com/p/csipsimple/ that is android SIP support built on PJSIP.
Android 2.1 doesn't have built-in support for SIP so you have to find a third party library.
JAIN-SIP http://jsip.java.net/ is also a very good SIP-Stack including a reference implementation of the SIP API.
It works on great on Android <= 2.2.
Here's (http://groups.google.com/group/mobicents-public/browse_thread/thread/e38fbdd874083d49/4fdb4123419e7a74) a nice discussion with further information.
Im long time c++ developer . and I like to start to develop 3d applications and games for the android , now I do know I wil be limit with java VM
So I like to start to develop with c++ with the NDK API , before I start , what version should I start to develop ? 2.3 ? can I do complete application just
With c++ ? what problems should I expect ? can you please point me to articles on the subject.
You can write a complete android application only using c/c++ code. But i would not recommend it due to the fact that you have to use android 2.3 or above and we all know that most android devices out there today, are likely to not ever receive the 2.3 update.
I would recommend you to use android 2.0, because android 2.0 have support for OpenGL ES 2.0 (only) in native code. The three limitations that i know is that you have to "start" your app in java code, you have to grab input in java code (not 100% sure of this) and you have to handle audio in java code. Although you can handle audio in native code if you are targeting android 2.2 and above, but again i would not recommend it since there is a lot of devices out there with 2.1.
Hope that answered some of your Q:s, sorry for tha bad English btw.
Edit: download the Android NDK and read trough the docs, that might clear more things up for you.
I currently have an app on the market that supports Android 1.5 (SDK level 3) and up. It also takes advantage of several features that are only present in Android 2.0 (SDK level 5) and up. I do this using Reflection.
I read a post on the Android Developer Blog that talks about how to support these new features while using no Reflection, which would be amazing.
http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
I have tested this out and while it works there is one huge downfall. Currently if I try to add a SDK level 5 class, but I don't know that it's a SDK level 5 class, there is no worries. Eclipse isnt going to find the class and I'm not going to be able to add it.
Using Google's recommended method does allow me to add the classes and gives me no notification that this code is targeted just to SDK level 5 users. This opens up too big of a possibility of adding in code that would break some users without knowing.
Does anyone know of any plugins, options, etc that would warn me at the places I have targeted SDK level 5 to keep this from happening?
One possible way, and I havent tested this, would be to individually change Android manifest file and set android:targetSdkVersion to each SDK and try to compile. That way you will be able to sequentially test out each SDK support.