I am trying to implement a custom keyboard with react native. Can anyone provide me with any good packages or guide me in the right direction.
That's not going to work. There's several problems with this.
1)You need to have an InputMethodService. That means at best you could write a native app that has a ReactNative view.
2)Several of the IMS functions need to return a synchronous value. ReatNative works by running Javascript asynchronously on its own thread. There is no way to make this work.
3)Unless all your logic is in the native code, you'd need to be able to call react native when calls are made to the IMS. But that isn't possible in React Native as of last time I looked- RN can call out to native code, but there's no way to pass a function call through to react native.
The absolute best you could do is an RN view and all the logic in native code. Which would be painful and harder to do than pure native.
Then on top of all this- performance raises its head. Keyboard apps need to launch and display quickly, and preferably use as little memory and CPU as possible. Launch times and resource usage of RN apps are very high. It's a bad fit even if it was possible.
Related
I'm investigating integrating Flutter into existing iOS and Android projects. My main experience is in iOS, so this post will be from an iOS perspective. But feel free to substitute UIViewController for Activity/Fragment. I'll give some background on my current understanding, and will have my actual questions at the end of the post.
Our main use case is to embed small Widgets into existing view controllers. I've gone through the Flutter docs and guides and have successfully integrated with our project (it was actually pretty easy!) but have concerns with Flutter's overall design being incompatible with our desired usage.
It seems that Flutter would ideally like to be the entire UI for an application: create and start an engine on app launch, pass the engine to a FlutterView, and make that the root view for the app. Alternatively, Flutter seems happy to own whole flows in the app where you push a fullscreen Widget which does some work, maybe pushes/pops more screens, and eventually returns control back to the native app.
However, in the case where I have a native screen with some UI components where I want to also have a flutter Widget which displays some other data - e.g. a bar graph - it seems that I need to either create separate modules, or separate #pragma(vm:entry-point) functions in my Flutter project for each type of Widget (graph, in this case) that I'd like to display.
My understanding is that each of these Widgets would also need their own Flutter engine instance which loads the proper entry point/route to that Widget's main function which then calls runApp(MyWidget).
So on to my actual questions:
What are the best practices for embedding Flutter Widgets in view controllers?
Is this correct that to have a set of small Widgets that are embedded into a view controller, I'll need to create separate engine isolates for each one?
Is this even the right way to think about using Flutter? I know there are workarounds for engine startup latency with pre-warming and caching, and I could recreate the whole screen in Flutter. But I would like to preserve our native work where I can and have Flutter be an additive change.
Can engines be efficiently reused for separate vm entry points? Would it be "weird" to have a pool of cached engines that can be used on-demand (aside from memory pressure and thread limits)?
I'm still wrapping my head around Flutter, but I've been impressed with its capabilities so far! Please let me know if I'm missing something here.
For anyone coming across this in the future, as of Oct. 21, 2020, the use case of embedding multiple Flutter widgets inside of a native UIViewController is not encouraged. Doing this in a performant manner requires updates to Flutter to better share memory and threads across engine instances.
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
The jQuery Data Tables plugin is very good for presenting and manipulating tabular data. I haven't been able to find a comparable Android component. First, is there something turnkey comparable and I've just missed it?
Second, what is the Android best practice here? Is it advisable to merge HTML5 GUI elements (via WebView or WebViewFragment) in along with native Android, or am I going to run into hidden gotchas, e.g., activity life cycle corner cases?
I realize that there are platform independent approaches like PhoeGap/Cordova. This might still be a way to go, but I'm just a bit leery of the approach in general.
I'm planning to create a TV Guide app. The app has to interact with a server to get the data and display it in a timetable. The speed and UX are really important. Nothing flashy, I just want the page and state transitions to be very smooth and the assets/icons to look very good. Is it viable to use Phonegap for this app? I'm more proficient in HTML+CSS+javascript than Java/Obj-C but won't mind going native if it's the best way provide awesome UX.
You can totally do it with phonegap. I'd recommend using a javascript framework as well such as backbone.js for transitions and such.
PhoneGap just wrapps a native-app hull around a browser-application. This means: the phonegap-app must simulate a webbrowser and its javascript-engine. It does not convert your application into a real native app. This makes phonegap-apps slower than native apps.
I made bad experiences with an app that is scrolling through a long table of more than 1000 items, each of them holding five text-strings and two icons. Scrolling through the first 10 or 20 items was reasonable, but at item #50 it became really slow, and beyond item #100 scrolling was almost imposible.
So I wrote a native iPhone-App, and it scrolls at the end of the list as fast as at the beginning.
conclusio:
PhoneGap is fine for simple apps that need little resources. But when dealing with long lists or pages that are made of many different items, phonegap is considerable slower than a native app.
Really the decision to use phonegap comes down to abilities, resources and performance needs. Phonegap will be slower than native just by it's very nature that it's another layer on top of native whereas native is optimized to be as fast as possible. Then the second question is your resources. If you only plan on releasing to one platform and have the ability to build native, that could make the most sense. On the other hand if you don't have the resources and want to build to multiple platforms quicker, phonegap will definitely fill that need.
For frameworks, there is sencha, jquery mobile, Dojo Mobile (I find that framework to be the most difficult to use) and Kendo UI (newest of the bunch but not really free either).
And another great template start is to use Mobile Boilerplate to understand the best practices for an hmtl5 starting page.
http://html5boilerplate.com/mobile
if you use phonegap, it will be more easy to create the app for the other platformes(android WP7 ...)
but improving it will take you much more time.
because to have nice transitions and effects with phonegap , you wil need some libs and frameworks like (jquery mobile ,sencha touch ,dojo framwork)
I am about to decide which way to push our smartphone development.
I have read numerous articles about these technologies. I have also created test apps, but wanted to be 100% sure that I get this right.
I am not able to create EXACTLY the same look and feel like native app in PhoneGap because it runs in WebView Controler. And the webish look and feel is as far as I will get with this tech. correct?
(In the example app I have created with PG, the look might be similar, but there is a delay when i click on buttons and the animation is not so fluent as in native apps)
Latest Titanium seems to have changed its approach to WebView, to remedy that lack of look and feel of native apps. My question is (I havent tested this myself). Can I create EXACTLY the same look and feel of an native app with Titanium?
EXACTLY is the key word. I mean can a person tell a difference if app was created with Titanium? because I can definitely tell that app was created with PG.
Final goal is the UX, ppl sense this things, and on smartphones anything that is webish and is suppose to be appish is a bad UX i believe.
Thanks
Compared to PG Titanium is more Native like UI experience but it's kinda problematic for Android.Since it's originally intended for IOS.
Titanium for Android is pretty buggy and can mess you up and the thing that you have to come up with workarounds and if you cant find any then you are stuck.
But if you are okay with that and i can easily advise that Titanium is way to go though it's nearly native (not exactly) which close to exactly.I dont think an average user would understand Titanium .
2) yes, since titanium uses the original UI. your javascript code is wrapped to native Objective c code that creates native elements. only constraint is that your are not as flexible as with real native code written by yourself. but you can write native modules and add them to your projekt. so you're able to expand your project with custom UI too.