Offline capabilities: Native mobile apps vs. Mobile Web apps)

Source: Internet
Author: User
ArticleDirectory
    • Short answer: mobile Web apps are ready to go offline
    • How is an offline web app even possible?
    • So, is a mobile web app a good solution for offline features or not?
    • There is much more to the native vs. Web demo-
    • Think offline

From http://buildmobile.com/offline-capabilities-native-mobile-apps-vs-mobile-web-apps/

 

Alibaba mobile apps cocould benefit from
Working without an Internet connection. Here, we take a look at how
Offline capabilities affect the demo-of developing native apps.
Mobile web based apps.

Apps that continue to work while
"Offline" or "disconnected" have been important since laptops first
Became common. A classic example is a salesperson that wants to enter
Data while traveling, and then have that data automatically sync with
Server when they get back to the office. Even with Wi-Fi and cellular
Broadband, there are supported scenarios (airplanes, Wi-Fi only devices,
Remote Areas) where people still need to work without a connection.

So,
When workers need offline mobile capabilities, do we need to develop
Native mobile application on the device, for example with objective-C
For the iPhone, or is a mobile Web-based app a viable option?

It
Turns out, the answer is changing very quickly, because more HTML5
Capabilities like local storage and local databases are being added
Mobile browsers to support offline capabilities.

Short answer: mobile Web apps are ready to go offline

The
Short answer is yes, it is now a practical option to develop
Entirely web-based mobile app with offline capabilities for Example
Scenarios. notice that I say your scenarios, not all. At this point in
Time, it still depends on what offline capabilities are needed.
Specifically, the main factors are how much offline data is needed and
What indexing capabilities are required.

How is an offline web app even possible?

To
Understand what offline scenarios are good candidates for a mobile Web
APP, it helps to first understand the key technologies that make it
Possible.

Mobile Web apps can be built with three core capabilities, and all of these are part of the new HTML5 standards:

    1. Browser Application caching of pages
    2. Local Storage
    3. Local Database

browser application caching
allows a manifest to be created listing pages that shoshould be cached and
made available offline. normally, when you visit a URL, a server
request is made to return the page. setting up an application cache
manifest tells the browser how it can use pages already downloaded
rather than just immediately displaying an error when there is no longer
a network connection.

Local Storage
is a standard that retains local web app data (even when the browser is
shut down) using a key/value system that works similarly to browser
cookies. however, it is different from browser cookies in two important
ways. first, cookies are resent to the server with every HTTP request,
and it wowould waste a lot of bandwidth to resend all offline data when
the server doesn't need it. secondly, cookies tend to max out at around
4 K of data, while local storage usually gives an application as much as 5
MB of data to work with per domain. 5 MB may not sound like much, but
when used carefully, it can go a very long way in terms of offline local
storage.

Local Database
Removes the 5 MB limit of local storage and allows data to be indexed so
That multiple properties can be queried quickly. This is only an HTML5
Proposed Standard at present; only Internet Explorer and Firefox have
Implemented it so far. Safari and chrome use an older, deprecated System
Called Web SQL.This means if you need this level of functionality,
There is a significant amount of extra work and complexity to support
Both standards internal SS all major browsers.
Hopefully, that won't always be the case and major browsers will conform to the finalized HTML5 specifications.

So, is a mobile web app a good solution for offline features or not?

The
Key here is whether your app needs the higher storage limits (greater
Than 5 MB) and indexing features that come with a local database. If
Local Database and major browser support are needed, it stacks the deck
Against a web app because of the extra work and complexity needed
Support two very different standards.

However, if you can getWithout
Using a local database, and your offline storage needs are below 5 MB,
Then using local storage and browser application caching alone will
Allow for a clean solution that works well formed SS major browsers.

To decide if local storage is good enough, consider these constraints for the app:

    1. The total size of data you need to keep offline
    2. The number of data items (Records) You need to keep offline
    3. The number of data properties (fields) You need to search

If
You need less than 5 MB at a time offline, local storage fits the bill.
If you have a large number of records but usually only one field
Search on, local storage is still a good fit. If you have created fields
Search on but the total number of records is small, again Local Storage
Wocould work nicely.

By answering these questions about your app, you shoshould have a good idea about the practicality of a mobile offline solution.

There is much more to the native vs. Web demo-

Here,
We 've focused mainly on issues around offline capabilities for mobile
Apps. However, keep in mind the more general demo-criteria still
Apply.

For example, if you need to allow a user to take a photo
With a built-in camera and upload it to a server, a mobile web app
Simply is not capable of meeting your needs. Beyond the device
Capabilities questions, there are also the issues of what skill set you
Want your company to invest in and what types of apps you tend
Develop.

Finally keep in mind that "native vs. Web" is
Simplification of the choices. Mobile Web apps can be built by just
Adding a viewport tag to an existing site, adaptive rendering (CSS Media
Queries), and dedicated views for mobile devices. native apps can be
Built with the vendor Toolkit (like objective-c), or with an unsupported action
Platform (like titanium), or by bundling HTML with a native Library
(Like phonegap). The "native vs. Web" dilemma shouldn't be seen as two
Polar extremes; it is actually a continuum of choices from one end
The spectrum to the other.

Think offline

It turns out that
The variety of mobile apps that can benefit from offline features is
Quite diverse. If you're in the process of making a platform demo-to
Build a mobile app, it's a good idea to think through all of
Offline possibilities that have been discussed abve as part of
Process. You 'd be surprised how many mobile projects can benefit from
HTML5's new offline capabilities.

Do you have any experience
Using HTML5's caching, local storage, or local databases? Do you use any
Mobile Web apps that employ offline storage?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.