Android 自定义支持快速搜索筛选的选择控件

项目中遇到选择控件选项过多,需要快速查找匹配的情况。

做了简单的Demo,效果图如下:

源码地址:https://github.com/whieenz/SearchSelect

这个控件是由Dialog+SearchView+ListView实现的。Dialog用来承载选择控件,SearchView实现输入,ListView展示结果。设计概要图如下:

一、自定义Dialog

Dialog布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="match_parent"
  5. android:orientation="vertical">
  6. <LinearLayout
  7. android:layout_width="wrap_content"
  8. android:layout_weight="1"
  9. android:background="@drawable/dialog_bg"
  10. android:layout_height="match_parent"
  11. android:orientation="vertical" >
  12. <RelativeLayout
  13. android:layout_width="match_parent"
  14. android:layout_height="50dp">
  15. <TextView
  16. android:layout_width="wrap_content"
  17. android:layout_height="wrap_content"
  18. android:layout_marginLeft="20dp"
  19. android:layout_centerVertical="true"
  20. android:textSize="18sp"
  21. android:textColor="#000000"
  22. android:id="@+id/tv_dialog_select_title"/>
  23. <ImageButton
  24. android:layout_width="50dp"
  25. android:layout_height="match_parent"
  26. android:padding="8dp"
  27. android:layout_marginRight="10dp"
  28. android:layout_centerVertical="true"
  29. android:layout_alignParentRight="true"
  30. android:scaleType="centerInside"
  31. android:background="@color/transparent"
  32. android:src="@drawable/im_search_back"
  33. android:id="@+id/btn_dialog_select_search"/>
  34. </RelativeLayout>
  35. <com.whieenz.searchselect.DialogSearchView
  36. android:layout_width="match_parent"
  37. android:layout_height="wrap_content"
  38. android:id="@+id/searchView"
  39. android:visibility="gone"/>
  40. <ListView
  41. android:layout_width="match_parent"
  42. android:layout_height="0dp"
  43. android:layout_weight="1"
  44. android:orientation="vertical"
  45. android:id="@+id/listview"
  46. android:layout_gravity="center_horizontal" />
  47. </LinearLayout>
  48. <LinearLayout
  49. android:layout_width="match_parent"
  50. android:layout_height="80dp"
  51. android:gravity="center"
  52. android:background="@color/transparent">
  53. <ImageButton
  54. android:layout_width="40dp"
  55. android:layout_height="40dp"
  56. android:id="@+id/imb_dialog_select_close"
  57. android:scaleType="centerInside"
  58. android:src="@drawable/dialog_close"
  59. android:background="@color/transparent"/>
  60. </LinearLayout>
  61. </LinearLayout>

Dialog Java文件

  1. package com.whieenz.searchselect;
  2. import android.app.Activity;
  3. import android.app.Dialog;
  4. import android.content.Context;
  5. import android.content.DialogInterface;
  6. import android.util.DisplayMetrics;
  7. import android.view.Gravity;
  8. import android.view.LayoutInflater;
  9. import android.view.View;
  10. import android.view.ViewGroup;
  11. import android.view.Window;
  12. import android.view.WindowManager;
  13. import android.widget.AdapterView;
  14. import android.widget.ImageButton;
  15. import android.widget.ListView;
  16. import android.widget.TextView;
  17. import java.util.ArrayList;
  18. import java.util.List;
  19. /**
  20. * Created by whieenz on 2017/7/18.
  21. */
  22. public class SerachSelectDialog extends Dialog {
  23. public SerachSelectDialog(Context context, int themeResId) {
  24. super(context, themeResId);
  25. }
  26. /**
  27. * 设置 Dialog的大小
  28. * @param x 宽比例
  29. * @param y 高比例
  30. */
  31. public void setDialogWindowAttr(double x, double y, Activity activity){
  32. if (x<0||x>1||y<0||y>1){
  33. return;
  34. }
  35. Window window = this.getWindow();
  36. WindowManager.LayoutParams lp = window.getAttributes();
  37. WindowManager manager = activity.getWindowManager();
  38. DisplayMetrics outMetrics = new DisplayMetrics();
  39. manager.getDefaultDisplay().getMetrics(outMetrics);
  40. int width = outMetrics.widthPixels;
  41. int height = outMetrics.heightPixels;
  42. lp.gravity = Gravity.CENTER;
  43. lp.width = (int) (width * x);
  44. lp.height = (int) (height * y);
  45. this.getWindow().setAttributes(lp);
  46. }
  47. public static class Builder {
  48. private String title;
  49. private View contentView;
  50. private String positiveButtonText;
  51. private String negativeButtonText;
  52. private String singleButtonText;
  53. private List<String> listData;
  54. private View.OnClickListener positiveButtonClickListener;
  55. private View.OnClickListener negativeButtonClickListener;
  56. private View.OnClickListener singleButtonClickListener;
  57. private View layout;
  58. private Context context;
  59. private SerachSelectDialog dialog;
  60. private OnSelectedListiner selectedListiner;
  61. ListView listView;
  62. //SearchView searchView ;
  63. DialogSearchView searchView;
  64. ImageButton searchBtn;
  65. ImageButton closeBtn;
  66. TextView titleView;
  67. private boolean state = false;
  68. public Builder(Context context) {
  69. //这里传入自定义的style,直接影响此Dialog的显示效果。style具体实现见style.xml
  70. this.context = context;
  71. dialog = new SerachSelectDialog(context,R.style.selectDialog);
  72. LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  73. layout = inflater.inflate(R.layout.dialog_select_search, null);
  74. listView = (ListView)layout.findViewById(R.id.listview);
  75. //searchView = (SearchView) layout.findViewById(R.id.searchView);
  76. searchView = (DialogSearchView) layout.findViewById(R.id.searchView);
  77. searchBtn = (ImageButton) layout.findViewById(R.id.btn_dialog_select_search);
  78. closeBtn = (ImageButton) layout.findViewById(R.id.imb_dialog_select_close);
  79. titleView = (TextView) layout.findViewById(R.id.tv_dialog_select_title);
  80. dialog.addContentView(layout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  81. }
  82. public Builder setTitle(String title) {
  83. this.title = title;
  84. return this;
  85. }
  86. public Builder setContentView(View v) {
  87. this.contentView = v;
  88. return this;
  89. }
  90. public void setListData(List<String> listData) {
  91. this.listData = listData;
  92. }
  93. public Builder setPositiveButton(String positiveButtonText, View.OnClickListener listener) {
  94. this.positiveButtonText = positiveButtonText;
  95. this.positiveButtonClickListener = listener;
  96. return this;
  97. }
  98. public Builder setNegativeButton(String negativeButtonText, View.OnClickListener listener) {
  99. this.negativeButtonText = negativeButtonText;
  100. this.negativeButtonClickListener = listener;
  101. return this;
  102. }
  103. /**
  104. * 单按钮对话框和双按钮对话框的公共部分在这里设置
  105. */
  106. private SerachSelectDialog create() {
  107. titleView.setText(title);
  108. final SearchSelectAdapter sa = new SearchSelectAdapter(context,listData);
  109. listView.setAdapter(sa);
  110. listView.invalidate();
  111. searchBtn.setOnClickListener(new View.OnClickListener() {
  112. @Override
  113. public void onClick(View view) {
  114. if (!state){
  115. searchView.setVisibility(View.VISIBLE);
  116. state = true;
  117. }else {
  118. searchView.setVisibility(View.GONE);
  119. state = false;
  120. }
  121. }
  122. });
  123. searchView.setDialogSearchViewListener(new DialogSearchView.DialogSearchViewListener() {
  124. @Override
  125. public boolean onQueryTextChange(String text) {
  126. updateLayout(searchItem(text));
  127. return false;
  128. }
  129. });
  130. closeBtn.setOnClickListener(new View.OnClickListener() {
  131. @Override
  132. public void onClick(View v) {
  133. dialog.dismiss();
  134. }
  135. });
  136. dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
  137. @Override
  138. public void onDismiss(DialogInterface dialog) {
  139. }
  140. });
  141. listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  142. @Override
  143. public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  144. selectedListiner.onSelected(sa.getItem(position));
  145. dialog.dismiss();
  146. }
  147. });
  148. dialog.setContentView(layout);
  149. //用户可以点击手机Back键取消对话框显示
  150. dialog.setCancelable(true);
  151. //用户不能通过点击对话框之外的地方取消对话框显示
  152. dialog.setCanceledOnTouchOutside(false);
  153. return dialog;
  154. }
  155. public List<String> searchItem(String name) {
  156. ArrayList<String> mSearchList = new ArrayList<String>();
  157. for (int i = 0; i < listData.size(); i++) {
  158. int index = listData.get(i).indexOf(name);
  159. // 存在匹配的数据
  160. if (index != -1) {
  161. mSearchList.add(listData.get(i));
  162. }
  163. }
  164. return mSearchList;
  165. }
  166. public void updateLayout(List<String> newList) {
  167. final SearchSelectAdapter sa = new SearchSelectAdapter(context,newList);
  168. listView.setAdapter(sa);
  169. listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  170. @Override
  171. public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  172. selectedListiner.onSelected(sa.getItem(position));
  173. dialog.dismiss();
  174. }
  175. });
  176. }
  177. public void setSelectedListiner(SerachSelectDialog.Builder.OnSelectedListiner selectedListiner) {
  178. this.selectedListiner = selectedListiner;
  179. }
  180. public static abstract class OnSelectedListiner{
  181. public abstract void onSelected(String String);
  182. }
  183. public SerachSelectDialog show() {
  184. create();
  185. dialog.show();
  186. return dialog;
  187. }
  188. }
  189. }

二、自定义SearchView

SearchView 布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="match_parent"
  5. android:gravity="center"
  6. android:background="#ffffff"
  7. android:layout_height="50dp">
  8. <LinearLayout
  9. android:layout_width="match_parent"
  10. android:layout_height="35dp"
  11. android:orientation="horizontal"
  12. android:gravity="center_vertical"
  13. android:layout_marginLeft="15dp"
  14. android:layout_marginRight="15dp"
  15. android:background="@drawable/search_layout_bg">
  16. <ImageButton
  17. android:layout_width="20dp"
  18. android:layout_height="20dp"
  19. android:id="@+id/imb_search_search"
  20. android:layout_marginLeft="15dp"
  21. android:scaleType="centerInside"
  22. android:src="@drawable/im_search_gray"
  23. android:background="#F0F0F0" />
  24. <EditText
  25. android:layout_width="wrap_content"
  26. android:layout_height="wrap_content"
  27. android:layout_marginLeft="10dp"
  28. android:layout_marginRight="15dp"
  29. android:id="@+id/et_search_text"
  30. android:layout_weight="1"
  31. android:lines="1"
  32. android:textSize="14sp"
  33. android:background="@null"
  34. android:hint="请输入搜索内容"/>
  35. <ImageButton
  36. android:layout_width="35dp"
  37. android:layout_height="35dp"
  38. android:padding="12.5dp"
  39. android:id="@+id/imb_search_clear"
  40. android:layout_marginRight="20dp"
  41. android:src="@drawable/im_x"
  42. android:visibility="gone"
  43. android:scaleType="centerInside"
  44. android:background="#F0F0F0" />
  45. </LinearLayout>
  46. </LinearLayout>

SearchView Java代码

  1. package com.whieenz.searchselect;
  2. import android.content.Context;
  3. import android.text.Editable;
  4. import android.text.TextWatcher;
  5. import android.util.AttributeSet;
  6. import android.view.LayoutInflater;
  7. import android.view.View;
  8. import android.widget.EditText;
  9. import android.widget.ImageView;
  10. import android.widget.LinearLayout;
  11. /**
  12. * Created by whieenz on 2017/7/19.
  13. */
  14. public class DialogSearchView extends LinearLayout implements View.OnClickListener {
  15. /**
  16. * 输入框
  17. */
  18. private EditText etInput;
  19. /**
  20. * 删除键
  21. */
  22. private ImageView ivDelete;
  23. /**
  24. * 上下文对象
  25. */
  26. private Context mContext;
  27. /**
  28. * 搜索回调接口
  29. */
  30. private DialogSearchViewListener mListener;
  31. /**
  32. * 设置搜索回调接口
  33. *
  34. * @param listener 监听者
  35. */
  36. public void setDialogSearchViewListener(DialogSearchViewListener listener) {
  37. mListener = listener;
  38. }
  39. public DialogSearchView(Context context, AttributeSet attrs) {
  40. super(context, attrs);
  41. mContext = context;
  42. LayoutInflater.from(context).inflate(R.layout.view_search_layout, this);
  43. initViews();
  44. }
  45. private void initViews() {
  46. etInput = (EditText) findViewById(R.id.et_search_text);
  47. ivDelete = (ImageView) findViewById(R.id.imb_search_clear);
  48. ivDelete.setOnClickListener(this);
  49. etInput.addTextChangedListener(new EditChangedListener());
  50. etInput.setOnClickListener(this);
  51. }
  52. private class EditChangedListener implements TextWatcher {
  53. @Override
  54. public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
  55. }
  56. @Override
  57. public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
  58. if (!"".equals(charSequence.toString())) {
  59. ivDelete.setVisibility(VISIBLE);
  60. //更新autoComplete数据
  61. if (mListener != null) {
  62. mListener.onQueryTextChange(charSequence + "");
  63. }
  64. } else {
  65. ivDelete.setVisibility(GONE);
  66. }
  67. }
  68. @Override
  69. public void afterTextChanged(Editable editable) {
  70. }
  71. }
  72. @Override
  73. public void onClick(View view) {
  74. switch (view.getId()) {
  75. case R.id.imb_search_clear:
  76. etInput.setText("");
  77. if (mListener != null) {
  78. mListener.onQueryTextChange("");
  79. }
  80. ivDelete.setVisibility(GONE);
  81. break;
  82. }
  83. }
  84. /**
  85. * search view回调方法
  86. */
  87. public interface DialogSearchViewListener {
  88. boolean onQueryTextChange(String text);
  89. }
  90. }

自定义ListView Adapter

listItem 布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:layout_width="match_parent"
  4. android:layout_height="50dp"
  5. android:paddingLeft="10dp"
  6. android:paddingTop="15dp"
  7. android:paddingBottom="15dp"
  8. android:orientation="horizontal">
  9. <TextView
  10. android:id="@+id/tv_select_info"
  11. android:layout_width="match_parent"
  12. android:layout_height="match_parent"
  13. android:textSize="20sp"
  14. android:layout_centerInParent="true"
  15. android:gravity="center"
  16. android:lines="1"/>
  17. </RelativeLayout>

Adapter 文件

  1. package com.whieenz.searchselect;
  2. import android.content.Context;
  3. import android.view.LayoutInflater;
  4. import android.view.View;
  5. import android.view.ViewGroup;
  6. import android.widget.BaseAdapter;
  7. import android.widget.TextView;
  8. import java.util.List;
  9. public class SearchSelectAdapter extends BaseAdapter {
  10. private List<String> Datas;
  11. private Context context;
  12. private LayoutInflater inflater;
  13. public SearchSelectAdapter(Context ctx, List<String> datas){
  14. this.context = ctx;
  15. this.Datas = datas;
  16. this.inflater = LayoutInflater.from(ctx);
  17. }
  18. @Override
  19. public int getCount() {
  20. return Datas.size();
  21. }
  22. @Override
  23. public String getItem(int i) {
  24. return Datas.get(i);
  25. }
  26. @Override
  27. public long getItemId(int i) {
  28. return i;
  29. }
  30. @Override
  31. public View getView(int i, View view, ViewGroup viewGroup) {
  32. ViewHolder holder = null;
  33. if (view == null ) {
  34. view = inflater.inflate(R.layout.list_cell_select_single, null);
  35. holder = new ViewHolder(view);
  36. view.setTag(holder);
  37. } else {
  38. holder = (ViewHolder) view.getTag();
  39. }
  40. holder.info.setText(Datas.get(i));
  41. return view;
  42. }
  43. static class ViewHolder {
  44. TextView info;
  45. public ViewHolder(View view) {
  46. info = view.findViewById(R.id.tv_select_info);
  47. }
  48. }
  49. }

MainActivity 实现

布局文件

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:tools="http://schemas.android.com/tools"
  4. android:id="@+id/activity_main"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:orientation="vertical"
  8. android:padding="10dp"
  9. tools:context="com.whieenz.searchselect.MainActivity">
  10. <LinearLayout
  11. android:layout_width="match_parent"
  12. android:layout_height="wrap_content"
  13. android:layout_marginTop="150dp"
  14. android:orientation="horizontal">
  15. <TextView
  16. android:layout_width="wrap_content"
  17. android:layout_height="wrap_content"
  18. android:textSize="20sp"
  19. android:gravity="left"
  20. android:text="选择结果:"
  21. />
  22. <TextView
  23. android:layout_width="wrap_content"
  24. android:layout_height="wrap_content"
  25. android:textSize="20sp"
  26. android:textColor="#ff5c5c"
  27. android:id="@+id/tv_result" />
  28. </LinearLayout>
  29. <Button
  30. android:layout_width="match_parent"
  31. android:layout_height="40dp"
  32. android:layout_marginTop="20dp"
  33. android:gravity="center"
  34. android:textSize="20sp"
  35. android:textColor="#ffffff"
  36. android:background="@drawable/btn_bg"
  37. android:text="打开选择器"
  38. android:onClick="doSelect"/>
  39. </LinearLayout>

Java文件

  1. package com.whieenz.searchselect;
  2. import android.support.v7.app.AppCompatActivity;
  3. import android.os.Bundle;
  4. import android.view.View;
  5. import android.widget.TextView;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. public class MainActivity extends AppCompatActivity {
  9. private List<String> mDatas;
  10. private TextView textView;
  11. @Override
  12. protected void onCreate(Bundle savedInstanceState) {
  13. super.onCreate(savedInstanceState);
  14. setContentView(R.layout.activity_main);
  15. textView = (TextView) findViewById(R.id.tv_result);
  16. initData();
  17. }
  18. public void doSelect(View view){
  19. SerachSelectDialog.Builder alert = new SerachSelectDialog.Builder(this);
  20. alert.setListData(mDatas);
  21. alert.setTitle("请选择城市");
  22. alert.setSelectedListiner(new SerachSelectDialog.Builder.OnSelectedListiner() {
  23. @Override
  24. public void onSelected(String info) {
  25. textView.setText(info);
  26. }
  27. });
  28. SerachSelectDialog mDialog = alert.show();
  29. //设置Dialog 尺寸
  30. mDialog.setDialogWindowAttr(0.9,0.9,this);
  31. }
  32. /**
  33. * 初始化数据
  34. */
  35. private void initData(){
  36. mDatas = new ArrayList<>();
  37. String [] citys = {"武汉","北京","上海","深圳","兰州","成都","天津"};
  38. for (int i = 0; i < 10; i++) {
  39. for (int j = 0; j < citys.length; j++) {
  40. mDatas.add(citys[j]+i);
  41. }
  42. }
  43. }
  44. }

其他配置

Dialog style(样式)

  1. <style name="selectDialog" parent="@android:style/Theme.Dialog">
  2. <item name="android:windowNoTitle">true</item>//无标题
  3. <item name="android:windowBackground">@color/transparent</item>
  4. </style>

相关文章:Android自定义模糊匹配搜索控件(二)

Android 自定义支持快速搜索筛选的选择控件(一)的更多相关文章

  1. Android自定义View(CustomCalendar-定制日历控件)

    转载请标明出处: http://blog.csdn.net/xmxkf/article/details/54020386 本文出自:[openXu的博客] 目录: 1分析 2自定义属性 3onMeas ...

  2. Android自定义View(三、深入解析控件测量onMeasure)

    转载请标明出处: http://blog.csdn.net/xmxkf/article/details/51490283 本文出自:[openXu的博客] 目录: onMeasure什么时候会被调用 ...

  3. Android 自定义 HorizontalScrollView 打造再多图片(控件)也不怕 OOM 的横向滑动效果

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/38140505 自从Gallery被谷歌废弃以后,Google推荐使用ViewPa ...

  4. Android 自定义View 三板斧之二——组合现有控件

    通常情况下,Android实现自定义控件无非三种方式. Ⅰ.继承现有控件,对其控件的功能进行拓展. Ⅱ.将现有控件进行组合,实现功能更加强大控件. Ⅲ.重写View实现全新的控件 上文说过了如何继承现 ...

  5. Android自定义模糊匹配搜索控件(二)

    在项目中遇到一个需要通过某个字的值筛选匹配带出其他信息的需求,在这里将实现思路整理出来. 源码地址:https://github.com/whieenz/SearchSelect 先看效果图 上图中的 ...

  6. Android自定义View(RollWeekView-炫酷的星期日期选择控件)

    转载请标明出处: http://blog.csdn.net/xmxkf/article/details/53420889 本文出自:[openXu的博客] 目录: 1分析 2定义控件布局 3定义Cus ...

  7. 用c/c++混合编程方式为ios/android实现一个自绘日期选择控件(一)

    本文为原创,如有转载,请注明出处:http://www.cnblogs.com/jackybu 前言 章节: 1.需求描述以及c/c++实现日期和月历的基本操作 2.ios实现自绘日期选择控件 3.a ...

  8. SNF开发平台WinForm之三-开发-单表选择控件创建-SNF快速开发平台3.3-Spring.Net.Framework

    3.1运行效果: 3.2开发实现: 3.2.1 这个开发与第一个开发操作步骤是一致的,不同之处就是在生成完代码之后,留下如下圈红程序,其它删除. 第一个开发地址:开发-单表表格编辑管理页面 http: ...

  9. 通用数据水平层级选择控件v0.70升级版使其支持jQuery v1.9.1

    升级原因:作者原来脚本支持的jquery版本太低了,查找了下资料,使得它能支持最新版本的jquery 备注说明:脚本代码源作者跟源文出处很难找,只能在此特感谢他的分享. 更新部分: 1.新版本不再支持 ...

随机推荐

  1. Vim 游戏 2048

    给大家介绍一款可以在Vim里面玩的游戏 vim2048. 界面如图: 操作非常简单,可以用 hjkl 或者 上下左右方向键移动 项目开源地址为: https://github.com/wsdjeg/v ...

  2. LeetCode & Q219-Contains Duplicate II

    Array Hash Table Description: Given an array of integers and an integer k, find out whether there ar ...

  3. Jenkins 安装、配置与项目新建及构建

    1.Jenkins的安装与配置 1.1 java环境配置 Jenkins基于Java, Linux下安装java只要配置java环境变量即可. 首先,解压java到相应目录,我一般习惯把安装的软件放到 ...

  4. jQuery兼容浏览器IE8方法

    在维护公司网站的时候,发现在IE8下jquery会报对象不支持此属性或方法.缺少对象的错误:  在其他浏览器就可以正常运行,当前使用的jquery版本是3.1.1,查资料发现jquery从2.0开始不 ...

  5. restful架构风格设计准则(一)以资源为中心、自描述的请求响应、资源状态迁移为粒度

    读书笔记,原文链接:http://www.cnblogs.com/loveis715/p/4669091.html,感谢作者! 一.需求描述 当用户在某个电子商务网站购物时,他首先查看要购买的商品分类 ...

  6. hadoop2.7.3+spark2.1.0+scala2.12.1环境搭建(2)安装hadoop

    一.依赖安装 安装JDK 二.文件准备 hadoop-2.7.3.tar.gz 2.2 下载地址 http://hadoop.apache.org/releases.html 三.工具准备 3.1 X ...

  7. [转]安卓新一代多渠道打包工具Walle 解决渠道包V2签名问题

    转自https://www.jianshu.com/p/572b59829a08 为什么要打多个渠道的包? 大家都知道,android应用商店大大小小有几百个,作为一个有志向的app,就需要做到统计各 ...

  8. 框架学习笔记之Hibernate

    一.什么是Hibernate Hibernate框架是当今主流的持久层框架之一,该框架是基于JDBC的主流持久化框架,使用它之后能够大大简化程序DAO层的代码量,提高工作效率,因此受广大开发人员的喜爱 ...

  9. Linux服务器SSH无法通过DSA证书登录的解决方法

    从openssh7.0开始,ssh-dss密钥被默认禁用. 修改服务器端的openssh设置重新开启 # vim /etc/sshd/sshd_config添加以下选项PubkeyAcceptedKe ...

  10. python2.7-巡风源码阅读

    推荐个脚本示例网站:https://www.programcreek.com/python/example/404/thread.start_new_thread,里面可以搜索函数在代码中的写法,只有 ...