android studio usage tutorial
Android Studio is an Android integrated development tool launched by Google, based on IntelliJ IDEA. Similar to Eclipse ADT, Android Studio Integrated Android development tools are provided for development and debugging. The following is an introduction to the basic usage.
1. Create an Android project, click File ->New->New Project,
where open is to open an Android project
2. Enter the name of the project test, put this project under the E drive, and then click Finish
3. Select the version of the Android virtual machine. The lower the version, the faster it will run. There is no need to check other options.
4. Select the Android template, select the empty template Empty Activity of the basic class android, and click Next
5. Set the name of Activity and Layout, which are usually automatically generated. If necessary, you can change them here,
The last box cannot be checked, Otherwise it may cause project exception, then click Finish.
6. This is what the Android project will look like after it is built. There are three main files: main configuration file: AndroidManifest.xml,
Human-computer interaction MainActivity, as well as layout LayLout: activity_main.xml
##7. Virtual Machine display: Click the triangle icon run to run the virtual machine, directly select the default virtual machine, click ok
##8
Activity
: It is a human-computer interaction program, which is equivalent to a bridge between human and machine operations. It is similar to a shell. Java code is written in it to achieve what you want. Business processing implemented.
activity_main.xml: It is the view displayed on the Android interface. All configuration controls and various controls can be designed here.
AndroidManifest.xml: Main configuration file, used to configure the access permissions of each component.
R.java: Simply put, it is the ID number of the control in android_main.xml. It is convenient to find the ID in MainActivity to determine the control, so as to perform business processing.
app: Usually the various components of Android are placed in this directory, where res stores some resource files, such as pictures, layouts, values and other resources. 9. A simple entry-level Activity program
(1) First configure the control in Activity_main.xml.
First change android.support.constraint.ConstraintLayout to LinerLayout linear , meaning a horizontal structure
And add ndroid:orientation="vertical" to place all components vertically and add a text display component TextView and a button component ButtonYou can design through design and you can see the effect. We set up two components and set an id for each component. The id of the text box is t1 and the id of the button is But1, this id can be named arbitrarily for the convenience of MainActivity calling.
(2) Perform business logic processing in MainActivity: define the global variables of the two components, and then obtain the ID numbers of the two components of the R file through find ViewById, and proceed For business processing, set an event response for Button. By implementing the OnClickListener interface of the View class, and
public void onClick(View v){ t1.setText();//设置文本显示信息。 }
(3) Confirm whether the event response is successful: click OK: text display content appears.
10.setting configuration: android studio If you are not running local gradle, it may be slower or abnormal, it is recommended to use local
gradle.
Process: Click FIle->Setting... and then click ok
.
The above is the detailed content of android studio tutorial. For more information, please follow other related articles on the PHP Chinese website!

已经火了很久了,身边的同事也用它来进行一些调研,资源检索,工作汇报等方面都有很大的的效率提升。很多人问ChatGPT会不会取代程序员?我的回答是:不会!ChatGPT并不是我们的敌人,相反的是,它是我们的好帮手。未来人和人的竞争,可能就会从原先的我懂得更多,我实操经验更丰富,变成了我比你更会用工具,我比你更懂得提问,我比你更会发挥机器人的最大特性,所以,为了不掉队,你还不准备体验下ChatGPT吗?快速体验面试官经常会问你的项目有啥重难点?很多人不会回答,直接看看ChatGPT怎么说,真的太牛了

微软近日透露了将推出win11系统,很多用户都在期待新系统呢。网上已经有泄露关于win11的镜像安装系统。大家不知道如何安装的话,可以使用U盘来进行安装。小编现在就给大家带来了win11的U盘安装教程。1、首先准备一个8G以上大小的u盘,将它制作成系统盘。2、接着下载win11系统镜像文件,将它放入u盘中,大家可以直接点击右侧的链接进行下载。3、下载完成后装载该iso文件。4、装载完成之后会进入新的文件夹,在其中找到并运行win11的安装程序。5、在列表中选择“win11”然后点击“下一步”。6

手机Java编程软件推荐:让你轻松入门的五款工具在这个数字化时代,手机已经成为了我们生活中不可或缺的一部分。无论是工作、学习还是娱乐,手机几乎可以满足我们所有的需求。而对于编程爱好者来说,手机也可以成为一个非常实用的工具,帮助他们随时随地进行代码编写与学习。本文将向大家推荐五款手机Java编程软件,让你轻松入门,享受编程的乐趣。AIDEAIDE是一款功能强大

PHP是一种广泛使用的开源服务器端脚本语言,它可以处理Web开发中所有的任务。PHP在网页开发中的应用广泛,尤其是在动态数据处理上表现优异,因此被众多开发者喜爱和使用。在本篇文章中,我们将一步步地讲解PHP基础知识,帮助初学者从入门到精通。一、基本语法PHP是一种解释性语言,其代码类似于HTML、CSS和JavaScript。每个PHP语句都以分号;结束,注

xp系统曾经是使用最多的系统,不过随着硬件的不断升级,xp系统已经不能发挥硬件的性能,所以很多朋友就想升级win7系统,下面就和大家分享一下老电脑升级win7系统的方法吧。1、在小白一键重装系统官网中下载小白三步装机版软件并打开,软件会自动帮助我们匹配合适的系统,然后点击立即重装。2、接下来软件就会帮助我们直接下载系统镜像,只需要耐心等候即可。3、下载完成后软件会帮助我们直接进行在线重装Windows系统,请根据提示操作。4、安装完成后会提示我们重启,选择立即重启。5、重启后在PE菜单中选择Xi

如果想快速进行php web开发,选择一个好用的php开发框架至关重要,一个好的php开发框架可以让开发工作变得更加快捷、安全和有效。那2023年最流行的php开发框架有哪些呢?这些php开发框架排名如何?

手机Java编程必备软件盘点:这五款工具助你事半功倍随着科技的快速发展和智能手机的普及,越来越多的人选择在手机上进行编程。尤其是Java编程,已经成为移动应用开发的主流语言之一。然而,如果没有正确的工具和环境,即使是最有才华的开发者也无法事半功倍。在本文中,我将为大家推荐五款必备的手机Java编程工具,帮助你提高工作效率,更轻松地进行编程。AIDEAIDE是

在win10的系统盘中,很多网友会看到一个temp文件夹,里面占用的内存非常大,占用了c盘很多空间。有网友想删除temp文件夹,但是不知道能不能删,win10如何删除temp文件夹。下面小编就教下大家win10删除temp文件夹的方法。首先,Temp是指系统临时文件夹。而很多收藏夹,浏览网页的临时文件都放在这里,这是根据你操作的过程临时保存下来的。如有需要,可以手动删除的。如何删除temp文件夹?具体步骤如下:方法一:1、按下【Win+R】组合键打开运行,在运行框中输入temp,点击确定;2、此

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
