Cordoba: can I display my own application component in a div?

I am considering using Cordova to create a mobile application. The main driver is that I want to be able to port my application to multiple platforms without overwriting the presentation level. I like Angular and jQuery Mobile, which I feel can produce a high-quality presentation with less effort than creating multiple presentation layers of your own.

The caveat is that one application component is a little more complicated. I would like to use my own SDKs to write this particular component, and it will work without problems - like a built-in sub-view - with the rest of my application. I thought I could solve this problem elegantly by writing the Cordoba plugin. Reading the documentation, I see how I can write a β€œheadless” plugin, or one that pops up in front of the web view, overriding the display while it is active. But is it possible to display a plug-in with a user interface in a <div> in a web application?

For example, suppose my own component is its own kind of "address book" (in iOS this module has a ViewController that displays its display). I would like to make it somewhere in the <div> on the page where I can still see the title of my application - DO NOT open its pop-up window above my entire application until I get my choice.

I see that you can embed CordovaWebView in a native application. But I want to know if something else is possible.

+4
source share
2 answers

As far as I know, Cordova / PhoneGap does not allow embedded components inside web browsing.

There is a plugin for accessing the contact list / address book of devices here . With this, you can get a list of all contacts and paste them into your own interface. It may be a little more work, but he has to do his job.

0
source

You can use your own components inside the webview, but you cannot embed them inside the html element, this means that the native component will remain above the html.

With some work, you can make it fit into the position of the div, so it seems to be inside the div, but if your html page has a scroll, it can be very difficult to make it impossible to move your own view using a scroll.

0
source

Source: https://habr.com/ru/post/1480307/


All Articles