Batman.js with PhoneGap

40 views
Skip to first unread message

Gabriel

unread,
Aug 10, 2014, 12:08:21 AM8/10/14
to batm...@googlegroups.com
Hey all,

I'm new to Batman.js and I'm really enjoying it!

I'm building an app that will have a Rails json api with Batman.js on the front end for the web app. But I also need an iOS app and I want to use Batman with Phonegap so I can reuse the code.

I know there is a proof of concept here: https://github.com/coconut-ogd/phonegap-batman

... but I can't really understand how it was done. I can't get it to work.

Also, is it possible to use localhost:3000 to serve to the PhoneGap app with Batman (in development)?

Does anybody know of a good tutorial on how to get it going?

Thanks a lot. Will post here if I find a solution.
Gabriel

Robert Mosolgo

unread,
Aug 10, 2014, 3:06:39 PM8/10/14
to batm...@googlegroups.com
Gabriel, 

I don't know PhoneGap at all, but I would be very interested in hearing your findings! It looks like the original was updated after that fork was created: 


It includes "lessons learned" and a link to post-build code.  

I noticed he used `compile.sh` to build CoffeeScript & Sass. You might also check out gulp js for that. I wrote my experience with that combo:

http://rmosolgo.github.io/blog/2014/03/22/using-gulp-dot-js-to-build-batman-dot-js-without-rails/

It also includes a bit about "preloading" HTML by putting into a JS file. That way, batman.js won't have to lazy-load them.

Good luck and keep us posted if you end up checking it out!

robert


Gabriel

--
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gga...@stanford.edu

unread,
Aug 11, 2014, 12:45:28 AM8/11/14
to batm...@googlegroups.com, rdmo...@gmail.com
Hey Robert,

Thanks a lot for the response. Will definitely check it out!

I will post my findings here, hopefully good ones.

Best,
Gabriel

roelof....@gmail.com

unread,
Aug 12, 2014, 6:43:06 AM8/12/14
to batm...@googlegroups.com, rdmo...@gmail.com, gga...@stanford.edu
Hi Gabriel,

I'm the author of the batman-phonegap prototype project. It was a spike to see if it's a viable option to use Batman.js in a Phonegap project. At the moment we are developing a mobile app using this combo. Both Phonegap and Batman.js have their advantages and disadvantages, the most important is the lack of performance in Phonegap apps. But since you want to build an app for iOS, this will not be a big problem for you, since iOS devices have superior performance.

You are welcome to use the batman-phonegap project if you want, I haven't had time to see if the current state of the project runs OK, but I suspect it will. What you are probably missing is the Rails API part which the app runs on, you can find it in a seperate project:

https://github.com/ryreitsma/phonegap-batman-rails

You should run the Rails API on localhost:3000, to get it running you need to have basic knowledge of running a Rails app, it shouldn't be too difficult.

After that, use the instructions for the app to run on on localhost:8000. I haven't checked if both projects are in sync at the moment, but I'd be happy to help you out to get them running.

Kind regards,
Roelof

roelof....@gmail.com

unread,
Aug 12, 2014, 7:06:22 AM8/12/14
to batm...@googlegroups.com, rdmo...@gmail.com, gga...@stanford.edu, roelof....@gmail.com
BTW instead of running a python server and using the compile.sh, we are now using Middleman to run the app locally and compile all scss and coffeescript files:

http://middlemanapp.com/

You could probably use Brunch as well:

http://brunch.io
Reply all
Reply to author
Forward
0 new messages