简体   繁体   English

如何编写虚拟键盘并在Android,iOS和Web应用之间共享

[英]How to write a virtual keyboard and share it between android, ios and a web app

Can this be done with any of the popular multiplatform native app development tools? 可以使用任何流行的多平台本机应用程序开发工具来完成此操作吗? React Native, Angular with Nativescript, etc. Is there another approach you would suggest? 用Nativescript响应本机,Angular等。您会建议另一种方法吗?

I'd like it to be a first class keyboard for Android and ios and an inapp keyboard for web. 我希望它成为Android和ios的一流键盘,以及Web的inapp键盘。

Basically I have an idea for a custom keyboard for domain specific communication. 基本上,我有一个用于域特定通信的自定义键盘的想法。 I want to get something running and play around with it and test out new ideas. 我想运行一些东西并试用它,并测试新想法。 And I'd like to use it in my daily life for texting on my phone and my PC. 而且我想在日常生活中使用它在手机和PC上发短信。

I want special buttons thay type whole terms/sentences. 我想要特殊的按钮,可以键入整个术语/句子。 A search feature on the keyboars for the terms/sentences, etc. 键盘上的搜索功能,用于搜索术语/句子等。

您可以使用React Native Everywhere来开发虚拟键盘。只需遍历此库,如果您对React或React Native有一些了解,它就非常简单

I don't think it's possible to write once that runs everywhere at least when you want to customize / build your own virtual keyboard. 我认为至少在您想要自定义/构建自己的虚拟键盘时,编写一次可以在任何地方运行的代码是不可能的。 Because iOS and Android has it's own api definitions to customize keyboard. 因为iOS和Android具有自己的api定义来自定义键盘。

Using either ReactNative or NativeScript, it's possible to achieve what you are looking for if you have good understanding of writing native plugins in these platforms. 如果您对在这些平台上编写本机插件有很好的了解,则可以使用ReactNative或NativeScript来实现所需的功能。

I would recommend NativeScript over ReactNative as NativeScript is one supports the concept marshalling , so you still use JavaScript as your programming language to directly access any native apis. 我建议在ReactNative上使用NativeScript ,因为NativeScript是一种支持编组的概念,因此您仍然使用JavaScript作为编程语言来直接访问任何本机api。 TypeScript definitions for native apis makes it even more easier for web developers. 本机api的TypeScript定义使Web开发人员更加容易。

Unlike in ReactNative you must jump between JavaScript / Objective C / Java to write a plugin if you want to access any native api or component that is out of box. 与ReactNative不同,如果要访问任何现成的本机api或组件,则必须在JavaScript / Objective C / Java之间跳转以编写插件。

I know this is not the exact answer you are looking for, but I believe at least you can choose a platform of your comfort based on this information. 我知道这不是您要查找的确切答案,但是我相信至少您可以根据此信息选择一个舒适的平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM