自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 问答 (8)
  • 收藏
  • 关注

原创 android 用echarts绘制图表(折线与柱状图)

Android使用echarts绘制图表

2022-11-04 15:13:41 2591

原创 android 将代码打包成Jar包和aar文件

1.创建项目--新建Module--编写函数2.配置mylibrary下的 gradle文件 task makeJar(type: Copy) { delete 'build/outputs/mylibrary.jar' from('build/intermediates/packaged-classes/release/') //jar文件来源 into('build/libs/') //生成路径 include(

2021-05-14 10:43:16 1503 2

原创 Android Studio NDK开发入门

Android Studio NDK开发入门一.NDK开发环境搭建1.点击android studio 的左上角的“File”-->"Settings"-->"Appearance & Behavior"-->"Android SDK"-->"SDK Tools",下载ND...

2021-04-29 16:03:44 613

原创 android绘制曲线和折线图

(曲线)(折线)1.CurveView.javapackage com.package;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Path;import android.graphics.Point;import an...

2021-11-29 17:09:15 3004 9

原创 jetpack(androidx)的constraintlayout2新功能的使用之ImageFilterView圆形与圆角图片的使用

使用方法:导入implementation 'androidx.constraintlayout:constraintlayout:2.0.1'1.圆角和圆形ImageView圆形<androidx.constraintlayout.utils.widget.ImageFilterView android:layout_width="58dp" android:layout_height="58dp" android:src="@mipmap/ic_laun...

2021-05-25 09:42:46 1473 1

原创 android 5.0以上与BLE设备通讯并突破收发数据20字节的限制

public abstract class BluetoothActivity extends AppCompatActivity {private BluetoothManager mBluetoothManager;private BluetoothLeScanner scanner;private final String TAG = "BluetoothActivityTAG"...

2019-12-03 11:13:36 2454 1

原创 android 防止刷新时,输入框重复调用addTextChangedListener引发问题

editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChang...

2019-12-03 10:57:50 662

转载 Android WebSocket实现即时通讯功能

最近做这个功能,分享一下。即时通讯(Instant Messaging)最重要的毫无疑问就是即时,不能有明显的延迟,要实现IM的功能其实并不难,目前有很多第三方,比如极光的JMessage,都比较容易实现。但是如果项目有特殊要求(如不能使用外网),那就得自己做了,所以我们需要使用WebSocket。WebSocketWebSocket协议就不细讲了,感兴趣的可以具体查阅资料,简而言之,它就...

2019-10-11 14:08:50 336

原创 android 开启前台服务,并隐藏8.0以下的通知

1.首先在activityj里面启动Intent intent = new Intent(MainActivity.this, MyService.class);if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(intent );} else { startServ...

2019-10-11 14:01:17 1499

原创 ExpandableListView 设置无数据页面setEmptyView();

当页面无数据时,有需求展示一个指定页面。1.一个共用的外部界面View emptyView = LayoutInflater.from(this).inflate(R.layout.empty_view, null);//指定界面的布局emptyView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MA...

2019-10-11 13:50:26 270

原创 ExpandableListView 设置 adapter.notifyDataSetChanged();无效的解决方法。

在开发中,用到ExpandableListView 展示数据里,下拉加载遇到adapter.notifyDataSetChanged();失效,现记录一下。1.首先在自定义adapter里面添加一个方法:public void setData(List<bean> beanList) { this.beanList= beanList; notifyDataS...

2019-10-11 13:34:45 552

原创 android 手机通过usb数据线与OTG设备通信

1.首先在AndroidManifest.xml文件中添加所需要的权限&lt;uses-feature android:name="android.hardware.usb.host" /&gt;&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;&lt;uses-permis...

2018-09-29 15:55:20 1844 2

转载 EventBus3.0的使用

1.在build.gradle配置文件中的添加:dependencies {compile 'org.greenrobot:eventbus:3.0.0'}2.注册绑定事件@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState)...

2018-09-26 14:22:03 114

原创 Kotlin使用(fragment的切换与listview、recyclerView的使用)

package com.example.kotlintest2.activityimport android.content.Intentimport android.support.v7.app.AppCompatActivityimport android.os.Bundleimport android.view.Viewimport android.widget.Buttoni

2017-06-26 14:43:16 2413

原创 android 手机与蓝牙设备的通讯

1.首先创建个Activity来搜索蓝牙低耗设备package com.example.xxx;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.Bluetoo

2017-06-26 13:56:14 818

转载 Glide的使用

XML:xml version="1.0" encoding="utf-8"?>ScrollView android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/t

2017-03-21 15:41:32 159

转载 RecyclerView的使用

main.xml:xml version="1.0" encoding="utf-8"?>RelativeLayout android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.andr

2017-03-21 15:26:49 189

原创 android service的两种启动方式

package com.liang.myservice;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.support.annotation.Nullable;import android.util.Log;/** * Created b

2017-03-21 15:09:12 203

转载 Android自定义录象机,录制一段视频

XML: main.xmlxml version="1.0" encoding="utf-8"?>LinearLayout android:id="@+id/activity_main" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.

2017-03-21 10:31:28 265

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除