REST api app vs Corona web in view app

I just want to know the pros an cons, from an experienced programmer, of this two ways to build a web based app. Thanks.

Apple doesn’t like apps that are just mobile versions of the website and will reject them. Of course a webView that’s part of a mobile app is acceptable.

If you use a REST api, then you can load data into mobile-like controls such as a tableView and then your mobile users get a more mobile-like experience. Of course that mobile-like experience can be faked in HTML5/CSS/JavaScript.

What it usually comes down to is can you do everything you need with the service’s REST API (assuming they have one in the first place)? Do you have access to a REST API? For somethings you may not have a choice other than to use a webView. 

Also RSS feeds are another valid way to get web content into your mobile app where you have good control over the display of the content. If your content from the server contains HTML you will at a minimum want a webView for that content.y b

Our Business App sample (https://github.com/coronalabs-samples/business-app-sample) uses RSS to load stories from our blog and when want to go read the article, the story body can have encoded HTML in it, so we use a webView to just show that partl

Rob

@Rob Miracle

I really admire you. Love the approach that you take when trying to understand an issue. Thank you for everything.

REST API will give 100% control of your app and will be 100% native.

Webview is on top of everything you will not be able to create buttons or any other elements on top of them. Usually, I use them only for specific thinks inside an app, like “Terms & Conditions”, redirecting to a web page for more information, etc. without leaving the app.

It’s normal that you mix together both approaches, using rest API for most of the app, and use webviews for those parts, you don’t want to duplicate that are already on a web page or it’s very difficult (time-consuming>benifit for the app) to do it on a native app.

To me, a “pure webview app” is kinda a “cheating” app, because it’s not a true app. It’s just a container of a web page.in my modest opinion, It’s better not to have that kind of app at all. Having only a responsive website will me a much easier approach, in this case, to be well present on all platforms.

regards,

Carlos.

@Rob, that’s not entirely true… I have 12 apps (6 on each) on both iOS and Android that basically are webView wrappers on a mobile website.

@Carlos this depeneds on the mobile website being “framed”… if it is designed to be like an app then there are no issues.

I think it is all about the quality of the mobile website being encapsulated by Corona webView .  It is all about appearing to be native with regards to touch points, flow, navigation, etc.  It is all about the UI/UX.

@Sphere Game Studios, you’re right, if you make your webView look like a mobile app, Apple will pass it, but you’re having to build tableViews and buttons and such in HTML5/CSS/JavaScript to look mobile. If it looks like web page, they will reject it.

Rob

@Sphere, I understand you point, but what’s the point of creating an webpage to look as an app if without it will look as good? to have a button on your device? you can do shortcuts of webpages in the home screen.

Multiple reasons…

  1. you may already have a mobile website live.

  2. there is a lot more you can do with HTML 5 that you cannot do with Corona - like full blown ecommerce and payment gateways, etc.

  3. you may want a single code base - i.e. HTML

  4. you may outsource your mobile website to a web dev company that know nothing about native development

@sphere,

you gave all reasons not to have an app.

  1. if you have a mobile website live that works well on mobile devices, there’s no point of having an app, if the app will only show it wraped around a webview.

  2. read 1.

  3. read 1.

  4. if you going for a dev company that don’'t know native development to build an app, it’s like going to a carpenter to build a brick statue. still the answer is “read 1”.

passing an website to a app it’s just the wrong approach to any app development. any app developer should point that to a client.

i know point 4 is still used for many companies, but that doesn’t make it right to do it.

@carlos you completely miss the point.  Hybrid apps (if done correctly) make perfect sense for companies as it is a cheap way of having a fully functional app.  

Yes, I know users can create bookmarks on their home screen but an app is just easier.

Most shopping apps are hybrid because that is the most efficient way and much easier and cheaper to update.

Will there be any way to use Rest api in corona sdk?

network.request() will allow you to call any REST API.  I use GA and Facebook this way - the advantage is no plugin is required and it works on simulator (i.e. without Facebook app)

Thanks!

Might be a bit out of context, but you can see some Corona SDK API action here and here.

To chime in on the discussion, hybrid apps/games are incredibly relevant. With the ascent of tech like Browserify, NodeJS, and Cordova (along with a game engine I won’t mention), you get the best of both worlds. 

I’ll leave it at that.

-dev

You can also look at our CoronaWeather sample app:  https://github.com/coronalabs-samples/CoronaWeather

It uses network.request() to fetch weather data.

Rob

Apple doesn’t like apps that are just mobile versions of the website and will reject them. Of course a webView that’s part of a mobile app is acceptable.

If you use a REST api, then you can load data into mobile-like controls such as a tableView and then your mobile users get a more mobile-like experience. Of course that mobile-like experience can be faked in HTML5/CSS/JavaScript.

What it usually comes down to is can you do everything you need with the service’s REST API (assuming they have one in the first place)? Do you have access to a REST API? For somethings you may not have a choice other than to use a webView. 

Also RSS feeds are another valid way to get web content into your mobile app where you have good control over the display of the content. If your content from the server contains HTML you will at a minimum want a webView for that content.y b

Our Business App sample (https://github.com/coronalabs-samples/business-app-sample) uses RSS to load stories from our blog and when want to go read the article, the story body can have encoded HTML in it, so we use a webView to just show that partl

Rob

@Rob Miracle

I really admire you. Love the approach that you take when trying to understand an issue. Thank you for everything.

REST API will give 100% control of your app and will be 100% native.

Webview is on top of everything you will not be able to create buttons or any other elements on top of them. Usually, I use them only for specific thinks inside an app, like “Terms & Conditions”, redirecting to a web page for more information, etc. without leaving the app.

It’s normal that you mix together both approaches, using rest API for most of the app, and use webviews for those parts, you don’t want to duplicate that are already on a web page or it’s very difficult (time-consuming>benifit for the app) to do it on a native app.

To me, a “pure webview app” is kinda a “cheating” app, because it’s not a true app. It’s just a container of a web page.in my modest opinion, It’s better not to have that kind of app at all. Having only a responsive website will me a much easier approach, in this case, to be well present on all platforms.

regards,

Carlos.

@Rob, that’s not entirely true… I have 12 apps (6 on each) on both iOS and Android that basically are webView wrappers on a mobile website.

@Carlos this depeneds on the mobile website being “framed”… if it is designed to be like an app then there are no issues.

I think it is all about the quality of the mobile website being encapsulated by Corona webView .  It is all about appearing to be native with regards to touch points, flow, navigation, etc.  It is all about the UI/UX.

@Sphere Game Studios, you’re right, if you make your webView look like a mobile app, Apple will pass it, but you’re having to build tableViews and buttons and such in HTML5/CSS/JavaScript to look mobile. If it looks like web page, they will reject it.

Rob