Question

I'm developing an Android app which involves a user login. I am doing all the database interactions in Ruby/Rails. This will be how my app typically will run:

  1. Main activity (User log in screen)
  2. Rails code (ActiveRecord stuff..) to log user in and generate an XML filled with users information (name, email etc)
  3. Start next activity which parses xml file for certain information

The trouble is, I don't know how to make specific ruby function calls from the Java/Android code (Think bridging between steps 1 and 2).

So suppose we enter the username and email in the main activity (step 1). We now need to call the Rails code to verify this username and email - How do we call that code from java?

Any advice or links or examples would help, thanks!

Was it helpful?

Solution 2

I think this is what I was looking for: http://jruby.org/apidocs/org/jruby/embed/ScriptingContainer.html

Thank you guys for your efforts and comments :)

OTHER TIPS

Would it suit your purposes to make a System command line call to kick off your rails code? How to execute system commands (linux/bsd) using Java

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top