Accessing native API/system from Sencha Touch

拟墨画扇 提交于 2019-12-08 03:12:25

问题


Sencha Touch is quite perfect for my project. But in order to call a driver for an hardware barcode scanner on iOS and Android, it would be necessary to have access to the underlying system.

Is that somehow possible with Sencha Touch itself when "transforming" it into a native app (the Sencha SDK allows this)?

I know that it is possible with PhoneGap. But I'm afraid using all these technologies together (PhoneGap + Sencha touch) could make the UI less responsive, but that is a decisive factor in this project.

Edit: in this thread, a user says the following:

"you cannot access the native iOS file system, unless you use Sencha SDK Tools and native packaging"

So is it possible with Sencha touch?


回答1:


You have to keep two things separated, are you developing a web app or a native app that has a web app embedded? I.e. are users going to get to the app by navigating to a certain URL or are they going to download it from App Store/Google Play?

For native I would suggest using PhoneGap as the "shell" and use the bar code scan plugin that is available on GitHub

For pure web app development, the only thing I can think of is the Bar code Scanner service from ZXing which requires users to already have the bar code scanner installed (or redirects them to the appropriate store if I remember correctly). In this scenario you are however depending on ZXing to maintain their open service and any changes on their part could have a direct impact on your app.

Hope this helps you!

Edit after comment from OP:

Ah so you need general access to the native environment. As for as I know there isn't a documented way of accessing other native components other than those specified in the Sencha Docs it seems to be on the way according to mitchell at sencha.

The question is really though if Phonegap makes a less responsive app than the Sencha Mobile Packager. Both creates a shell application that invokes a web view and I haven't seen any performance tests between the two.



来源:https://stackoverflow.com/questions/13176461/accessing-native-api-system-from-sencha-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!