React Native mobile App - best approach to internationalise images - react-native

what (libraries, principles, techniquess, tips&tricks ) do you use for image internationalisation in your mobile apps with React Native?
For example image where is poster in different language.
I'm coming from Android world and there it is done like this (just add the locale to drawable folder and best fitting image for phone setup is then taken):
src/main/res/
drawable/ = any universal
drawable-hdpi/ = any universal for hdpi
drawable-sk-hdpi/ = override specific when locale is set to sk (Slovak)
Is there any similar solution, or do I have to write it by myslef (I can imagine simple library)?
DISCLAIMER: the boy on picture is not smoking, he holds flutter - a device used by people with respiratory conditions to help loosen secretions (phlegm) in the chest.

Related

React Native and support for Android Auto, Apple CarPlay, and wearables

I'm about to begin building out an app using React Native. It's a simple audio player that plays music. However, on top of having an audio player in the app, I would also like to support:
Android Auto
Apple CarPlay
Wearables
Does React Native support these platforms out of the box? How good is the integration? Will I run into many bumps along the way?
Thanks!
About Apple Car Play you can use react-native-carplay, but before use it I see expo tag in your question if you are using expo to create you application it's not supported in a expo. read this article to know more how implement add Car Play to your React Native App
about wearables check the repo to know more.
How good is the integration? Will I run into many bumps along the way?
If you are using TypeScript it's will be easy to do, and you have much repos and articles explain how to implement those packages with mobile application

What is meant by Flutter's widgets aren't really adaptive

I have been trying my hands for POC on an idea and trying to find languages which can support Mobile app development (Android/IOS) via single source code.
I zeroed on React-Native and Flutter.
What I found that for React-Native you still have to write code which is platform specific. Components need to be written differently for IOS and Android.
Then I looked in FLutter and I found that - "Flutter's widgets, however, while there are more of them, aren't really adaptive".
I am not able to understand it and what it means.
It would be really helpful if someone can help me with example or guide me to good reference.
In Flutter you have different sets of Widget Collection:
Material Widgets: Android-style
Cupertino Widgets: iOS-style
And lots of Widgets which aren't bound to one of those styles.
With this you are able to create a application looking like any style on any of the available platform. Therefore you can also have iOS-style Widgets on Android and vice versa.
If you want to have iOS Widgets on iOS and Android Widgets on Android, you'll have to create some conditional rendering, which decides wether to render iOS or Android components.
Sidenote: The Material-style Widgets look also really good on iOS. Also you can use a ton of other Widgets to create an UI in your own style.

React Native inputs on iOS and Android

I've been evaluating React Native as a replacement for Cordova, and was wondering if there is a widely accepted solution for styled text inputs. I'd like to see text inputs rendered in Material Design on Android, and Apple style on iOS.
Do you have recommendations for a specific library, or will I have to write my own/combine multiple libraries? Thank you!
You could check out https://nativebase.io/ it supports platform specific default styling there are others as well like https://react-native-training.github.io/react-native-elements/ and http://www.xinthink.com/react-native-material-kit/ which has consistent styling regardless of platform.
Coming from a Cordova/Sencha Touch background I suggest you try to create your own style using only the default react native components, the reason is that before I was having the same question regarding component library that I could use so that I could target all platform at once, but react native isn't 100% cross platform and learning to style on different platform might give you an idea and feedback with your evaluation, unless your aiming to have a project as soon as possible and that is a different story.

White labeling React Native apps

There is some information here already: White labeling an iOS app
I was wondering if there any workflows for white labeling a React Native app?
Basically if I had a core app for the app store. I would like to create white labeled versions (iOS + Android) with some modifications.
I found the project a project called white-label-app in github, I believe you can inspire yourself looking this project closer (and use them as boilerplate).
I'll try to use the majorajs, the idea of this package is "Manage white-label or skinned versions of your React Native app", sounds good for me.
You can use a combination of the React Native Bridge & product-flavors/targets to achieve what you want.
The process is extensive to setup, but once you have it setup it is very easy to add new white labelled apps to it.
I wrote a blog post that goes over every detail if you need a step by step guide.
One approach would be to use Fastlane together with react-native-config to provide values from the environment.
I wrote up a more detailed blog post about it here that explains my approach:
A React Native White Labeling Journey
I'm building the app through the CI which runs my Fastlane script, which parses the unique git tags for each app, building the appropriate app and distributing it to AppStore / GooglePlay.

Different UI for Android/iOS in interpreted JS cross-platform tools

Some cross-platform tools (like Xamarin native and RubyMotion) allow the development of two separate views for Android and iOS, while keeping the business logic shared for both of them. Others (like Apache Cordova or Xamarin.Forms) share both UI and business layer, with the option to use platform-specific overrides when necessary.
What is the state of the interpreted JavaScript frameworks (NativeScript, React Native or Appcelerator)? Are they all focused on creating single UI with platform overrides, or do they allow creating two separate views for each platform? For example, is it possible to create a view using Fragments in Android, but a different view on iOS (since Fragments do not exist there)?
Cordova uses WebView, that mean GUI level will be the same for both Android and iOS but different per Device version. In case of Android each client has own Chronium version and it can break UI behaviour. So developers use Crosswalk to set fixed Chronium version. (extra 20M to your application).
BTW Ionic that uses Cordova architecture uses native behaviour per platform. For example for Android Tabs located at the top, on iOS - at the bottom
On other hand Xamarin (C#), React-Native(JS) and NativeScript(JS) call native APIs. They don't use WebView but generate Native code.
For example if you create button - it will look different: on Android - material theme, on iOS - iPhone theme
Anyways, the bottom line is: everything depends on resources and time. If you want to build application fast, with the same view - I would go on Ionic2+ Angular2 + Cordova.
If you you have more time - go on React-Native or NativeScript (Still has poor documentation) or Xamarin (C#).
React-native's slogan is Learn once, write everywhere. So, you can choose what suits your needs, you can:
Share UI between platforms.
Share Only business logic.
So, the answer for react-native is yes. You can create separate UIs or you can share it.
Since you are writing components, one way of separating this logic is to write component.android.js and component.ios.js and the platform loads the appropriate one for you. Note that you can also do that programmatically.
You can see that in action in the official f8 app made by facebook using react-native