Coder Social home page Coder Social logo

androidonrails / android-rails-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ttseng/android-rails-example

0.0 2.0 0.0 1.16 MB

Connecting an Android application with an existing Rails app

Java 29.84% Ruby 45.64% JavaScript 1.29% CoffeeScript 0.46% CSS 3.52% HTML 19.25%

android-rails-example's Introduction

This is an example of connecting an Android App with a Rails App using an HTTPClient.

It is based of this tutorial: http://mgmblog.com/2008/10/01/android-ruby-on-rails-app-setup-and-httpclient-hello-world/

Since the original blog post was created 5 years ago, I found that I needed to make a lot of changes. In particular, I had to move the HTTP request to an AsyncTask since they are no longer allowed in the main thread.

I also needed to edit the Controller for my rails app to include the following lines in my index action:

def index @projects = Project.all

respond_to do |format|
  format.html # index.html.erb
  format.xml {render :xml=> @projects}
  format.json { render json: @projects }
end

end

Remember to add the following line to your manifest file:

" uses-permission android:name="android.permission.INTERNET"

android-rails-example's People

Contributors

ttseng avatar

Watchers

James Cloos avatar Jesse Jusoli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.