Android 开发者 API 引用指南

本文档旨在为 Android 开发者提供 API 引用信息,帮助开发者快速查找和使用 Android 系统提供的 API。

常用 API 列表

  • UI 组件

    • TextView:用于显示文本信息。
    • Button:用于响应用户点击事件。
    • ImageView:用于显示图片。
  • 网络请求

    • HttpURLConnection:用于发送 HTTP 请求。
    • OkHttp:一个异步 HTTP 客户端。
  • 数据库

    • SQLite:Android 内置的轻量级数据库。

快速链接

示例代码

TextView textView = findViewById(R.id.text_view);
textView.setText("Hello, Android!");

Button button = findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Toast.makeText(MainActivity.this, "Button clicked!", Toast.LENGTH_SHORT).show();
    }
});

Android 开发者