How to turn a website into an iOS app? - ios

I have developed a website, tailored from the ground up, and are now thinking of turning it into an iOS app - to begin with.
The site is a responsive website programmed with html5, css3, javascript, xml, json, php and mysql.
Here's the url: http://drinksta.thomaskile.me (it's norwegian language)
The site will have a profile service, and the app should be synchronized with that profile, and share the same mysql database as the website.
When googling how to turn websites into an app, I get to sites where businesses wants to do the job for me. I would like to know how I can do it by my self. I wasn't sure where to post and ask this. But i have xCode on my mac, and have learned that this program is used to build apps, but with that approach, I would have to build the app from ground up?
This might not be a good question, but didn't know where to put it...

You will have to develop it using native iOS from the ground up.
However, if the back-end functionality is detached form the current website, like a REST/JSON style, it can make the native work easier.
By the way, you can also look up on Ionic for a cross platform 'Almost Native' feel but it will have to be built from scratch anyway and sometimes 'Almost' doesn't cut it.

Related

Rails multi-client app - Should I really use an API / json?

I am building a ruby on Rails 4 app. The web version is ready and I would like to set up/learn how to build mobile apps.
I know and read in many many articles that the "way to go is to use rails-api and feed json to the various clients".
But I'm not sure it's the best fit: I don't want to use it only because it's popular. I want to understand why (if it is) really necessary.
I'd like if possible to build a "beautiful monolith" as explained here.
DHH (core creator of Rails gem) use in Basecamp this beautiful monolith strategy, an hybrid approach which he states is the number 1 time-saving tactic they use to be able to maintain with few developpers numerous web and mobile apps.
Basically you keep your Rails controller, Rails models and everything in your Rails app and rails app and you use a phonegap container to inject in web views the views. You only change this way the views (with Rails 4.2 variant).
https://signalvnoise.com/posts/3766-hybrid-how-we-took-basecamp-multi-platform-with-a-tiny-team
So with this strategy, let's take an example where we need to the database data. for example if someone loads my mobile app:
- the webview 'homepage' on iphone will load ex: views/phone/projects/show.html.erb:
say I need to display the name of the user in this page, the app will go fetch it on /app/controllers/homepage_controller.rb and this controller will have a method like #users = User.find(id)... (active record)
so IT WILL GO HIT THE standard DATABASE (without needing any api or json)
So when I asked 'I'd really want to know why people sue rails-api/josn to know if I really must use it, or if I can use DHH hybird approach', here what people say
80% of start ups use it => blah...not a reason enough. I'd like to know why I should do it.
you can't do "single page apps" and ajax calls without API/json
Here I checked and it's incorrect: as explained below, you can totally use ajax in a webview can totally do it via whitelisting:
http://www.telerik.com/forums/$-ajax-not-working-on-android-devices :
When you are developing a Cordova powered hybrid app, you do not need to make CORS requests. Regular XHR requests will work without a problem. The reason for this is that a mobile app is executed from a file URI and does not comply to the cross origin policy. Mobile apps have an alternative to this policy which is called domain whitelisting.
Are pure and traditional Ajax Requests possible on native / hybrid mobile apps?:
PhoneGap apps run in webview not in browser, so cross origin is not an issue with PhoneGap apps, you can perform AJAX calls to any URL. The only thing to care of is that there is a white list parameter "access origin" in config used to restrict the access to some specific URLs.
So if I follow DHH hybrid approach to keep my Rails app but change the views on the web/iphone/android views and use my database data WITHOUT any API or json, is it possible?
What does API/json really bring to the table, why would they be really necessary, explaining most large multi clients app use them? Can't each of my various apps (web app, mobile app, tv app) just hit the database without any API/json ?
I might be missing something obvious so please advise.
This question does not really suit stack overflow, as the answers can be very opinion-based and also depend on what YOU really want to achieve. However, I will have a go:
Your first question:
So if I follow DHH hybrid approach to keep my Rails app but change the
views on the web/iphone/android views and use my database data WITHOUT
any API or json, is it possible?
Yes this is possible. Note that it will not be a 'native' app on the mobile device, and many people consider such 'apps' to be inferior (since they are not really apps installed on the device). The big advantage of course is that you don't have to learn how to write a native mobile app (and an API for it to talk to). The other big advantage is that you only have to maintain one code-base (models and controllers) for serving all users. You should really google native apps versus non-native to see the full picture.
Your next question:
What does API/json really bring to the table, why would they be really
necessary, explaining most large multi clients app use them?
Separating the API out from the 'front end' part of your code base allows you to have different teams develop different frontends. So you might have a mobile team that focuses on building a very polished mobile native app. You can also have a backend team focus on the API. So for larger enterprises this makes a lot of sense. The API is also more easily scalable - you can have multiple servers running the API and as more 'frontend users' connect (whether form mobile or web or whatever) you can bring up more copies of your API to serve their needs. The other option you have is to easily open-up your API to 3rd party developers if the need arises. That would be a bit harder with the DHH hybrid approach. Not impossible, but harder.
Your last question:
Can't each of my various apps (web app, mobile app, tv app) just hit
the database without any API/json ?
Yes, of course. This is really the same question as the first. Your different views would be serving different 'frontends' (basically HTML/JS/CSS) for the different clients. But they all hit the same controllers/models and hence database. Just don't forget that all your clients are HTML based. Most mobile/tablet users don't like having to open a browser to use an 'app'. They want the native experience (same goes for tv boxes, consoles etc).
By the way, there are ways to develop mobile apps that share one-code base (see appcelerator.com for example). But that's yet another, and different, approach!

Using rails with phonegap

I have a fully functional rails app but, I want to create a mobile version using Phonegap. I've got Phonegap and Xcode set up but, I'm not quite sure how to go about it.
I want the mobile version to pull from the same database as the web version.
What technology can I use to achieve this?
Thanks,
Ramario
You should probably expose your database through a REST API abstraction layer either with Rails or a separate application using something like Sinatra, which I personally find better suited to API development.
Then your mobile app can make REST calls to allow users to manipulate data from the same database.
Or you can of course just make your existing web UI mobile-friendly and have people just as easily work with your Rails app through the browsers in their phones as they do the browsers on their laptops.

Need to build mobile UI for a Rails app

I need to begin building a mobile UI for one of my Rails apps. A quick search brought me to the Titanium platform. Any thoughts on using this? Alternate suggestions are also welcome/appreciated.
In addition to my app rendering HTML, I am also able to easily create an API that will render JSON -- if that makes any difference regarding an answer.
Thanks in advance!
No experience with Titanium, but I would start with a Web UI, optimized for mobile (small) devices. This would avoid you to build several (well, two : one Android and one iOS) different clients applications.
Many current web framework now help with building mobile web application (look at Twitter Boostrap responsive features for an example).
You may want a native app afterward, especially if :
You want to interact with the phone/device (get contacts, push notifications, use sensors)
The native look and feel is very important to your application
Even so, a lot of very good apps are actually "hybrids", mixing native widgets with webview (take a look at 37 signals discussion about their new Basecamp iOS app).
In addition, if you are going the native way and are a Ruby developer (which I suppose), you may want to take a look at Ruboto (that allow to code applications for Android in Ruby) and RubyMotion (same for iOS).
I've decided to further pursue using Titanium and will most likely be creating a hybrid app. That said, both JQuery Mobile and Twitter Bootstrap also look nice! Thanks everyone for looking.

Ruby on rails making an app for smartphone

I want to build an app that use in the backend Ruby on Rails. However my problem comes in the lack of information i found on it. My goals is not just to create a website but an application that interacts with it, like my android facebook app when pressing menu I get button like logout and so on.
I am wondering if their exists tutorial on how to build an application but using rails or should i scrap my entire website and do it in php. I am looking for guide and tutorial. Thanks in advance
You can build an app on any platform and make it interact with your Rails-based server using HTTP requests (like AJAX).
You can send information back and forth using JSON or XML; you would probably need to make a new set of actions for the app to use.
There is no reason to use PHP. ever.
A little unclear from your original question, but if you are looking to create a mobile app using Ruby (and a structure similar to Ruby on Rails) then you may be interested in Rhomobile. It is a cross-platform mobile application framework that uses Ruby for its backend code, and follows a structure similar to (older) Ruby on Rails versions.
From what I understand of your problem, you want to use the robustness of Ruby to develop a native app (not just another app that mirrors a website).
The best thing I know of for this is RubyMotion. The bummer is the cost ($200). But then you would get to accomplish your task.

Building a Twitter Reader / SMTP Mailer

So I want to build an app that constantly monitors a certain hashtag/phase like #cookies and sends out an email to me (and anyone else who signs up on the site) every day with a list of all the tweets.
I have some Ruby/Rails experience and was considering building this on Heroku, but I was wondering if there was an easier platform to build it on, like say, Google App Engine (which I know very little about)
Assuming you want this to be a web application (not necessarily true from your description), I'd recommend Rails. You have some experience with it, and it's a solid platform. Heroku should work fine for this, but it's certainly not the only viable option. I'm not an expert on Heroku, and I don't know much about your app other than its primary function, so I couldn't tell you if Heroku is the optimal choice. As for Google App Engine, I'm pretty ignorant, but I've heard Rails isn't currently its sweet spot. (Just hearsay.) You could also consider a VPS, which is probably more work but also very educational.
The app itself should be pretty easy to use. Plug in to the Twitter Search API (http://dev.twitter.com/doc/get/search) or piggyback off some third-party Twitter aggregator. Then set up a cron job that accesses whatever data stream you've picked (Twitter API or third-party) and plug the results into ActionMailer.

Resources