GVKun编程网logo

ADB Interface驱动安装[Android Studio开发](android adb interface 驱动安装)

11

本文将分享ADBInterface驱动安装[AndroidStudio开发]的详细内容,并且还将对androidadbinterface驱动安装进行详尽解释,此外,我们还将为大家带来关于android

本文将分享ADB Interface驱动安装[Android Studio开发]的详细内容,并且还将对android adb interface 驱动安装进行详尽解释,此外,我们还将为大家带来关于android studio NullPointerException at addDrawerListener 方法、Android Studio 手动安装 Plugins、android studio修改配置文件夹(.android .gradle .AndroidStudio)位置、Android Studio安装Unable to access Android SDK add-on list处理方法的相关知识,希望对你有所帮助。

本文目录一览:

ADB Interface驱动安装[Android Studio开发](android adb interface 驱动安装)

ADB Interface驱动安装[Android Studio开发](android adb interface 驱动安装)

在Android Studio做Android手机软件开发,但是连上电脑后显示找不到驱动程序:

百度了一下,这种方法亲试有效,这里Mark一下,以备后用:

1、计算机-->  右击 --> 管理 --> 设备管理器

2、双击带黄色感叹号的ADB Interface

3、点击更新驱动程序:

4、点击 “浏览计算机以查找驱动程序软件”:

5、点击“从计算机的设备。。。”:

6、不做选择,直接点击“下一步”:

7、点击“从磁盘安装”

8、在弹出的对话框中选择“浏览”。

选择电脑上的Android SDK目录中的android_winusb.inf 文件,点击“确定”按钮。关闭了对话框之后再点击“下一步”按钮。android_winusb.inf 位置在 %sDK目录%/extras/google/usb_driver 目录中。有的小伙伴说我的SDK目录中没有这个文件。那你可以把文章拉到后面,我后面会说到如何找到这个文件。

9、点击“下一步”按钮

会有以下警告,点击“是”

经过一会的安装就提示安装完成啦!

找不到驱动目录文件快速解决方法:

刚才有的同学在  %sDK目录%/extras/google/  下找不到   usb_driver/android_winusb.inf。那么这时候要打开你的Android Studio,在Android SDK中选择“SDK Tools”,安装“Google USB Driver”就可以了

连接好手机后电脑无显示ADB interface设备,可能原因是你的android手机没有打开“开发者模式”的“USB调试使能”:

在手机界面,设置-->开发者选项-->USB调试

android studio NullPointerException at addDrawerListener 方法

android studio NullPointerException at addDrawerListener 方法

如何解决android studio NullPointerException at addDrawerListener 方法?

我正在尝试构建一个包含少量项目的导航抽屉。但它让我在下面的代码中的 addDrawerListener 方法出错:

public class MainActivity extends AppCompatActivity {
    private DrawerLayout drawer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,drawer,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();
    }

    @Override
    public void onBackpressed() {
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else{
            super.onBackpressed();
        }
    }
}

这里是 AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApplication">
        <activity android:name=".MainActivity"
            android:theme="@style/Theme.MyApplication.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

这是菜单 ( drawer_menu.xml ),它似乎工作正常

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:showIn = "navigation_view">

    <group android:checkableBehavior="single">

        <item android:id="@+id/nav_people"
            android:icon="@drawable/ic_people"
            android:title="@string/people" />
        <item android:id="@+id/nav_goods"
            android:icon="@drawable/ic_goods"
            android:title="@string/goods" />
        <item android:id="@+id/nav_delivery"
            android:icon="@drawable/ic_delivery"
            android:title="@string/delivery" />
        <item android:id="@+id/nav_saloon"
            android:icon="@drawable/ic_saloon"
            android:title="@string/saloon" />
        <item android:id="@+id/nav_setting"
            android:icon="@drawable/ic_setting"
            android:title="@string/setting" />
        <item android:id="@+id/nav_help"
            android:icon="@drawable/ic_help"
            android:title="@string/help" />
        <item android:id="@+id/nav_update"
            android:icon="@drawable/ic_update"
            android:title="@string/update" />
        <item android:id="@+id/nav_about_us"
            android:icon="@drawable/ic_about_us"
            android:title="@string/about_us" />
        <item android:id="@+id/nav_quit"
            android:icon="@drawable/ic_exit"
            android:title="@string/exit" />

    </group>
</menu>

还有一个标题( nav_header.xml ),其中包含一张小图片和两个文本视图

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/nav_header"
    android:gravity="bottom"
    android:orientation="vertical"
    android:padding="16dp"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@mipmap/ic_launcher_round" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="8dp"
        android:text="@string/strong_text"
        android:textAppearance="@style/TextAppearance.AppCompat.Body1" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/weak_text" />

</LinearLayout>

这里是 themes.xml 文件。我试图遵循的教程有点过时,并且有styles.xml 文件而不是themes.xml 但我不确定。我复制粘贴 <style name="Theme.MyApplication.NoActionBar">

中的 themes.xml (night) 部分
<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
        <!-- Primary brand color. -->
        <item name="colorPrimary">@color/purple_500</item>
        <item name="colorPrimaryVariant">@color/purple_700</item>
        <item name="colorOnPrimary">@color/white</item>
        <!-- Secondary brand color. -->
        <item name="colorSecondary">@color/teal_200</item>
        <item name="colorSecondaryVariant">@color/teal_700</item>
        <item name="colorOnSecondary">@color/black</item>
        <!-- Status bar color. -->
        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
        <!-- Customize your theme here. -->
    </style>

    <style name="Theme.MyApplication.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>

</resources>

解决方法

drawer 使用前需要初始化。

drawer = findViewById(R.id.drawer) 

(注意:在 param 中,您需要像 Toolbar 一样从 xml 传递 DrawerLayout 的 id)。

这应该在你使用 drawer 之前,在你的案例下面的行之前。

ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,drawer,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close);
,

您必须像使用工具栏一样绑定 drawerLayout id。

在使用“抽屉”对象之前,只需在 XML 中绑定抽屉的 id。

,

在查找工具栏 id 下添加以下行 -

int

Android Studio 手动安装 Plugins

Android Studio 手动安装 Plugins

Android Studio3.6为例


由于网络原因,android studio的插件市场经常不能打开或者不能下载,这种情况我们可以手动下载插件压缩包,再手动安装。
第一步,打开基于IntelliJ平台的产品搜索你要的插件,以GsonFormat为例

基于IntelliJ平台的产品


第二步,点右边的get按钮,同时选择使用android studio,同时要注意android studio版本信息,android studio的版本在菜单help-about里可以查看,选择合适的版本点击后面的download.

选择Android Studio


第三步,打开android studio,file-setting-plugins,打开箭头位置的菜单,选择

安装本地插件选项


本地安装插件


选择下载的压缩包,安装,重启android studio 即可。

安装完成选中红框,继续点解Restart IDE

android studio修改配置文件夹(.android .gradle .AndroidStudio)位置

android studio修改配置文件夹(.android .gradle .AndroidStudio)位置

Android studio安装之后一般默认在c:/user/userid(*****)/;(比如:c:/user/xiaohong/)其他软件在安装中要创建缓存文件夹,那么也会在这个目录创建,比如Notepad++等

这三个文件夹的作用:

.android 这个文件夹是Android SDK生成的AVD(Android Virtual Device Manager)即模拟器存放路径 
.AndroidStudio 这个文件夹是Android Studio的配置文件夹,主要存放一些AndroidStudio设置和插件和项目的缓存信息 

.gradle 这个文件夹是构建工具 Gradle的配置文件夹,也会存储一些项目的构建缓存信息

默认创建路径在C盘,比较占空间,现在来转移至D盘

android文件夹的修改 
这个文件夹是由Android SDK配置模拟器生成的,也是最占空间的一个。 
首先,需要添加一个系统的环境变量ANDROID_SDK_HOME,如下图: 

这里写图片描述

 
创建模拟器后默认位置还是在C盘,复制到D盘,修改如下图: 

这里写图片描述

AndroidStudio文件夹的修改 
进入Android Studio的安装目录,进入bin文件夹,用文本编辑软件打开idea.properties,去掉以下两项的注释符号#,修改对应的路径为新路径即可。 

这里写图片描述

gradle文件夹的修改 

这里写图片描述

陈贵贵 发布了82 篇原创文章 · 获赞 4 · 访问量 2万+ 私信 关注

Android Studio安装Unable to access Android SDK add-on list处理方法

Android Studio安装Unable to access Android SDK add-on list处理方法

Unable to access Android SDK add-on list。

很多人写的加屏蔽语句,跳过检测,其实是不行的,因为最后还是要下载。

不翻墙的情况下,一般都是修改host文件:C:\Windows\System32\drivers\etc\hosts

 

 

这个IP是怎么发现的呢?

用http://ping.chinaz.com/dl.google.com,输入dl.google.com

然后,点ping检测,选最快的那个IP即可

我们今天的关于ADB Interface驱动安装[Android Studio开发]android adb interface 驱动安装的分享已经告一段落,感谢您的关注,如果您想了解更多关于android studio NullPointerException at addDrawerListener 方法、Android Studio 手动安装 Plugins、android studio修改配置文件夹(.android .gradle .AndroidStudio)位置、Android Studio安装Unable to access Android SDK add-on list处理方法的相关信息,请在本站查询。

本文标签: