Meteor 1.0+ with Cordova & Crosswalk?


#1

Late last year I put together a Meteor-Cordova app which relied on Crosswalk to provide the webview. Now that I’m trying to update it with the latest Meteor, I can no longer compile with Crosswalk. Unfortunately this breaks the web app entirely, since the default webview is too primitive to do everything I need.

Has anybody succeeded in getting Crosswalk going with a recent version of Meteor? If so, care to share any tips?


#2

I recently updated my app to Meteor 1.1 and I first made sure to delete the cordova folder inside .meteor/local and remove ios/android/firefoxos from .meteor/platforms. I then add the platforms with (meteor add-platform ios android firefoxos). Then I bundle the app with sudo meteor build --directory …/ --server=http://yourserver.co. This will generate the android/ios cordova projects. Afterwards simply follow “Migrate Using ADT” (https://crosswalk-project.org/documentation/cordova/migrate_an_application.html)


#3

Thanks for the tip. So you didn’t use the cordova-build-override approach? And everything is working for you?


#4

And which version of Crosswalk did you use?


#5

@podaris I used Crosswalk 12 and no I did not use the cordova-build-override approach. You can check out how our app is working for yourself - https://play.google.com/store/apps/details?id=com.downtochill.dtc.


#6

@podaris @arjunrajjain thanks for the info.

I am struggling a bit and may have started off with the wrong crosswalk version as the link above no longer exists.

The new instructions seem to be here https://crosswalk-project.org/documentation/cordova_3/migrate_an_application.html

Any I have been trying to work backwards… but must have messed something up along the way.

Also, I see @slava 's older Hack pad here https://meteor.hackpad.com/Building-Meteor-app-with-Crosswalk-kHKh4DzGxFQ

Any new instructions/help appreciated.

Also, the instruction show running off a build and then creating an APK, is there anyway to get this working with the emulator?

BTW, the problem I am hoping to solve with this, I don’t seem to get click events on <input type="file"> on certain Android versions. If there’s another workaround for that, happy to try it.


#7

Hey @adamgins, yeah looks like they’ve changed up the way Crosswalk gets embedded into the app. Have you solved this yet?


#8

Hi @arjunrajjain, nope, felt like I was stabbing in the dark, moving files into directories based on old instructions etc etc

BTW, was on of the symptoms for Android users: you could not select files on some Android versions (eg upload images) <input type=file does not seem to work???

Phew I wish there was a package (or a script) for this that performed the magic :wink:


#9

do you need crosswalk, in order to support older android versions? or can you go with a chrome webview that works with kitkat 4.4+ ? ( ~50% market share). If so i have a basic android wrapper that works for that i could package up/share. This removes some dependencies and simplifies things, but then you’re outside the cordova ecosystem and just in the native world.


#10

@dcsan I have users with old phones :frowning: That said, I’d be keen to check out your solution.


#11

I’d be interested in checking out that wrapper too if you have the time and inclination to share it


#12

@slava I was looking at the Meteor Roadmap and some of the comments about Crosswalk being abandonware… https://trello.com/c/FC9hdChx/72-phonegap-titanium-bridge

it still looks kinda active as per https://github.com/crosswalk-project/crosswalk/commits/master

Anyway, I am stuck as I have pre KitKat users having issues, so not sure I have another approach you could recommend?

Any help appreciated


#13

@paryguy and @adamgins I bundled it up and put up on github, link is in this other thread below. It’s pretty basic and at some point I’d like to add more features (JS bridge, preloading, caching files etc) but it gets the job done right now better than the phonegap alternative. Let me know what you think and if it helps you!


#14

Thanks @dscan I may need some instructions for dummies… I checked my .meteor project but could not see res/values/strings.xml


#15

@dcsan - How does the performance of your wrapper compare to one using Crosswalk?


#16

@arjunrajjain I haven’t really benchmarked it against Pgap+Crosswalk because I ran into stability problems there.

The drawback is that my wrapper is just for Kitkat+ - the whole point of crosswalk project was to get the chrome renderer working in old versions of android.
This is using the normal android chrome webview that’s part of the OS now, so I can’t see how it could be slower. it rips out many layers of phonegap stuff too so…

It’s really a much simpler approach but may cut out some old device market share in the near term.


#17

@adamgins the strings.xml file is in the android project here:

that’s like an android way to define some constants that are used as resources in your app.

to be clear - you don’t need to put your meteor app inside this. Just change the URL there to be the server you want to load up.

Let me know how you get on!