I am creating an online game with ruby on rails and I would like to use the same login and database on my swift application.
For example If I would to create an account on the website I would be able to login, view, and edit my account on the swift application. It would also update for the website or rails application as well. How would I do this?
I would recommend that you look into breaking this down into parts. For example, do you have the login working on the web portion (rails)? If so then you can begin to try to get it to work on the iOS side. Next I would recommend you look into POST and GET requests as a basic way of talking to a back end. Once you have gotten simple apps to work with that then you might have a better idea of the path that lies ahead.
Related
I ve recently been asked to work in the front-end of a new app which will be written with Django for back end.(They said it will be for iOS).
Even though I have experience working with front-end I never wrote any code for iOS or Django REST API. What are the differences? Is it html/css ?
In another words lets assume that someone has a code in Django which asks user a question and stores the answer. The response will be in JSON(I think.) He wants me to write front end. Should I write it in html?
One more question: What will determine that our app will be working in iOS and will not work in android. They said the app will be for iOS at first but since it uses REST API what is the reason it cannot be available at the same time for android?
The usual process of using django rest framework is to have interactions with your backend exclusively using json.(most of the time, some people might use xml). So in general, all the information (requests and responses) will be JSON. Once you have that part setup, there are a number of technologies that will help you create user interfaces. You can use angularjs or JQuery to send JSON requests and responses to the endpoints and display the information obtained.(the whole interface is modified with javascript.)
Now, for your mobile apps. There are two approaches you either create what people call a native app using Java(for android apps) or Swift(for apple devices).
If you decide to use that approach you will have to mantain both apps in different languages. The other way of doing things would be to create an interface using something like angularjs and use a tool like ionic to convert that app into an android/apple app. Using that approach you will only have to mantain 1 application.
Here is a small diagram to represent the interaction.
(Django rest framework) <=JSON=> (front end app.)
I would suggest to start with django templates, it might just do the trick.
I am very new to ruby on rails and I am using Ruby version 1.9 and its newer syntax.
I have managed to create a small application where I store statistics in 1 large database table. This table can be viewed and edited with no problems via rails.
Now, I am trying to add several different mini views of this table to the Home page, Where I might list the top 10 users by upload then download.
I have successfully created the 1st for upload, is there away I can use the same code with different query options.
Are there any good tutorials in this area?
Is it relatively easy to add graphs from the same table on to the home page?
Is it possible to make the homepage refresh when ever a change occurs in the database table?
I know I am probably asking very basic questions so any pointers to good tutorials or books would be of great help.
Read this tutorial on basics how to render templates in ror.
http://guides.rubyonrails.org/layouts_and_rendering.html
http://api.rubyonrails.org/classes/AbstractController/Rendering.html
For chart you can use this, github.com/ankane/chartkick
Page should refresh when any changes detected in database, for that you can visit ActionController::Live of rails casts.
http://api.rubyonrails.org/classes/AbstractController/Rendering.html
For Rails Tutorials you can find out these
http://www.tutorialspoint.com/ruby-on-rails/
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Coming to Charts you can use gruff gem it is very easy to implement and for dynamic charts you can go for highcharts
http://www.highcharts.com/
https://github.com/topfunky/gruff
Give this a try.
The Rails View: Create a Beautiful and Maintainable User Experience
- by John Athayde and Bruce Williams
http://pragprog.com/book/warv/the-rails-view
im doing a web base mobile using jquery and html and using sqlite database for log in. right now im struggling with sqlite database log in so im thinking of an alternative like using facebook credentials as a means to log in in my native app is this feasible if yes can anyone point me to right track?can someone give sample code im new in this so sample code with be helpful
I think your are searching for this:
https://developers.facebook.com/docs/facebook-login/
Samplecode will need more specification since you need to know if you will use a js-libary or for example go through the process manually.
If you need help on a specific problem feel free to ask with more specifications.
In one of my projects, I have a very active classic ASP site with a requirement to integrate live event-based feeds as part of the existing UI. There is a plan to upgrade the site architecture to either MVC or MVP in the future, but this new feature must be implemented in the meanwhile.
I have decided to go with a WebSocket approach for this, as this is ultimately what we will want to use in the future, and rebuilding this doesn't make sense. The question is, how to integrate this with the classic ASP "architecture"?
The site already implements the jQuery library, and was hoping to leverage jQuery's capabilities to create those streamed sections on a given page.
The current req's ask for this news feed to exist on every page. Thus, loading a new page will re-render the news feed, and should kick of from where it left on the last page. For this, I'm guessing a position indicator will need to be read (session variable I'm guessing).
Anyhow, those are the requirements. I was thinking of wrapping the the entire existing classic ASP site inside a MVC or MVP (C#/.Net) project to allow us to begin swapping out legacy features as they are developed, such as this one.
I would like to get some advice on some recommended approaches for this scenario.
Thanks.
I would do a SignalR app and integrate it in you old app.
It's easy to integrate ASP classic with ASP.net MVC. Just mix the projects and exclude *.asp from the routes
routes.IgnoreRoute("{resource}.asp/{*pathInfo}");
You will have some trouble in the root (/), but you can sort it with a redirect.
For a mixed authentication (if you need it) you will need to write your own authentication in MVC to use the same auth cookie that you use in Classic ASP. I've done this in the past with success.
I am working on a project and it needs to accomplish the following:
A user logs into a joomla
Makes a change to some of their profile
This new information updates in the
database
Up to this point joomla will do everything, so the question is how do I take the information from the database and call it into a phonegap app. I am using phonegap and jqtouch for the app, and joomla with jomsocial for the update side.
I cannot have the app open into just a mobile version of the website because apple will reject it from the store. I need this solution to work for people to make updates to their profile, and these updates will automatically post to their app. All users input data on the same site, and share a database. Each profile however will have a different app that is released to the markets, so right now I am focusing on a template framework that can easily be changed to the users portion of the database.
From my understanding the php files stay on the server to process information. The big question is how do i call this information into a phonegap app?
To display XML as HTML you need to parse it through an XSLT stylesheet. This transforms your XML nodes into HTML. Of course, you could just use a PHP XML parser. I think there's one bundled with Joomla, but there are lots out there.
I was going to suggest using a Joomla plugin to push the data over to the Phonegap app. There are lots of events that are fired when an account is created and you could manipulate that.
If the XML is local, Jeepstone is correct. If it is not, how are you going to get it? To do this without running into cross domain issues, I suggest you try out this jQuery plugin on the phonegap side of things ... http://code.google.com/p/jquery-jsonp/ . So to take advantage of that nifty tool, you will adjust the public functions in this script to echo back json_encoded array. With which you can then do as you want on the phonegap side of things.
Ya Apple wants your app to not be useless without internet. But it is straightforward to create your index.html to show the user something. Use the failure and success functions in the jsonp library to show connection problems if necessary.