Android Studio
文章平均质量分 58
Android Studio日常开发记录
信必诺
但愿绝望和无奈远走高飞..
展开
-
Android Studio —— 引用FFmpeg库
关于编译FFmpeg 本文不介绍FFmpeg编译安卓的库,但在文末提供编译好的安卓FFmpeg库。 在Android Studio 2020.3.1中配置FFmpeg库 1、创建Android Studio的C++工程 如图,选择C++工程,选择C++11即可。 2、将编译好的FFmpeg文件拷贝工程 3、在CMakeLists.txt文件中配置 CMakeLists.txt文件中引用了FFmpeg头文件、库文件原创 2022-03-19 19:00:46 · 3584 阅读 · 0 评论 -
Android Studio —— Thread
效果 简述 制作当前时间显示。开启线程来获取本地时间,使用Message发送获取的时间、Handler来监听消息。 源码 代码 activity_main.xml<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLa原创 2022-01-25 23:10:48 · 700 阅读 · 0 评论 -
Android Studio —— BottomNavigationView(模拟支付宝底部导航)
效果 源码 代码过程步骤1: 主界面垂直线性布局,加入ViewPager、BottomNavigationView两个控件。 加入5张图片作为底部切换的图标,创建menu文件及xml文件,将5张图片加入到xml内item。 在BottomNavigationView中加入menu选项,将上面的xml加入。 (此时可以查看到界面底部的5个按钮,并可点击。)原创 2022-01-24 14:07:13 · 3008 阅读 · 2 评论 -
Android Studio —— TabLayout
效果 源码 代码 activity_main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android原创 2022-01-24 00:33:08 · 2386 阅读 · 0 评论 -
Android Studio —— fragment
效果 源码 代码 MainActivity.javapackage com.example.application;import androidx.appcompat.app.AppCompatActivity;import androidx.fragment.app.FragmentManager;import android.os.Bundle;im原创 2022-01-23 18:18:14 · 1478 阅读 · 0 评论 -
Android Studio —— 界面切换且双端传参
效果 源码 代码 activity_main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an原创 2022-01-23 14:56:10 · 608 阅读 · 0 评论 -
Android Studio —— 界面切换且传参
效果 视频效果 源码 代码 activity_main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schem原创 2022-01-23 13:58:51 · 432 阅读 · 0 评论 -
Android Studio —— 一键浏览器搜索
效果 代码 关键代码public void onClick(View view) { EditText url = findViewById(R.id.neturl); Intent cn = new Intent(Intent.ACTION_VIEW, Uri.parse("https://"+url.getText().toString()))原创 2022-01-23 13:15:34 · 374 阅读 · 1 评论 -
Android Stuidio —— 一键拨号
效果 代码 关键代码public void onClick(View view) { String num = "10086"; Intent cn = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+num)); startActivity(cn);} 完整代码<?xml versi原创 2022-01-23 13:02:45 · 1239 阅读 · 0 评论 -
Android Studio —— 界面切换
效果 下载 代码 activity_main2.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an原创 2022-01-23 12:19:07 · 3391 阅读 · 0 评论 -
Android Studio —— 下载网络图片显示
效果 简介 加入线程进行下载,下载完毕后显示。 源码 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://sch原创 2022-01-23 00:23:03 · 1056 阅读 · 1 评论 -
Android Studio —— AlertDialog(多选对话框)
效果 下载 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout 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原创 2022-01-22 14:42:22 · 1645 阅读 · 0 评论 -
Android Studio —— CalendarView
效果 视频效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout 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" andr原创 2022-01-22 13:06:56 · 324 阅读 · 0 评论 -
Android Studio —— GridView(模仿魅蓝手机下拉窗口)
效果 源码CSDN源码下载扫码关注下方公众号,回复122631004,免费下载。 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout android:layout_width="match_parent" android:layout_height="match_paren原创 2022-01-22 12:32:13 · 381 阅读 · 0 评论 -
Android Studio —— SimpleAdapter (模仿魅蓝设置界面)
效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com原创 2022-01-21 23:00:58 · 608 阅读 · 0 评论 -
Android Studio —— apk打包过程
视频过程 关注笔者 - jxd微信公众号搜索 “码农总动员” 或 微信扫描下方二维码,了解更多你不知道的XX,O(∩_∩)O原创 2022-01-21 20:38:36 · 107 阅读 · 0 评论 -
Android Studio —— ArrayAdapter
效果 代码过程 代码<?xml version="1.0" encoding="utf-8"?><TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:gra原创 2022-01-21 20:36:42 · 936 阅读 · 0 评论 -
Android Studio —— AutoCompleteTextView
简说 主要用到AutoCompleteTextView控件,下图为该控件的主要属性功能。 效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln原创 2022-01-21 13:37:39 · 663 阅读 · 0 评论 -
Android Studio —— RatingBar
效果 视频效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout 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" andr原创 2022-01-21 12:59:39 · 590 阅读 · 0 评论 -
Android Studio —— ProgressBar、ImageView、SeekBar
说明 注意:ImageView的透明度值范围为:0~255 效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://sc原创 2022-01-21 11:55:38 · 167 阅读 · 0 评论 -
Android Studio —— RadioButton、CheckBox
效果 RadioButton效果为RadioGroup组管理。 CheckBox效果为List管理。 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"原创 2022-01-20 23:48:12 · 406 阅读 · 0 评论 -
Android Studio —— Switch
Switch与ToggleButton区别 主要区别在于都设置了textOn、textOff属性后,ToggleButton会显示上面两个状态名称;而Switch却不会显示,只会显示text属性。 效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=原创 2022-01-20 21:46:53 · 1019 阅读 · 0 评论 -
Android Studio —— ToggleButton
效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"原创 2022-01-20 20:18:58 · 515 阅读 · 0 评论 -
Android Studio —— Toast(短时间显示后消失)
效果 点击按钮,输入内容显示在toast内部。 代码package com.example.jxd;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.Toast;原创 2022-01-20 14:10:02 · 971 阅读 · 0 评论 -
Android Studio —— 按钮无法显示背景
解决 关注笔者 - jxd微信公众号搜索 “码农总动员” 或 微信扫描下方二维码,了解更多你不知道的XX,O(∩_∩)O原创 2022-01-19 23:33:21 · 870 阅读 · 0 评论 -
Android Studio —— TableLayout
效果 代码 拖控件出来的,这里贴上xml代码<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.co原创 2022-01-19 14:59:12 · 714 阅读 · 0 评论 -
Android Studio —— LinearLayout(登录界面)
效果 代码 本次使用拖控件方式,以下附上自动生成的xml代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.and原创 2022-01-18 20:01:04 · 825 阅读 · 0 评论 -
Android Studio —— LinearLayout
效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_heig原创 2022-01-17 21:32:45 · 765 阅读 · 1 评论 -
Android Studio —— 弹窗
效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_heig原创 2022-01-17 18:56:29 · 5353 阅读 · 0 评论 -
Android Studio —— Toolbar(使用自定义标题栏,去除默认标题栏)
效果 创建 创建一个"Empty Activity"的安卓工程。 1、进入"res" - “value” - “themes.xml”,父类修改为"NoActivonBar"。(这样就去掉了默认的标题栏) 2、如java与xml代码<?xml version="1.0" encoding="utf-8"?>&l原创 2022-01-17 16:38:59 · 1805 阅读 · 1 评论 -
Android Studio —— 进度条控制
效果 代码<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei原创 2022-01-17 12:28:41 · 1965 阅读 · 0 评论 -
Android Studio —— 按钮点击事件
实例 功能:点击按钮显示/隐藏进度条 效果 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent原创 2022-01-16 13:09:01 · 2780 阅读 · 0 评论 -
AndroidStudio —— 文字跑马灯
效果 实现方法 方法一 (推荐) 继承TextView重写isFoucsed方法,直接返回true。目的是为了默认让TextView获取到焦点。package com.example.jxd;import android.content.Context;import android.util.AttributeSet;import android.widget.TextView;import androidx.annotation.Nullable;p原创 2022-01-15 18:31:30 · 703 阅读 · 0 评论