How Android differentiates app native and WebView implementations

Source: Internet
Author: User

When developing the Android app, especially the strong content display function, will want to choose in the native native implementation and the Web implementation, when making this choice, inevitably want to look at the competitor or other app similar function is implemented in which way. But how can you tell if other apps are implemented using native controls or WebView loading Web pages? In fact, to do this is not difficult, there are at least two ways:

First, grab the bag

This is relatively primitive, it is relatively easy to think of, open the corresponding interface, crawl the packet to see if there is a URL is to return the more complete HTML code, it is basically webview to achieve.

Second, the use of system developer tools

The method of grasping the package is still too troublesome, many systems have more advanced developer tool function, usually can be found in the setup, some phones may need special operation to open the Developer tool function. Take Meizu MX2 As an example, enter *#* #6961 #*#* on the dial-up interface to open the Developer Tools feature (Input *#* #6960 #*#* off), click "Settings", "Accessibility" and "Developer Tools" , find "Show layout boundaries" in the drawing bar and open. So the control layout of all the apps is at a glance, WebView as a control, there is only one bounding box, so through this, it is easier to distinguish whether an interface is implemented WebView or native layout control, Of course, do not rule out the use of a bunch of webview to spell an interface implementation method.

As a native and WebView interface, the blue wireframe is the drawing boundaries of each control, the middle of the large layout of the rich interface does not show a lot of the border Blue Line, is the implementation of the Web page.

In addition to the above two methods, in general, by disconnecting the network, refresh the interface, observe the content cache can also have a general pre-judgment on the implementation of the way, generally, the cache is done well, are native control implementation, there is the interface of the local cache is more likely to be native.

Are there any other options for the pros? Welcome to the comments below!

How Android differentiates app native and WebView implementations

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.