Functions of various Java packages in Android

Source: Internet
Author: User

In addition to the basic knowledge of the Java language, you also need to understand the extended Java functions provided by Android.

In general Java applications, if you need to reference the base class library, you usually need to use the following method:
Import javax. Swing .*;
AboveCodeRefers to the reference to the Java GUI Component swing, javax. Swing is a package in Java.
Android provides some extended Java class libraries. The class libraries are divided into several packages. Each package contains several classes. For example, in Android, the calculator is relatively simple.ProgramThe entry program file is calculator. Java, which contains the following content:
Package com. Android. calculator2;
Import Android. App. activity;
Import Android. OS. Bundle;
Import Android. util. log;
Import Android. util. config;
Import Android. View. Menu;
Import Android. View. menuitem;
Import Android. View. window;
Import Android. View. view;
Import Android. widget. Button;
Import Android. widget. listview;
Import Android. content. res. configuration;

in Android, various packages are written as Android. * method. The important package is described as follows:
android. APP: provides high-level program models and basic runtime Environments
android. content: contains various categories for accessing and publishing device data
android. database: browses and operates databases through the content provider
android. graphics: The underlying graphics library, including canvas, Color Filtering, vertices, and rectangles, which can be directly drawn to the screen.
android. location: positioning and related service classes
android. media: provides some media interfaces to manage multiple types of audio and video.
android.net: provides classes to help network access, exceeding the normal java.net. * interface
android. OS: Provides system services, message transmission, and IPC
android. openGL: Provides OpenGL tools
android. provider: Provides content providers for class access to Android
android. telephony: provides API Interaction Related to dialing.
android. view: provides a basic user interface framework
android. util: a tool-based method, such as a time and date operation
android. webKit: default browser operation interface
android. widget: contains various UI elements (mostly visible) for use on the application screen

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.