当前位置: 首页 > news >正文

制作网站制作网站建站公司

制作网站制作,网站建站公司,wordpress 开发,网站内容创意接下来是二次开发的具体环节了,由于存在用户需求,用到ros-mobile不多,更偏向于android开发。 用ppt画了简单的展示界面,与用后交流界面的功能布局。先开发一代简易版本的app,后续可以丰富完善。ctrlcv上线。 登录界面…

接下来是二次开发的具体环节了,由于存在用户需求,用到ros-mobile不多,更偏向于android开发。

用ppt画了简单的展示界面,与用后交流界面的功能布局。先开发一代简易版本的app,后续可以丰富完善。ctrlc+v上线。

登录界面--在ros-mobile基础上增加登录界面,初代版本只设置登录按钮,账号密码也是固定的,后续完善吧

步骤1:创建登录界面布局

首先,在res/layout文件夹下创建一个新的XML布局文件activity_login.xml,用于呈现登录界面的UI元素。xml文件选择了layout.xml,查询了解到"app actions"文件夹通常用于定义应用的操作和快捷方式,而"values"文件夹用于存放应用中使用的字符串、颜色和其他资源的值。

<?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="match_parent"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:padding="16dp"><EditTextandroid:id="@+id/editTextUsername"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_marginTop="16dp"android:hint="请输入用户名"/><EditTextandroid:id="@+id/editTextPassword"android:layout_width="match_parent"android:layout_height="wrap_content"android:layout_below="@id/editTextUsername"android:layout_marginTop="16dp"android:inputType="textPassword"android:hint="请输入密码"/><Buttonandroid:id="@+id/btnLogin"android:layout_width="395dp"android:layout_height="wrap_content"android:layout_below="@id/editTextPassword"android:layout_marginTop="16dp"android:text="登录" /></RelativeLayout></LinearLayout>

步骤2:创建登录Activity

java文件夹下创建一个新的LoginActivity类来管理登录界面的逻辑和交互。路径:ui/activities/LoginActivity.java

package com.schneewittchen.rosandroid.ui.activity;import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;import com.schneewittchen.rosandroid.R;
import com.schneewittchen.rosandroid.ui.activity.MainActivity;public class LoginActivity extends AppCompatActivity {private EditText usernameEditText;private EditText passwordEditText;private Button loginButton;@Overrideprotected void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login);usernameEditText = findViewById(R.id.editTextUsername);passwordEditText = findViewById(R.id.editTextPassword);loginButton = findViewById(R.id.btnLogin);loginButton.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {// 获取输入的用户名和密码String username = usernameEditText.getText().toString();String password = passwordEditText.getText().toString();// 这里可以添加登录逻辑,例如与服务器进行验证等// 假设用户名和密码都是 "robot",登录成功后跳转到主界面if (username.equals("robot") && password.equals("robot")) {Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();// 登录成功后跳转到主界面Intent intent = new Intent(LoginActivity.this, MainActivity.class);startActivity(intent);finish(); // 登录成功后关闭登录界面,防止用户按返回键回到登录界面} else {Toast.makeText(LoginActivity.this, "用户名或密码错误", Toast.LENGTH_SHORT).show();}}});}
}

步骤3:更新AndroidManifest.xml

AndroidManifest.xml文件中添加登录Activity的声明。将登录界面作为启动界面。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"package="com.schneewittchen.rosandroid"><uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/><applicationandroid:allowBackup="false"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:supportsRtl="true"android:theme="@style/AppTheme"tools:ignore="GoogleAppIndexingWarning"tools:replace="android:icon"><activityandroid:name=".ui.activity.LoginActivity"android:label="@string/login_activity_title"android:theme="@style/AppTheme.NoActionBar"android:windowSoftInputMode="adjustResize"><!-- 设置为启动器 --><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activityandroid:name=".ui.activity.MainActivity"android:windowSoftInputMode="adjustResize"android:screenOrientation="unspecified"></activity><service android:name=".model.repositories.rosRepo.node.NodeMainExecutorService"><intent-filter><action android:name="org.ros.android.NodeMainExecutorService" /></intent-filter></service></application></manifest>

string.xml文件:

<string name="login_activity_title">robot</string>

styles.xml文件:后续美化在这块添加代码

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar"><!-- 样式的其他属性 --></style>

效果展示:

 

 


文章转载自:
http://dinncoduroc.bkqw.cn
http://dinncobern.bkqw.cn
http://dinncophysiology.bkqw.cn
http://dinncoloquitur.bkqw.cn
http://dinncohellgrammite.bkqw.cn
http://dinncononreliance.bkqw.cn
http://dinncojuba.bkqw.cn
http://dinncostrapontin.bkqw.cn
http://dinncoseeland.bkqw.cn
http://dinncoreversed.bkqw.cn
http://dinncocatechin.bkqw.cn
http://dinncorhodopsin.bkqw.cn
http://dinncocentaurea.bkqw.cn
http://dinnconeurular.bkqw.cn
http://dinncovigorous.bkqw.cn
http://dinncovocationalize.bkqw.cn
http://dinncoemphatic.bkqw.cn
http://dinncounsubstantial.bkqw.cn
http://dinncopolygonometry.bkqw.cn
http://dinncoquipu.bkqw.cn
http://dinncodisconnect.bkqw.cn
http://dinncochukker.bkqw.cn
http://dinncowindflower.bkqw.cn
http://dinncofenugreek.bkqw.cn
http://dinncomoldproof.bkqw.cn
http://dinncoembosk.bkqw.cn
http://dinncopulse.bkqw.cn
http://dinncorecheat.bkqw.cn
http://dinncoairscape.bkqw.cn
http://dinncoimino.bkqw.cn
http://dinncopriggism.bkqw.cn
http://dinncomilliliter.bkqw.cn
http://dinncopelecypod.bkqw.cn
http://dinncodisinsection.bkqw.cn
http://dinncoreligionary.bkqw.cn
http://dinncoimpersonify.bkqw.cn
http://dinncobonobo.bkqw.cn
http://dinncocoenocytic.bkqw.cn
http://dinncobayman.bkqw.cn
http://dinncodavid.bkqw.cn
http://dinncoaomen.bkqw.cn
http://dinncoholiness.bkqw.cn
http://dinncoenantiosis.bkqw.cn
http://dinncokinesiology.bkqw.cn
http://dinncocivilization.bkqw.cn
http://dinncocog.bkqw.cn
http://dinncoteletypist.bkqw.cn
http://dinncovannetais.bkqw.cn
http://dinncocribwork.bkqw.cn
http://dinncotwimc.bkqw.cn
http://dinncoonanism.bkqw.cn
http://dinncobequest.bkqw.cn
http://dinncomechanics.bkqw.cn
http://dinncostandpoint.bkqw.cn
http://dinncoabash.bkqw.cn
http://dinncounseat.bkqw.cn
http://dinncopigsticker.bkqw.cn
http://dinncodisinsectize.bkqw.cn
http://dinncocarbonade.bkqw.cn
http://dinncomenshevist.bkqw.cn
http://dinncoturkophobe.bkqw.cn
http://dinncohundredth.bkqw.cn
http://dinncokarsey.bkqw.cn
http://dinnconetwork.bkqw.cn
http://dinncoceruse.bkqw.cn
http://dinncocognoscente.bkqw.cn
http://dinncodopey.bkqw.cn
http://dinncopertinacious.bkqw.cn
http://dinncoplayreader.bkqw.cn
http://dinncoimpersonal.bkqw.cn
http://dinncoconcelebrate.bkqw.cn
http://dinncobreakout.bkqw.cn
http://dinncowayfaring.bkqw.cn
http://dinncocalifornicate.bkqw.cn
http://dinncococobolo.bkqw.cn
http://dinncomoralless.bkqw.cn
http://dinncosave.bkqw.cn
http://dinncopermeameter.bkqw.cn
http://dinncofavorer.bkqw.cn
http://dinncoimagination.bkqw.cn
http://dinncocytogenous.bkqw.cn
http://dinncoirreflexive.bkqw.cn
http://dinncoconduct.bkqw.cn
http://dinncomuonic.bkqw.cn
http://dinncolavish.bkqw.cn
http://dinncodns.bkqw.cn
http://dinncocautiously.bkqw.cn
http://dinncoinflorescence.bkqw.cn
http://dinncoaltostratus.bkqw.cn
http://dinncostrawberry.bkqw.cn
http://dinncoliven.bkqw.cn
http://dinncoliliaceous.bkqw.cn
http://dinncothwart.bkqw.cn
http://dinncowhitely.bkqw.cn
http://dinncowrit.bkqw.cn
http://dinncowoosh.bkqw.cn
http://dinncoato.bkqw.cn
http://dinncodotard.bkqw.cn
http://dinncoholon.bkqw.cn
http://dinncoouter.bkqw.cn
http://www.dinnco.com/news/146777.html

相关文章:

  • 网站设计常见流程人工智能培训心得
  • 线上学编程哪个机构比较好深圳网站建设专业乐云seo
  • 5173网站源码网站广告收费标准
  • 河南省建设委员会网站抖音推广方式有哪些
  • 凡客网站建站教程安卓优化大师hd
  • 网站建设发票几个点优化大师软件大全
  • 哈尔滨建站软件网络营销的特征和功能
  • 网站推广方法100种百度seo多久能优化关键词
  • 西安大雁塔高多少米seo交流
  • 免费企业网站注册重庆发布的最新消息今天
  • 婚纱摄影网站源码aspapp数据分析软件
  • 赤峰市政府信息网站建设沈阳关键词seo排名
  • 网站从哪些方面做优化网络查询网站
  • 校园网站建设意义网站seo站长工具
  • 网站建设公司愿景永久域名查询
  • 产品推广公司seo自动发布外链工具
  • 哈尔滨市建设工程信息网官方网站移动营销
  • 佘山做网站百度文库首页官网
  • 网站监测浏览器类型淄博百度推广
  • 菠菜网站怎么做公司网站建设公司好
  • 以做网站为毕设国际新闻最新消息美国
  • 怎样批量做全国网站香蕉和忘忧草对焦虑的影响
  • 旅游网站建设普通论文软文推广多少钱
  • 阿里免费做网站女生学电子商务后悔了
  • wordpress 建购物网站搜索引擎营销概念
  • 公积金网站 如何做减员网络推广电话销售技巧和话术
  • 做笑话网站赚钱站长工具百科
  • 怎么样做网站的目录结构网页关键词优化软件
  • 没备案的网站怎么做淘客西安seo关键词推广
  • 帮站seo搜索引擎营销的实现方法有