質問

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!

役に立ちましたか?

解決 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 :)

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top