0

I have a Polymer web app. I need to deploy it to mobile Android and iOS devices.

  • I have my vulcanized dist directory after running gulp.
  • I have a hosted URL.

Question

Now what do I do? What steps do I need to take? (And where is the documentation?)

I tried using PhoneGap Build but encountered compatibility issues.

This SO answer pretty well documents that PhoneGap Build does not support Polymer at this time.

Community
  • 1
  • 1
Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207
  • 1
    I'm a bit tired, but let me add a few things. First, I am have a set of [running notes on webview](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/webview.md), the library that renders the HTML pages. In those notes, is a [good piece, entitled WebKit for Developers](http://www.paulirish.com/2013/webkit-for-developers/) from Paul Irish. Sadly, there is NO mention of web components, and Paul does not use tags - a Google search return nothing. However, he states clear that something do no ship with the default WebKit, namely GPU related and 2D drawings. More later. –  Oct 22 '15 at 00:02
  • youtu.be/LzlNP9nS6fo?t=6m29s ..... youtu.be/LzlNP9nS6fo?t=11m1s ...... developer.android.com/guide/webapps/webview.html ...... polymer-project.org/0.5/articles/webview.html ...... http://developer.android.com/intl/zh-cn/reference/android/webkit/WebView.html – Let Me Tink About It Nov 30 '15 at 21:54
  • thanks for the notes. However, I've since check with my friend in Silicon Valley on this. Nothing has changed. The bigger issues might be that Google has been putting it's energy in other things. I think polymer is a good idea, but it is not on my radar - and I have little interest in it. Thanks just the same. –  Nov 30 '15 at 22:15

5 Answers5

2

We have built an in-house mobile applications with Polymer and Cordova.

It generally works with android 4.4 onwards since WebView for android 4.4 onwards is based on the chromium project.

As for iOS 8.1 onwards, we thus far have not encountered any issue. Note that Polymer will not work on iOS7 & below.

Should you need more modern web API, you can include Crosswalk for Cordova.

Hope that helps.

iamcastelli
  • 1,564
  • 2
  • 20
  • 30
Vin Lim
  • 173
  • 7
2

There is article written by Eric Bidelman on Using Polymer in a WebView. How to setup Polymer in an Android WebView app. Here is the link.

https://www.polymer-project.org/0.5/articles/webview.html

Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207
jean Pokou
  • 679
  • 5
  • 18
1

That's me. I look further into that.

I talked to my friends in that group, they know of no such projects.

However, they did express that it was possible, IF the web library supported ECMA5 (the Javascript standard). I looked into it and found that potentially there is support

However, I do not have any evidence that this will or will not work. The best I can say is to try the following.

  1. Build the library on a local machine (your PC) to make sure you understand it.
  2. Build a Cordova/Phonegap Application with the new Crosswalk Webview Library.
  3. Find a very simple Webcomponent you can test with. Something equivalent to "hello world".
  4. Test

Please let me know how this works out.

Best of Luck,
Jesse

1

Can't say I've found good documentation on this apart from this tutorial on using Apache Cordova with Polymer (though this is Polymer 0.5):

https://blog.nraboy.com/2014/07/use-polymer-apache-cordova/

I've been successful (so far) in using Cordova to build my polymer app and it runs successfully in a browser and on Android (haven't tried iOS yet).

I put all of my html and css in the 'www' directory of my Cordova project and have had no issues with build.

asdf
  • 11
  • 1
  • 1
    This is the first I've heard of this. Can you give us more details on some of the tools you are using, and perhaps any openly available code? TIA –  Oct 20 '15 at 20:49
  • [Is this your Cordova build tool](https://build.phonegap.com/)? Or do you use a different one? If you use a different one, please link to it. – Let Me Tink About It Oct 20 '15 at 21:54
  • @JesseMonroy650: [I just found this Youtube video](https://www.youtube.com/watch?v=XL8NG-_Q4ds) that purports to demonstrate how to use Cordova with Polymer. I'd be interested in your thoughts. – Let Me Tink About It Oct 20 '15 at 22:06
  • 1
    There's no difference in how you create the cordova project if you want to build your polymer app. I'm using Cordova to create my project which gives you your platforms (ios, android), your config.xml and a www directory. Inside my www directory I use bower to pull down whatever Polymer elements I need; this is also where all my javascript files go. Then you can run 'cordova run {platform}' for your target platform which will build and deploy your project to your device. I'm using the command line interface here: https://cordova.apache.org/ – asdf Oct 20 '15 at 22:39
  • @Mowzer, the video you linked is the same tutorial as the blog post linked above, it's what I used to get started with my cross platform Polymer app – asdf Oct 20 '15 at 22:45
  • @asdf, I'm on the road today so it's taking me a bit to catch up. Tomorrow I will be in Texas, so excuse the short answer. In short, the developer (link&video) states that one must use Android 4.4. This falls in line with what I know. My [notes](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/webview.md) on webview, the default library, was upgraded to ECMA5. However, ~some~ web libraries that shipped did NOT include webGL. However, crosswalk does. There are other notes, but I must catch a bus very soon. –  Oct 21 '15 at 01:45
  • Sorry, did not get your response. I've been forgetting to tell people. **iOS9 is [not official support](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/current-tripping-points.md)** –  Oct 27 '15 at 04:51
1

For android the simplest approach would be to create a webView and load your url to it. This kills most of the compatibility issues. As rendering engine of chrome and web-view are both webkit based, most of thing that runs in chrome,will run in webview as well.

For details https://developer.android.com/reference/android/webkit/WebView.html

how to display progress while loading a url to webview in android?

Similar thing can be done at IOS as well.. iOS: WebView Loading a url

It will definitely going to increase your workload a bit, however it does give you presence in both app stores.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Ashish Rawat
  • 5,541
  • 1
  • 20
  • 17