Android Web App official document translation Chapter 1: Overview

Source: Internet
Author: User

This article is from Google Android's official Web App development guide, divided into five articles: 1. Overview, 2. screen size, 3. Web View creation, 4. debugging and 5. Best practices.

 

Figure 1. you can use either of the following methods to allow users to access your Web content: Add a WebView to the layout in a traditional way, that is, through a browser or in an Android app.
The first article is as follows:
There are basically two ways to publish an application on Android: as a client application (using Android sdkfor development and making a. APK installed on a user's device) or as a Web application (using Web standard development, and access it through a web browser-you do not need to install anything on your device ).
The method you choose to publish your application is based on several factors, but Android makes a decision to make it easier to develop a Web application. For this reason, they provide:
The support for the viewport attribute allows you to determine the proper size of your Web application based on the screen size.
CSS and Javascript features allow you to provide different styles and images based on the pixel density (screen resolution) of the screen
Therefore, when you decide whether to develop a Web application, you do not need to consider screen support, because it is now easy to make Web pages look appropriate on various Android-supported screens.
Another good feature of Android is that you do not need to build your applications on the client or Web. You can combine the two to develop an Android Application and embed some Web pages (use WebView In the Android Application layout ). Figure 1 illustrates how your Web page can be accessed from both a browser and an Android app. However, you should not develop an Android app, but simply use it as a method to load your website. On the contrary, the pages you embed in Android applications should be designed specifically for this environment. You can even define an interface between your Android app and your webpage so that Javascript in the webpage can call APIs in your Android app-providing Android APIs for your Web-based app.
From Android 1.0, Android apps can use WebView to embed webpage content in the layout and bind Javascript to Android APIs. After Android supports more screen resolutions (supports high-resolution and low-resolution screens), Android2.0 adds some features in the Webkit framework, allows the Web page to specify the viewport attribute and query the screen resolution to revise the style and image attributes, as mentioned above. These features are part of the Android Webkit framework. Both the Android browser (the default browser provided by the platform) and WebView support the same viewport and screen resolution features.
To develop a Web application for Android-driven devices, read the following documents:
Set proper size for Web Apps
How to Set your Web application to a proper size and support multi-resolution on Android devices. When you are building an application that you want to be available on Android devices (You have to make this assumption for anything you want to publish on the Web ), the information in this document is very important, especially when you target a mobile device or use WebView.
Build Web Apps in WebView
How to Use WebView to embed web pages in your Android app and bind Javascript to Android APIs.
Debug Web Apps
How to use JavaScript Console APIs to debug Web applications.
Best practices for Web Apps
A series of practices you need to follow to provide effective Web applications for Android devices.
 

Related Article

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.