out of memory in react native android - react-native

[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).

Related

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 packager: how to have both platform and retina suffix

As explained here the react native packager works well for images with retina suffix (#2x and #3x) and platform specific suffix (.android.png, .ios.png etc.) when used individually but it fails to serve retina images when both are used at once. I tried mixing them both ways both image#2x.android.png and image.android#2x.png but only 1x image is loaded on all devices regardless of device's pixel density. I'm importing image like import image from './images/image.png'. I tried searching for this on Google and in the react-native issues but couldn't find any helpful info.
Is it a bug or I'm doing something wrong? If it's a bug then is there a workaround? If I'm doing something wrong then what's is it? I do not want the ios specific images to be bundled in android and vice-versa.

How To add Focus, Brightness and Zoom controls to react native camera?

I used react-native-camera on my iOS app and now trying to add Focus, Brightness and Zoom controls to it. So far I was unable to come up with a solution. Any idea how to do this?
I tried to find an option in different react native camera packages. Also posted in their git repos for help. Finally tried this post: https://medium.com/react-native-development/react-native-camera-app-with-live-preview-saturation-and-brightness-filters-d34535cc6d14 Where they take a photo from the camera every 5 milliseconds and adjust its brightness which seems to be very unstable and it makes the app crash.
It is not possible to use the focus and zoom functionalities with react-native-camera.
Unluckily the focus api has many bugs and the zoom functionalities will not render fast enough with javascript.
Maybe a solution is not using react-native-camera and instead just writing an intent to open the default camera application
The following app uses this solution, all the camera functionalities work perfectly.
Could they re-open the issue as it seems to not be solved?
Developers may need to review all the open issues to estimate the project deadlines.

How to add custom image on native map in Titanium?

currently i am working on native map in Titanium for android and iOS.
you might have seen native maps on which a custom image layer or layout is being displayed, which will rotate and zoom according to the user input (currently i am not talking about annotations)
i have tried using annotation map tile too but it doesn't seems to work as the native map app i have seen
if you have any question or are not able to understand my question please let me know so i could clarify and get solution for one of you
Update:
Can you give a better explanation of what you've tried?
you might already know about mapbox.com and leafletjs.com, by using their library we could make customize maps and offline map in webview but i am looking for some Titanium module which could help me use native map of iOS and android for performing similar functionalities(i am avoiding commercial library and plugins as my app is not commercial app). i want to create map tiles which could be used for offline purpose as the user would have downloaded with the app.
what i have tried yet!!
1: http://i.stack.imgur.com/CLiNh.jpg
2: http://i.stack.imgur.com/QOLO7.jpg
in first image link i have given image in which i showing screenshot of map with rotation (if you notice compass) and the map tile moved accordingly to it
in 2nd image ... i had put a map tile using createAnnontation function, but unable to fix its layout remains same and it doesn't resize when i do zoom in/out too
I assume you are talking about custom tiles on top of a MapView.
There is an example module for iOS at https://github.com/benbahrenburg/benCoding.Map which used the Titanium map module as a base. It is a bit dated, but see the TileOverlay example and code and it will get you on the right track.
The best tutorial I've found on how to create the tiles is at http://www.ericbinnion.com/creating-custom-overlays-for-ios-mapkit-framework/
I've tried to create a similar TileOverlay functionality by forking the Android map module with limited success. I never got it to work as well as the native maps.
You could also check out using Mapbox with Titanium. There are great tutorials and tools for creating your own tiles layers and manipulating existing layers. Adam Paxton gave a great demo of it at TiConf in New York this year.

Performance tuning for iOS Leaves Page Flip Transition

I am using the GitHub leaves library to implement a PDF Reader with page flip transition. Every thing is working perfect in iPad/iPhone simulator. But when I installed the same on device, the page flip transition on landscape mode is getting slowed. ie, When two pages are showing. Can anybody give me any suggestion to solve this issue.
Thanks in advance.
Are you reading your PDF images from disk as the user flips? Preloading them in the background could help speed things up.