智能小车的手机控制端app编写

2019-10-14
今天打算编写一个智能小车的控制app,包含一个控制界面和登陆界面
下面是博主写好的一个登陆界面
按照上一篇文章说的方法,出现的错误studio会很贴心的再右下角提示
常见的问题我的这边博客里有
https://blog.csdn.net/qq_36444039/article/details/102529660
![在这里插入图片描述](https://img-blog.csdnimg.cn/20191014105236860.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM2NDQ0MDM5,size_36,color_FFFFFF,t_1
下载anroid studio-----》记得在bios中打开VT-X----》根据左下角的提示安装AVD与SDK—》配好AVD的环境变量-----》即可运行
在这里插入图片描述
图中是我的sdk路径
在这里插入图片描述
我的studio已经更新到最新版本了,用起来很方便

Anroidmanifest代码

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

    <dist:module dist:instant="true" />

    <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/AppTheme">
        <activity android:name=".Main3ActivityBaseAdapter"></activity>
        <activity android:name=".Main2ActivityAdapterDemo" />
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

layout代码

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:paddingLeft="55px"
        android:paddingRight="50px"
        tools:context=".MainActivity">
        <TextView
            android:id="@+id/message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/activity_horizontal_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
            android:layout_marginTop="@dimen/activity_vertical_margin"
            android:text="Hello Word!"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
        <View
            android:layout_width="match_parent"
            android:layout_height="2px"
            android:layout_marginTop="16px"
            android:background="#000000" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="28dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="20px"
            android:text="登陆界面" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >
        <EditText
            android:id="@+id/et1"
            android:layout_width="280dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:paddingLeft="10dp"
            android:hint="请输入账号"
            android:inputType="text"/>
        <ImageView
            android:id="@+id/bt1"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:layout_marginTop="37dp"
            android:src="@drawable/delete" />
    </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:paddingLeft="8px">
        <EditText
            android:id="@+id/et2"
            android:layout_width="280dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="26dp"
            android:hint="请输入密码"
            android:inputType="textPassword" />
            <ImageView
                android:id="@+id/bt2"
                android:layout_width="25dp"
                android:layout_height="25dp"
                android:layout_marginTop="33dp"
                android:src="@drawable/delete" />
    </LinearLayout>
            <Button
                android:id="@+id/btn_login"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:background="@color/bbutton_danger_disabled_edge"
                android:layout_marginTop="30dp"
                android:text="登  陆"
                android:textSize="30dp"
                android:textColor="@color/bbutton_danger"/>
        <Button
        android:id="@+id/bbt1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15dp"
        android:layout_gravity="right"
        android:layout_marginTop="20px"
        android:background="@color/bbutton_danger"
        android:text="Adapter" />
        </LinearLayout>

    <android.support.design.widget.BottomNavigationView
        android:id="@+id/navigation"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="0dp"
        android:layout_marginEnd="0dp"
        android:background="?android:attr/windowBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/navigation" />
</android.support.constraint.ConstraintLayout>

同时右边会显示我的layout窗口
在这里插入图片描述

发布了76 篇原创文章 · 获赞 14 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_36444039/article/details/102542591