Difference in offline-first approach and PWAs? - sqlite

While googling for the confusion of mine, I didn't found the satisfactory resource.
so the question which I was searching for was, What is the difference between offline-first approached mobile apps and PWAs.
As to my level of understanding any mobile app lets say; a react-native app with redux in use or with SQLITE or with realm can be made as a offline-first approached app.
And with PWAs the service worker(of which i have less knowledge) makes all the offline user-interaction and at last when the net connectivity is confirmed the data is fetch or retrieved as required by PWAs.
Though I am not mentioning about other features PWAs can perform(again of which I have less knowledge). And even when the modern browser can only support for PWAs, why there is a hype of PWAs in todays trends?
Please guide me through with any mistake with my question. Any kind of information, knowledge or link to answer my query is much appreciated.

You can read the first of a series of articles about PWAs to get more details about PWAs features and their benefits.
The two concepts are not mutual exclusive. PWAs, thanks to the Service Worker and caching strategies, are able to implement/provide an offline first approach by caching target assets or data responses.
You can however provide an offline first approach also by using other technologies, without introducing a PWA.
The hype behind PWAs is due to the many extra functionalities we can add to a web app, making it behave and look like a native solution. Think just to the advantages of having your frontend team developing a web app that with very little efforts seems almost entirely a native app. And this without having to hire a dedicated native team (iOS/Android).
However PWAs are not the silver bullet for any scenario. They still have limitations that only native apps can provide (eg. SMS capabilities and accessing to the device contacts), even if there are different APIs that aim to solve these gaps, like Google Contact Picker API.

Most of the major apps till recent times was targeted towards countries having decent internet connections. With access to internet spiking in developing countries, most untapped market is coming to light. Though these parts have internet access now , the connectivity problems are plenty. So, to give the best experience for this new brand of customers, we need apps that can run offline
Offline First Approach :
This approach mostly caters to any device which can run offline until a reliable connection is interfaced. As developers , this would mean build the capabiltity to store information in the device through databases, caches or any other local storage approach.
And then when the user opens the app (desktop/mobile) , these run as normal as possible. Just give the user a heads-up that it is not in sync with the latest.
So, an offline first approach can be
Android native app with an offline capability
IOS App w/ offline features
Internet dependent Desktop app w/ offline support
WebApp w/ offline functionality : PWA is the latest
PWA (Progressive Web Apps) :
A PWA is a Web App which has the capability to run offline. With low cost devices (memory deficient, low processing power ) used by many of these users, it's imperative that people installing new native apps will reduce. Also, it's hard to convince people to download and install a new app.
That is where a Web app can be the game changer. A Progressive Web App which has native experience and offline capabilities could drive more users to try a new offering. Adding to that, without forcing a user to install one more app , a link can be easily marketed.
A Progressive Web App is a subset of the offline first approach. With browsers adding more capabilities to access native functions like Contacts as #Francesco pointed out , PWA might will be the first step towards modern app development to release any new feature.

Related

What benefits come from using Progressive Web Apps (PWA) guidelines?

I was reading about advantages of PWAs, but I really can't understand why we have to use this technology. Is this similar to SPA? Or this is completely something else?
A Single Page Application (SPA) can be a Progressive Web App (PWA) but a PWA doesn't need to be a SPA. They are two different things. A PWA as defined by Google is:
Reliable - Load instantly and never show the downasaur, even in uncertain network conditions.
Fast - Respond quickly to user interactions with silky smooth animations and no janky scrolling.
Engaging - Feel like a natural app on the device, with an immersive user experience.
The Google PWA site is a good place to start learning about PWA and why and how you would build one.
https://developers.google.com/web/progressive-web-apps/
A SPA is simply a web app where a single page is loaded in the browser and all subsequent routing and page view rendering is handled on the client (browser) using JavaScript.
Properly combining the principles of PWA and SPA can result in a much improved user experience especially on mobile phones with unreliable internet connections.
Probably the best example today of a well implemented PWA is Twitter Lite. Check it out here:
https://mobile.twitter.com/home
...and read about it here:
https://blog.twitter.com/en_us/topics/product/2017/introducing-twitter-lite.html
A SPA is something different than a PWA. You can view PWA as an enhancement of your website. By adding a service worker and a manifest you can bring your website (SPA or not) out of the browser, work like a mobile app and make it perform better.

Architecture for an integrated offline windows + Web + android application with minimal duplicate effort

We are looking to develop an application wherein the requirement is such that we need some help on designing the architecture. I am putting down below the requirements of the application.
Brief Description
1) The application shall work on web + Android + Offline desktop version (Offline version meaning entirely offline environment wherein full functionality shall work without internet)
if possible offline android as well (which as per my research is difficult to do in same backend so caching can be used for temporary offline usage)
2) While designing the architecture we want to minimise the rework such that we shall be able to use the same Database, Logic code and Frontend as much as possible
3) Everytime application is updated then web and android will reflect it immediately due to API integration. And for offline application, we want to update the logic and database everytime it connects to internet.
Challenges I am facing
1) Database choice : Since it has to be an offline solution as well, I understand that we will have to use either SQLite or SQL compact edition so that we can use the free version and installation file is also not very big
2) Logic : Due to offline requirement, we may have to put entire logic in Asp.net / (any other suggestions) since stored procedures are not supported in above mentioned databases
Some links I found regarding this :
https://www.codeproject.com/Questions/346702/How-to-make-work-an-Online-Web-application-Offline
3) Application framework : Which framework MVC / MVVM etc would be suitable to minimise the work for web based and offline app.
4) Frontend : I understand that we will have to make different screens for web and android. However want to know whether we can use HTML 5 (cache feature) or Angular JS which can be used in offline environment as well or do we have to make offline screens seperately?
Build an ASP.Net web app with offline functionality
https://www.html5rocks.com/en/tutorials/appcache/beginner/
5) Can apache cordova be used in someway for better architecture (I dont know much about it hence)
6) I am sure I might be missing something. If you can offer some suggestion on best way to go about developing this application then will really appreciate your help
Your requirements are not very clear to me.
But if i have backend which is catering to multiple clients with different devices.
I will take the following strategy.
I will expose the backend functionality through rest/HTTP and let the clients consume them.
If i want to make the same UI and functionality and want to do it quickly for different mobile platforms. i will go for a Cordova,Phonegap or a Xamarin app. But keep it in mind that they lack some native functionality.
For web i will go with a UI framework which is device screen size responsive like like openUI5 ( i am sure there are dozen others ), such that an user can open the application in a web browser in any device and it gets rendered easily.
For Desktop based apps again i have to develop a separate UI. If you again have multiple flavors in Desktop application like Windows , Mac etc. You can take multiple strategies like Have a common Java layer + Minimal native layers for each OS or having full blown native layers or have the logic exposed as API in a low level language as C++ and then let high level languages consume them.
For all the apps you can use DBs like SQLite . Have the common DB and scripts ready which easily replicate the table structure for you.
Determination of a technology for the backend can be upto you (depending upon your requirements) and should not matter to clients if you expose your functionality in a restful manner.
Hope this helps.
Best Regards,
Saurav

Deploying a webapp that uses chrome native client without involving webstore

I'm investigating the possibility of building a chrome app for a specific enterprise customer. This app would only be used by that customer (ie, it is not a general purpose app).
Among the use cases described on the Technical Overview are the ability to replace "Legacy desktop applications" and "enterprise applications that require heavy computation" - the solution I'm considering fits into both these gaps, as we have some mathematical libraries that we'd like to incorporate into a client-side web app.
Later on in the same document, however, it indicates that you can only deploy native client apps that are deployed on chrome webstore, as clarified by the https://developers.google.com/native-client/devguide/distributing document (and various developer scenarios).
Question: Is it possible to have build a web-app that uses Native Client, and distribute that to users worldwide, but without using Chrome Webstore (ie, using an internal server)?
Note: I've seen this document about creating a private chrome app collection on webstore, but this seems to be specific to ChromeOS. I'm interested in deploying to users that have the latest stable build of Chrome.
It is absolutely possible to run a Native Client app without hosting it on the Chrome Webstore -- otherwise, it would be very difficult to develop an NaCl app in the first place. It is possible for end users to use an NaCl app hosted on any random site. The catch is that the user needs to specifically enable the feature in their Chrome browser. It looks like the current way to enable this is to visit the "chrome://plugins/" page (or "about:plugins" page, same thing), and check the "Enabled" box under "Native Client".
Perhaps enterprise-level administration makes this easier to roll out, or perhaps allow finer-grained control so that only NaCl apps within the corporate intranet are trusted while not allowing stuff from the broader internet (NaCl is supposed to be safe and sandboxed, but Google is still playing it safe and paranoid, just in case).
For a public example of a self-hosted NaCl app, check out NaClBox, a Native Client port of the venerable Dosbox emulator. While it is also hosted in the Chrome Webstore, their support page describes how to run it directly from their site.

Is it Possible to create a PhoneGap app from a Wordpress blog?

Is it possible to make a PhoneGap native app from a Wordpress mobile blog?
I understand that PhoneGap allows you to develop HTML5 apps and turn them into native mobile applications.
I'm looking to create a content distribution app somewhat like the ones so many local news services use (WGAL, Channel 69 News), but to be able to list it in the Android Market Place and the AppStore, as well as be able to access it online all with the same content.
Also are there any alternative methods to accomplish this? Are News apps like that available in some sort of a "canned form"
One way is to essentially you make PhoneGap a web browser without an adress bar. I have an iPhone example here. All I did was make javascript redirect upon loading the application, whitelisted my IP (in the case of the example it's local host) and modified the Appdeligate.m with this piece of code from:
- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
}
to
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *url = [request URL];
if ([[url scheme] isEqualToString:#"http"] || [[url scheme]isEqualToString:#"https"]) {
return YES;
}
else {
return [ super webView:theWebView shouldStartLoadWithRequest:requestnavigationType:navigationType ];
}
}
and voila, a "native" app, with access to all local resources (storage, camera, etc) built on web frameworks! Weather or not Apple or the others will let something like this in their app store I still have yet to investigate but it sure works well for demonstration purposes or personal apps.
We have just created a similar concept using PhoneGap and Application Craft, but Apple rejected the application, this is the message we received:
We found that the experience your app provides is not sufficiently different from a web browsing experience, as it would be by incorporating native iOS functionality to provide a more robust user experience.
While your app content may differ from your web site or other existing sites, the experience it provides does not differ significantly from the general experience of using Safari, as required by the App Store Review Guidelines.
You may wish to provide convenient access to a web property for a select or niche group of users - and may have enhanced that experience with features such as Push Notifications, Core Location, and/or sharing features. However, these features do not provide a robust enough user experience to be appropriate for the App Store.
If you wish to provide quick access to a web property, you may wish instead to provide instructions to your users on how to create a Safari web clip to add to their iOS device Home Screen. Or, if you would like to share the app with a select group of users, we recommend the Ad Hoc distribution method. See the iOS Provisioning Portal for details on Ad Hoc Distribution.
We encourage you to review your app concept and evaluate whether you can incorporate additional features to enhance the user experience.
If you cannot - or choose not to - revise your app to be in compliance with the App Store Review Guidelines, you may wish to build an HTML5 web app instead. You can distribute web apps directly on your web site; the App Store does not accept or distribute web apps.
HTML5 is the major new version of HTML and enables audio and video to play natively in the browser without requiring proprietary plug-ins. Using HTML5, web apps can look and behave like native iPhone and iPad apps, and using HTML5's Offline Application Cache, a web app can work even when the device is offline. With web apps, you have flexibility to deliver as much or as little functionality as you desire.
To get started with iPhone or iPad web apps, please review Getting Started with iPhone Web Apps.
For a description of the HTML elements and attributes you can use in Safari on iPhone, check out Safari HTML Reference: Introduction.
Unfortunately I can not link this as it was a reply to our application submission and not on one of the help platforms. We have not tried Google Play Store yet but from what I understand they will most likely accept the app, will update when we have tried.

ASP.NET Cloud application Vs Ordinary ASP.NET

I was reading this article Build Your First Cloud Application Using Visual Studio 2010 when It hit me:
Why would I switch from my normal
hosting (shared account, VPS, or
whatever) to host it on cloud
servers ?
Do I have to build my website with
ASP.NET Cloud Application to be able
to host it with any cloud providing
service company ?
How can I edit my ASP.NET Web
Application to be an ASP.NET Cloud
Application ?
Those are the questions I thought would help to gather a full picture about this new technology and it's own application template! but please feel free to add more points to consider in the answers.
Edit
so beside the difference in implementing a website between Azure and other cloud server
is there is a performance difference or any other differences between Azure and the other cloud servers ?
I didn't quite get what you meant by "bringing your app on site with your own staff may become more economical"
the Azure pricing are high and requires a whole new dedicated project to work with it restrictions. so both the hosting and the development are costy
I hope if there's any article about the good cloud hosting out there and perhaps any articles about the user experience (a legitimate review and maybe yours if you have any)
First, I believe "cloud" in the context of the blog article you read should really be more granularly defined as Azure. There are several cloud solution offerings and Azure is only one although it is gaining immense popularity in the MS community space. The Azure cloud is fairly unique compared to products like Amazon's cloud in that it requires applications that use it to comply to a specific set of APIs. To build an application for azure requires you to embrace certain architectural principles from the beginning and to build your app using its web and worker roles. To "fit in" to these roles, your app must be built within a special VS project that references the Azure SDK.
If you were to use another cloud solution like Amazon, it is more similar to firing up a VM or group of VMs that can host your app as is without the constraints of specific APIs. You simplu would fire up a windows server instance, install what you need on it like any other server you would use in a hosted or or leased data center environment.
I am not implying that the azure solution is flawed or overly restrictive. Rather, I think it supports some architectural constraints that will allow you to "fall into the pit of success." However, it may be difficult to effortlessly migrate many brown field apps to azure without making significant changes.
As far as why host a application in the cloud as opposed to a normal hosted environment. It really depends on your app, your business/budget constraints and your traffic level. For many small, hobby sites, you may be better off keeping your app on a traditional hosted environment. For larger scale apps, the cloud begins to make more sense. The cloud is really supporting a "pay per use" model. If you need to have the ability to scale out quickly without the funds or the ability to wait on a purchase of lots of additional hardware, the cloud is a good option. Cloud providers have deep pockets and plenty of server resources and bandwidth to send your way at a moments notice that you can rent instead of buy.
Also, because cloud providers are large and typically highly reputable, they can afford to hire expert staff and follow best practices that you may not be able to afford on your own. They can and will handle a lot of the day to day ops administration enabling you as a developer to not have to think of things like security and redundancy.
So as I see it, cloud solutions are ideal for apps that are beginning to see a fair amount of traffic, need guaranteed up time, and do not want to pay or bother themselves with their own admin staff, server purchasing and data center management. I think they are not practical for many small hobby sites and once you become really big, bringing your app on site with your own staff may become more economical.
That all said. it has become "cool" in the .net space for any site to run on azure. I'll admit that some of the architectural models are interesting and seem fun to work with. However, if you take a close look at the pricing model, you may find you are better off with your hosted plan.
Moving your .NET application to a cloud or hybrid infrastructure allows you to start evolving to a Microservices Architecture, with the ability to phase in Containers and a Serverless architecture.
You mentioned that Azure costs are high and maybe cumbersome in your situation.
Maybe consider other popular cloud providers like AWS. They have a ton of vendors and services all readily available to help make the adoption easy, in fact over 57% of Windows workloads currently run on AWS.
Here is an eBook we recently published about this exact topic.

Resources