自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

DarklyCoder

偶尔记录的一些小知识

  • 博客(42)
  • 收藏
  • 关注

原创 Flutter插件发布流程

进入插件项目根目录下:发布前检查是否符合发布要求flutter packages pub publish --dry-run配置终端代理由于Flutter仓库在国外,在国内环境下需要配置代理方可正常发布。发布这里指定server的原因是由于在国内使用,一般配置的都是国内镜像,但是插件发布需要发布到国外的服务器上。flutter packages pub publish --server=https://pub.dartlang.org第一次发布时需要授权,按下面图片提示粘贴地

2021-03-09 18:09:24 362 1

原创 微信小程序使用小结

最近接到一个微信小程序开发的任务,由于是第一次接触,没有选用taro、uniapp等业内通用大一统框架,而是直接使用微信小程序原生能力开发,一边看官方文档一边写,一路磕磕绊绊也算是准时完成任务。下面对开发过程中遇到的问题做一记录,以备后用。iphonex类机型底部适配在css中使用env(safe-area-inset-bottom)可自动获取底部安全区域高度,如下所示:height: ca...

2020-11-17 16:16:01 349

原创 重置git提交作者信息

首先输入如下命令:git clone --bare REPO_PATHREPO_PATH为对应项目git地址。进入对应目录cd repo.git执行以下目录#!/bin/shgit filter-branch --env-filter 'OLD_EMAIL="old@qq.com"CORRECT_NAME="new"CORRECT_EMAIL="new@qq...

2020-01-04 11:52:33 706

转载 android之AlarmManager

对应AlarmManage有一个AlarmManagerServie服务程 序,该服务程序才是正真提供闹铃服务的,它主要维护应用程序注册下来的各类闹铃并适时的设置即将触发的闹铃给闹铃设备(在系统中,linux实现的设备名 为”/dev/alarm”),并且一直监听闹铃设备,一旦有闹铃触发或者是闹铃事件发生,AlarmManagerServie服务程序就会遍历闹铃列 表找到相应的注册闹铃并发

2013-11-15 21:09:39 860

转载 Android之Service与IntentService的比较

不知道大家有没有和我一样,以前做项目或者练习的时候一直都是用Service来处理后台耗时操作,却很少注意到还有个IntentService,前段时间准备面试的时候看到了一篇关于IntentService的解释,发现了它相对于Service来说有很多更加方便之处,今天在这里稍微来总结下我的心得。    首先IntentService是继承自Service的,那我们先看看Service的官方介绍,

2013-11-14 09:13:39 504

转载 Android之解析json数据

json数据格式解析我自己分为两种;一种是普通的,一种是带有数组形式的; 普通形式的:服务器端返回的json数据格式如下:{"userbean":{"Uid":"100196","Showname":"\u75af\u72c2\u7684\u7334\u5b50","Avtar":null,"State":1}}分析代码如下:// TODO 状态处理 500 200

2013-11-12 13:58:02 529

转载 Android获取View坐标的几种方法

int[] location = new  int[2] ;view.getLocationInWindow(location); //获取在当前窗口内的绝对坐标getLeft , getTop, getBottom, getRight,  这一组是获取相对在它父窗口里的坐标。view.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标,注意这个

2013-11-06 21:53:57 1710

原创 Android之ListPopupWindow

Android的弹出列表对话框实现十分丰富,但是大部分不易于定制,除非是自己重写。但是ListPopupWindow是api11之后新添加的widget组件,十分有利于列表对话框的定制。下面就以一个简单的例子作以说明。1、两个布局文件<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" a

2013-11-06 21:35:12 8640

转载 在android布局中使用include和merge标签

在我们开发android布局时,经常会有很多的布局是相同的,这个时候我们可以通过和标签实现将复杂的布局包含在需要的布局中,减少重复代码的编写。1. 创建一个可以重复使用的布局:如下代码描述在应用中每个acitivity都出现的顶栏titlebar.xml<FrameLayout xmlns:android="http://schemas.android.com/apk/res/andr

2013-11-06 20:14:59 994

原创 Android之实现单边快速查找效果

在许多应用场景下,实现快速定位会提升用户体验。如在通讯录的应用下,右边悬浮着一个快速查找的组件,手指滑动到相对应的字符上就会显示相应的内容。在这里,我只是对实现手指滑动获得内容的效果作简短说明,具体业务,看具体应用场景。1、首先自定义一个AlphaView类,继承ImageView。package org.zqy.quickfind;import android.content.C

2013-11-06 19:49:32 993

原创 Android之引用其它已安装或未安装apk文件的资源

Android应用有时候会涉及到皮肤的更换问题,在这里,我用一种引用其它已安装或未安装apk文件的资源来说明。其核心思想就是利用反射来获取。 a、引用其它未安装apk文件的资源来说明       1、首先创建一个application(StyleClient),将其打包称APK并拷贝到/data/目录下       2、在StyleClient里的Drawable文件夹下随便拷

2013-11-05 11:27:25 1730

原创 Android之Junit测试框架配置

在Android应用开发的时候会向Java开发一样,会使用Junit单元测试,但Android与Java有些许区别,下面就对Android的Junit测试框架进行说明。1、在manifest.xml里配置相应的东西。 <manifest xmlns:android="http://schemas.android.com/apk/res/android" packag

2013-11-03 18:35:34 774

原创 android之横竖屏切换

当用户勾选了android手机的屏幕自动旋转功能时,手机应用会自动切换横竖屏。一般情况下横竖屏的切换对业务没有什么影响,但是在某些特殊应用背景下,如果没有指定横竖屏,当前activity会自动销毁重建影响业务。所以常见的处理方法有两种:1、在android的配置清单里配置:android:screenOrientation="portrait"//指定为垂直方向,还可以指定为水平方向2

2013-11-02 21:55:37 662

原创 android之在EditText、TextView中添加表情图片

由于用户交互的需要,要求在EditText输入表情图片,在Textview予以显示。下面给出一个例子作为说明。1、布局文件<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android

2013-11-02 18:59:39 1546

转载 android获取一个用于打开各种文件的intent

//android获取一个用于打开文本文件的intent public static Intent getTextFileIntent( String param, boolean paramBoolean) { Intent intent = new Intent("android.intent.action.VIEW"); intent.addCategory("andro

2013-10-29 16:28:01 1184

原创 Android之Activity的启动模式

在Android中每个界面都是一个Activity,切换界面操作其实是多个不同Activity之间的实例化操作。在Android中Activity的启动模式决定了Activity的启动运行方式。Android总Activity的启动模式分为四种:Activity启动模式设置:        Activity的四种启动模式:    1. standard        模式启

2013-10-28 16:52:09 597

原创 Android之TabHost

1、编写tabhost.xml<TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_

2013-10-27 16:40:26 661

原创 Android之ViewFilpperGroup

ViewFilpperGroup顾名思义就是将一堆view添加到一组内,便于管理。1、编写viewflipper.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_

2013-10-27 16:24:18 768

原创 Android之ViewFlipper

ViewFlipper可以用于view组件的切换1、viewflipper.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_

2013-10-26 18:11:50 972

原创 Android之ViewSwither

ViewSwither可以用来展示向android的多屏应用滑动的效果。1、首先编写布局文件viewswither.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_he

2013-10-26 16:29:19 734

原创 Android之ProgressBar、SeekBar、RatingBar

ProgressBar、SeekBar、RatingBar是几种常用的进度显示组件。下面做简单描述:ProgressBar:<ProgressBar android:id="@+id/mypro" style="@android:style/Widget.ProgressBar.Inverse" //指定风格(旋转) android:

2013-10-21 11:27:33 1174

转载 android之Animations(动画)

Android支持2种类型的动画。内插动画可以应用于旋转、平移、放缩和渐变;frame-by-frame动画用来显示一系列的图片。 把动画定义成外部资源,有利于在多个地方使用,并且能基于设备硬件或方向选择适应的动画。 Tweened Animations 每个内插动画以独立的XML文件存储在/res/anim文件夹下。和layouts和drawabl

2013-10-20 20:19:28 732

转载 android布局属性

第一类:属性值为true或false     android:layout_centerHrizontal  水平居中      android:layout_centerVertical   垂直居中     android:layout_centerInparent    相对于父元素完全居中     android:layout_alignParentBottom 贴紧父元素

2013-10-20 20:05:52 625

转载 myeclipse优化

myeclipse优化一、Myeclipse10修改字体MyEclipse10是基于Eclipse3.7内核,但在Eclipse的Preferences-〉general-〉 Appearance->Colors and Fonts 中并没有找到Courier New字体,它采用的是Consolas字体,中文看着非常小非常别扭,在Windows7下,系统自带虽然有Courier New

2013-10-19 21:04:19 637

转载 Android之ExpandableListView

本文转自http://blog.csdn.net/cjjky/article/details/6903504 本文采用一个Demo来展示Android中ExpandableListView控件的使用,如如何在组/子ListView中绑定数据源。直接上代码如下:程序结构图:layout目录下的 main.xml 文件源码如下:<LinearLayout xmlns:and

2013-10-19 20:48:35 753

原创 Android之AdapterViewFlipper与Gallery

AdapterViewFlipper与Gallery都可以用来展示图片,但是Gallery是一次性把所有图片都预加载到屏幕上,而AdapterViewFlipper一次只加载一张图片。首先来看看Gallery:<Gallery android:id="@+id/gallery" android:layout_width="match_parent" a

2013-10-19 20:35:30 2675

原创 Android之AutoCompleteTextView

AutoCompleteTextView是用于总动完成输入文本的组件,用好了是非常方便用户的。<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_p

2013-10-19 20:13:47 752

原创 Android之ImageButton、ImageView

在Web开发中,HTML中对图片的操作就是提供一个标签,我们通过该标签的src属性来制定图片资源的地址,从而在页面中显示一个图片。那么在Android中,ImageView就是用于图片显示的。 ImageView的集成关系如下:java.lang.Object    ↳ android.view.View    ↳ android.widget.ImageView     可以

2013-10-19 20:03:08 867

原创 Android之复选按钮、单选按钮、开关按钮

Android的复选按钮、单选按钮、开关按钮是经常使用的几个组件。下面给出一个例子<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

2013-10-19 19:42:27 2257

原创 Android之六大布局

Android有常见的五大布局FrameLayout、TableLayout、LinearLayout、AbsoluteLayout、RelativeLayout,Android4.0之后新增了一个GridLayout布局。下面就针对每一种布局做详细解释。1、帧布局(FrameLayout)帧布局就是简单的一层一层的往上叠加。<FrameLayout xmlns:android="

2013-10-18 14:06:01 977

原创 Android之取消标题栏、全屏

先介绍去掉标题栏的方法:第一种:也一般入门的时候经常使用的一种方法requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏注意这句一定要写在setContentView()方法的前面,不然会报错的 第二种:在AndroidManifest.xml文件中定义<application android:icon="@drawa

2013-10-18 11:24:38 673

转载 Android之LayoutInfater

在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于findViewById()。不同点是LayoutInflater是用来找res/layout/下的xml布局文件,并且实例化;而findViewById()是找xml布局文件下的具体widget控件(如Button、TextView等)。具体作用:1、对于一个没有被载入或者想要动态载入的界面,都需要使用Layou

2013-10-17 10:54:07 710

原创 android之Adapter

1.概念        Adapter是连接后端数据和前端显示的适配器接口,是数据和UI(View)之间一个重要的纽带。在常见的View(ListView,GridView)等地方都需要用到Adapter。如下图直观的表达了Data、Adapter、View三者的关系:Android中所有的Adapter一览:        由图可以看到在Android中与Adapter有关的

2013-10-16 22:08:26 564

原创 android之Button

Button是android视图的基本组件,有以下常用方法:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andro

2013-10-15 10:34:17 604

原创 android之EditText

EditView是android的基本视图之一,有以下常用的方法:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" an

2013-10-15 09:53:52 601

原创 Android之TextView

TextView是android最基本的view之一,其有许多常用的用法:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"

2013-10-15 09:31:22 724

原创 Struts2的自定义拦截器

使用Struts2的自定义拦截器可以用来验证用户的请求,例如验证用户是否已登陆。Struts2的核心就是拦截器。1、首先写一个java类实现com.opensymphony.xwork2.interceptor.Interceptor接口。package org.zqy;import com.opensymphony.xwork2.ActionInvocation;import co

2013-09-27 16:47:24 664

原创 java遍历Map集合

java遍历Map集合1、最常规的一种遍历方法,最常规就是最常用的,虽然不复杂,但很重要,这是我们最熟悉的,就不多说了!! public static void work(Map map) { Collection c = map.values(); Iterator it = c.iterator(); while (it.hasN

2013-09-07 21:09:48 837

转载 Java读取Properties文件的六种方法

Java读取properties文件 【转】 使用J2SE API读取Properties文件的六种方法1。使用java.util.Properties类的load()方法示例: InputStream in = lnew BufferedInputStream(new FileInputStream(name));Properties p = new Properti

2013-09-07 21:08:00 668

原创 JAVA String.format 方法使用

JAVA String.format 方法使用介绍1.对整数进行格式化:%[index$][标识][最小宽度]转换方式        我们可以看到,格式化字符串由4部分组成,其中%[index$]的含义我们上面已经讲过,[最小宽度]的含义也很好理解,就是最终该整数转化的字符串最少包含多少位数字。我们来看看剩下2个部分的含义吧:标识: '-'    在最小宽度内左对齐,不

2013-07-27 10:39:24 908

空空如也

空空如也

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

TA关注的人

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