Implement camera preview in native and use in flutter - android

I want to implement a native android camera preview (using c++) and display this preview on a flutter application.
I couldn't find any direct possible way to do so - up to this point the only solution I could find (which I still am not sure if it will work and think it might be too complex) is the following:
Implement a native stream using ACameraCaptureSession_setRepeatingRequest and ACameraDevice_createCaptureRequest, pass it to Java, and convert it to an android view, and then using Flutter's PlatformView.
As I mentioned, I'm not sure it will work, and even if it does, I wonder if there is some simpler way to do it.

Related

Prevent rendering mediapipe on android

the title says it all. I want to try mediapipe specifically facemesh on android. The problem is I just want to calculate face landmarks on the background and decide more things later (like showing text of landmarks coordinates, or any other ratio). I don't want to show the opengl rendering. I tried to comment this part but still doesn't work
// glSurfaceView.setRenderData(faceMeshResult);
// glSurfaceView.requestRender();
I'm thinking of using normal view or GlSurfaceView instead of SolutionGlSurfaceView but it doesn't work. I found a similar qna How to prevent face detection bounding box from being drawn in mediapipe android
but the answer recommend me to edit compiled class and I don't think android allow me to do that. Android only allow me to extend a compiled class and use it specifically. Problem is the class I need to extend is so deep so I need to also extend all class using that class, moreover it's a C script/class and I'm not sure Android allow me to extend it easily.
Any of you find easy ways to do what I'm trying to do?

svg manipulation (with user interactions) in flutter

I have built a web based light SVG editor with simple functionalities such as (resize, rotate, dragging, coloring) using HTML canvas and fabricJS. Now just by curiosity i want to create a mobile app to this web based platform. started searching for alternatives or something similar to fabricJS in flutter but i had no luck.
Also searched for many solutions and i have never found something to serve this need in flutter or Native Android nor Swift, But I know it's possible there is canva who made something with the same approach but i couldn't find a way to know there secret sauce.
So, my direct question is if there an html canvas like in flutter and even a canvas-svg (and svg-canvas) parser.
Flutter doesn’t have SVG support and will never officially support it due to its performance.
Your best bet is to use CustomPaint for rendering the vector, then use SVG.js with js interop when it comes time to export the SVG. Not a simple solution since you’re having to work around lack of official support, but for basic functionality it should be completely feasible.
If you’re wanting to support importing vectors, you might want to check out flutter_svg’s code to take a look at how they handle SVG. This library only supports rendering SVGs, not manipulating or exporting them, but it may have some helpful code to point you in the right direction.

React Native Camera View

Question regarding using React Native. Is it possible to develop an app where it will record a video only without a camera view? Basically, an app that is just a video recorder without a monitor to see what the camera is seeing. If yes, I would appreciate if you can share a little bit of an idea on how to go about it.
Hiding it from the phone's viewing area whether by position, or giving it a width or height of 0, or making it transparent are not the kind of solutions that I'm looking for.
If you are expecting a module from RN in JavaScript that would allow you to do that, then I believe that module is not around. At least in the official framework.
What you could do, is to create a NativeModule. RN allows you to actually execute native code from Android and iOS and then communicate through a bridge.
You can see how to create this modules here: https://facebook.github.io/react-native/docs/native-modules-ios.html

Current page using MuPDF

I'm using MuPDF to open and edit PDFs in my android application, but I need of some way to get the current page in a bitmap format.
I've been reading the code, but I've not succeed. Someone can help me?
We have a similar feature in our Android customizable magazine app, using muPDF: we generate page thumbnails in bitmap format.
This app is open source and available on Github. You can see there how we implemented this feature.
The MuPDF API is a C level one. It's certainly capable of doing what you want - see apps/mudraw.c for code that does this, or even doc/render.c.
In the example android viewer, we needed to be able to do some things from java. So, we wrapped up a small fraction of the API with jni and exposed that (see android/jni/mupdf.c). This does just enough for what we need, and nothing more.
If you want to get access to parts of the API that aren't exposed, (and it sounds to me like you do) then you'll have to wrap up that for yourself.
In an ideal world, we'd have it set up so that there was a direct mapping from java classes down to the underlying MuPDF API, but we haven't had the time/need to do that yet. If anyone out there is interested in doing such a thing, do get in touch...

Android Native Functions

I'm trying to create an active reading application prototype for my course project in Android platform. I'm new to Android SDK, and I cannot figure out how to use WebView's native functions, because I need to use them to implement selecting / highlighting / copying texts using gestures. I saw that WebView has a function setSelection but it's private and I cannot use it.
But I think may be there is something that I miss. May be I need to use something else. Please, give me some suggestion, links, books where I can find useful information.

Categories

Resources