Is react native consumes more battery power? - react-native

My RN application is consuming more battery power of android and iOS devices. Can any one let me know why it is consuming more batter in comparison to native application?

I have encountered high battery consumption when I scrolled my infinite list made using default FlatList. It needed a lot of computations of layout so it loaded up CPU and that caused the battery go empty. I solved it by using recycler list view and preconfigured layout. In fact, every JS app will kick the battery harder than native

Related

React Native - How to process camera frames in real time while displaying them?

I'm making an app where I have a camera feed that should be displayed, where the frames of the feed should be processed in real time.
I was thinking of using native modules for the camera feed and processing, but afaik in order to show the frames I'd have to send them through the React Native Bridge, which has a low bandwidth so the feed wouldn't appear in real time.
So I'm looking at having the camera feed and processing on the React Native side, but I need a way of getting the individual frames to process them while also showing the feed in real time.
I know that there are barcode scanners in React Native, so it must be possible to build something that both shows a camera feed and processes its frames.
Any help or pointers would be greatly appreciated, thanks!

Native ui component drops frames on some phones

I am trying to work around the shadow limitation on react native for android. Basically I need box shadows. My solution was to build a native ui component (java) with which I can create box shadows.
Now I ran into a weird bug. In a bare minimum app, with nothing but just some navigation and the box shadow ui components, the navigation is extremely laggy/ drops frames, when the app has to load the box shadow component.
The weird thing is. This just happens on some phones. From my tests so far I can say the native component runs smoothly on:
Fairphone 3 (Snapdragon),
Samsung galaxy s21 (Snapdragon) and
xiaomi redmi note 9 (Snapdragon)
The app drops frames on:
Samsung galax s41 (Mediatek)
Huawei mate 20 (Kirin)
Samsung galaxy s7 (Snapdragon)
Does anyone have an idea what the Problem could be? Does it perhaps have something to do with the CPU?
I am really gratefull for every tip and idea. I really have no idea what the Problem could be.
Thanks!
You have a problem of optimization.
Try to do a Profiling of your app on different phones to find the process that is more time consuming.

React Native on Samsung Tab A is slow

I am currently developing an application in React Native. There is significant performance drop when I run it on a Samsung Tab A (buttons visibly lag when clicked, a 3D animation we have takes very long to load in, etc.) I tried running the same application on a OnePlus 6T, and all these performance issues are gone. Obviously, the specs are better on a 6T vs. the Tab A, but why would tasks like button clicks even lag? This makes me wonder if the Tab A can support React Native apps at all. Does anyone have experience developing on the Tab A with React Native and have any advice?

Is an app with +90 screens ok for react native?

I have a native app on iOS with >90 screens.
My client wants an android version and we might use reactnative.
Now the question: Is react native ok for an app with >90 screens?
there are no special navigation or animations effects.
I was reading about airbnb dropping react native
They had many reasons, one being the number of screens they use > 100... but with special customizations.
So, is it safe to use react native in my not so specialized app with lots of screens?
I'd say this is more personal opinion than a technical answer. Either way, I'll give mine.
You're not likely to see any performance deficit by using a high number of screens, especially if they all carry little amounts of logic, however from a design point of view it could get quite messy - is there a reason you'll need such a high number of screens?
You're also likely to find your navigation stacks become incredibly confusing with so many screens in each, you'd end up with a huge file and readability could become difficult.
Could you design in a way such that a screen can dynamically display this content rather than moving from screen to screen each time?
I'd say, unless you're looking at building an app as technically complicated as AirBnB, you could cut down the numbers. I built the mobile app for a large UK retailer and we managed this in less than 20 screens so it's definitely do-able.

out of memory in react native android

[MEMORY ISSUE ON ANDROID]
hi all,
We're developing the application called Pippip at pippip.vn . It works very well on iOS but it has the problem on Android, it's out of memory when we load more large images, does anyone know how to fix it? Thanks all
We had similar issues, fix here. Before rendering the full image, we compressed the photo based on the screen size to discard information that is not visible on the screen (resolution wise).