Android 如何在Eclipse中查看Android API源码以及support包源码

在Eclipse中需要查看某个类的源码,直接按住Ctrl 然后点击该类名就能查看源码啦,比如查看Button的源码,如图


是不是够方便的呢,接下来我就来教大家怎么关联,我们关联android2.2的源码和support包源码就够了,下面是下载地址

android2.2 源码下载

1.点击工程,选择Properties



选择你源码的存放路径就行了,然后重启Eclipse就行了

可是你想查看android-support-v4.jar的源码的时候你会发现悲剧了,看不了,那是因为我们我们关联android-support-v4.jar的源码,接下来就教大家怎么关联android-support-v4.jar的源码,Android SDK在extras目录中同样提供了support包的源码,当然前提是你使用Android SDK Manager下载过了Android Support Library。当我们使用到support包的时候,它一般都会静静的躺在libs目录里,这个时候我们只需要在同一个目录下建一个properties文件,名字跟你所用的support jar包相同,即android-support-v4.jar会有一个对应的android-support-v4.jar.properties的文件


在里面输入android-support-v4.jar路径就行了,源码在android-sdk目录下的extras\android\compatibility\v4\src,这是我的源码路径,你根据情况修改即可


关闭工程在打开工程,然后你找到ViewPager,按住Ctrl点击ViewPager


是不是很方便呢,呵呵

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以使用Eclipse开发Android应用程序,实现网页源码查看器。以下是一个简单的示例代码: MainActivity.java ```java package com.example.webpageviewer; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private WebView webView; private EditText editText; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = findViewById(R.id.webView); editText = findViewById(R.id.editText); button = findViewById(R.id.button); webView.setWebViewClient(new WebViewClient()); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String url = editText.getText().toString(); webView.loadUrl(url); } }); } } ``` activity_main.xml ```xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <EditText android:id="@+id/editText" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Enter URL" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Go" /> <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> ``` 这个示例应用程序含一个EditText控件和一个Button控件,用于输入URL和导航到网页。WebView控件用于显示网页。在MainActivity,我们为Button控件添加了一个单击事件侦听器,当单击按钮时,我们使用WebView控件加载输入的URL。我们还将WebView设置为使用WebViewClient,以便在WebView显示网页。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值