13 Replies Latest reply on Aug 30, 2012 12:24 AM by CD Aurelian

    Rho app sync with SQL database without MVC/heroku

      I don't know if it discussed allready, but i'm interested about that: there is a way to synchronize data from mobile terminals directly with a SQL database (without MVC, and without heroku). Is there a way to obtain more information/samples on this issue?

        • Re: Rho app sync with SQL database without MVC/heroku

          i did a service (web api actually) that return a json with data from database (what i want to synchronize) , i make a rhodes (client mobie) and a rhoconnect application.

          i just follow the tutorial and i replace the heroku link with my web api link ( the json script). it doesn't work , i don't know what i mistake  and i hope someone to help me.

            • Re: Rho app sync with SQL database without MVC/heroku
              i just follow the tutorial and i replace the heroku link with my web api link ( the json script). it doesn't work , i don't know what i mistake  and i hope someone to help me.

               

              This probably won't work unless your web service imitates exactly what the rhostore.heroku.com service is doing.  For example, what does your json feed look like?  Does it match the structure exactly as http://rhostore.heroku.com/products.json

               

              You might want to spend some time really understanding the adapter code from the sample: http://docs.rhomobile.com/rhoconnect/source-adapters#sample-adapter

               

              Once you get the hang of ruby and also the library this example uses (RestClient), the ruby code there is pretty straightforward.  One thing that helps me with this type of sample code is dropping into irb and typing in code snippets that I want to understand in more detail.  For example, you can run the following in irb (just  type "irb" at a command prompt, then paste the code below):

               

              require 'json'
              require 'rest_client'
              
              @base = 'http://rhostore.heroku.com/products'
              body = RestClient.get("#{@base}.json").body
              puts body
              

               

               

              This will print something like:

              "[{\"product\": {\"name\": \"ADIDAS 123\", \"brand\": \"ADIDAS\", \"updated_at\": \"2012-06-12T13:48:23Z\", \"price\": \"123,00\", \"quantity\": \"2\", \"id\": 87231, \"sku\": \"ADD-123\", \"created_at\": \"2012-06-12T13:48:23Z\"}}, {\"product\": {\"name\": \"iPhone\", \"brand\": \"Apple\", \"updated_at\": \"2012-06-12T13:56:57Z\", \"price\": \"199.99\", \"quantity\": \"20\", \"id\": 87232, \"sku\": \"12345\", \"created_at\": \"2012-06-12T13:56:57Z\"}}]"


            • Re: Rho app sync with SQL database without MVC/heroku
              Robert Galvin

              Hi

               

              I have moved this question to the RhoConnect space. It was filed under the AppForum space initially.

              CD Aurelian wrote:

               

              I don't know if it discussed allready, but i'm interested about that: there is a way to synchronize data from mobile terminals directly with a SQL database (without MVC, and without heroku). Is there a way to obtain more information/samples on this issue?

              • Re: Rho app sync with SQL database without MVC/heroku

                Hello,

                 

                Just marking this thread as assumed answered, please reply back if you still have questions.