理论知识:
Android 中的多进程,你值得了解的一些知识 https://yifeng.studio/2017/06/16/android-multi-process-things/
Tray 轻量级数据存储 sharepreference的替代实现进程间数据共享方案 https://blog.csdn.net/jingSummer/article/details/77334778 具体实现看: https://blog.csdn.net/u012372365/article/details/52415035 如果你存空值,就你输了
介绍几种Android支持跨进程共享数据的开源框架 https://www.jianshu.com/p/cc40ab07c14e
Android中Activity四种启动模式和taskAffinity属性详解 https://blog.csdn.net/zhangjg_blog/article/details/10923643
APK打包:
Android Studio 超级简单的打包生成apk https://blog.csdn.net/woaichimahua/article/details/54427528
Android Studio 打包Apk https://www.jianshu.com/p/7e5b1bacc35c
Android UI 框架:
如何在安卓app中使用FontAwesome图标 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0925/3518.html
ButterKnife使用详解 https://www.jianshu.com/p/8256554dea6e
GitHub上受欢迎的Android UI Library(上) https://www.jianshu.com/p/1ffa661e2b83
GitHub上受欢迎的Android UI Library(下) https://www.jianshu.com/p/5e91716aa379
Awesome-MaterialDesign https://github.com/lightSky/Awesome-MaterialDesign
awesome-android-ui https://github.com/wasabeef/awesome-android-ui
腾讯开源的Android UI框架——QMUI Android https://juejin.im/entry/5a289e04f265da43305e5aa5 这个框架包含了IOS和Android,以及Web三个平台 QMUI(Android)炒鸡简单的配置详解 https://www.jianshu.com/p/38007e54b30b
V – Layout:淘宝、天猫都在用的Android UI框架 完全解析 https://juejin.im/post/5a0107816fb9a0452b48a205
awesome Android UI/UX libraries 简直时android ui界的bootstrap https://github.com/wasabeef/awesome-android-ui
Android-Bootstrap:Android手机版的Bootstrap https://github.com/Bearded-Hen/Android-Bootstrap 里面包含教程了 使用方法:https://blog.csdn.net/dsc114/article/details/50432798 http://hao.jobbole.com/android-bootstrap/ 很变态的问题:如果按钮存在app:bootstrapSize属性,就无法使用onclick事件
Android酷炫实用的开源框架(UI框架) http://www.runoob.com/w3cnote/android-ui-framework.html
Android主流UI开源库整理 https://www.jianshu.com/p/47a4a7b99364
总结的Android开源项目及库 https://github.com/Tim9Liu9/TimLiu-Android
Android 开发和安全系列工具 https://juejin.im/entry/58a52a3e5c497d005fa6ffcd
Android注解框架对比 https://blog.csdn.net/p892848153/article/details/50433279
Android第三方开源库:底部导航栏 https://blog.csdn.net/ss1168805219/article/details/77530013
滑动菜单栏(一)开源项目SlidingMenu的使用和示例 http://www.cnblogs.com/yc-755909659/p/4306938.html
Android新特性介绍,ConstraintLayout完全解析 https://blog.csdn.net/guolin_blog/article/details/53122387
Android开源项目 http://www.trinea.cn/android/android-open-source-projects-view/
Android布局
ConstraintLayout完全解析 https://blog.csdn.net/guolin_blog/article/details/53122387
LinearLayout(线性布局) http://www.runoob.com/w3cnote/android-tutorial-linearlayout.html
RelativeLayout(相对布局) http://www.runoob.com/w3cnote/android-tutorial-relativelayout.html
TableLayout(表格布局) http://www.runoob.com/w3cnote/android-tutorial-tablelayout.html
FrameLayout(帧布局) http://www.runoob.com/w3cnote/android-tutorial-framelayout.html
GridLayout(网格布局) http://www.runoob.com/w3cnote/android-tutorial-gridlayout.html
AbsoluteLayout(绝对布局) http://www.runoob.com/w3cnote/android-tutorial-absolutelayout.html
Android表单映射框架 SHFormLayout 快速生成表单布 https://github.com/hui46226021/ShFormUtils
Android示例教程
TabLayout用法,android顶部导航栏,android底部导航栏 https://blog.csdn.net/tianyaleixiaowu/article/details/50820257
android官方侧滑菜单DrawerLayout详解 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0925/1713.html
登录界面模板 https://github.com/youth5201314/UITemplateView
一个炫酷的Material Design 风格的登录和注册页面 http://tiki.cat/2016/05/17/beautiful-android-login-and-signup-screens-with-material-design-zh/
Android EditText——扁平化的登录界面 https://www.jianshu.com/p/56605c1427ea
Fragment最全面介绍 & 使用方法解析 https://www.jianshu.com/p/2bf21cefb763
Android Selector的介绍与用法 https://blog.csdn.net/qq_30552993/article/details/73327414
Android Studio创建Android公共库模块 https://blog.csdn.net/binjianliu/article/details/78016619
如何在安卓app中使用FontAwesome图标 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0925/3518.html
Android6.0动态申请SD卡读写的权限 https://blog.csdn.net/wuqingyou_w/article/details/60138807
一行代码搞定Android 6.0动态权限申请 https://blog.csdn.net/dfqin/article/details/55190073
Android6.0——权限申请管理(单个权限和多个权限申请) https://blog.csdn.net/DickyQie/article/details/78058969
ActionBar “标题”居中 https://blog.csdn.net/luohaowang320/article/details/38933907
圆形按钮circlebutton https://github.com/markushi/android-circlebutton
Android颜色透明设置 https://blog.csdn.net/lkjfyy/article/details/71159441
Android设置控件的透明度(半透明效果)三种方法 https://blog.csdn.net/dfskhgalshgkajghljgh/article/details/52458084
Android控件显示和隐藏 https://blog.csdn.net/MrZhang_happy/article/details/39209117
Android在ImageView上直接显示网络图片 https://blog.csdn.net/qq_33200967/article/details/77263062
android通过Bitmap载入三种图片方式 https://blog.csdn.net/snadijssajskkj/article/details/52084382
android 读取本地图片生成 bitmap https://blog.csdn.net/kaojistream/article/details/51040261
Android-在子线程中显示Toast和Dialog https://blog.csdn.net/u012230055/article/details/54289280
android 线程 Handler弹出对话框 http://blog.sina.com.cn/s/blog_9ec5eef701017is1.html
android 线程 AsyncTask弹出对话框 https://stackoverrun.com/cn/q/5157702
更新数据,需要在Handler里面做 https://blog.csdn.net/yuxiao98/article/details/8503972
官方推荐的几种方式将数据持久化到磁盘上(存储选项) https://developer.android.com/guide/topics/data/data-storage
Android 禁止屏幕休眠和锁屏的方法 https://blog.csdn.net/chenyafei617/article/details/6575621
ListView中的数据一直显示在最底部(类似聊天中的信息列表) https://blog.csdn.net/chenguang79/article/details/51125973
Android完全退出APP,并且清除活动栈 https://blog.csdn.net/wapchief/article/details/77447396
Android开发之控制手机振动(Vibrator的使用) https://blog.csdn.net/fengyuzhengfan/article/details/38174543
Android 回退键监听 https://blog.csdn.net/wenzhi20102321/article/details/78563952
ImageView设置边框的两种方式 https://blog.csdn.net/lfdfhl/article/details/10526277
EventBus使用详解 https://www.jianshu.com/p/a040955194fc
隐藏顶部导航栏 :
方法一:android:theme=”@style/Theme.AppCompat.NoActionBar”
方法二:
1 2 |
<item name="android:actionBarStyle">@style/my_actionbar_style</item> <item name="actionBarStyle">@style/my_actionbar_style</item> |
1 2 |
supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);//这句要注意加上 setContentView(R.layout.activity_live_list); |
动态加载View
1 2 3 4 5 6 |
//动态加载顶部View和底部View final LayoutInflater inflater = LayoutInflater.from(this); View headView = inflater.inflate(R.layout.view_header, null, false); View footView = inflater.inflate(R.layout.view_footer, null, false); activityListView1L003.addHeaderView(headView); activityListView1L003.addFooterView(footView); |
Handler弹出对话框
方式一:在run()中无法使用ajax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
final Handler mHandler = new Handler(); new Thread(new Runnable() { @Override public void run() { mHandler.post(new Runnable() { public void run() { Toast.makeText(LoginActivity.this, "成功登录......", Toast.LENGTH_SHORT).show(); AlertDialog alert = null; AlertDialog.Builder builder = new AlertDialog.Builder(mContext); alert = builder.setTitle("系统提示:") .setMessage("这是一个最普通的AlertDialog,\n带有三个按钮,分别是取消,中立和确定") .setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(mContext, "你点击了取消按钮~", Toast.LENGTH_SHORT).show(); } }) .setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(mContext, "你点击了确定按钮~", Toast.LENGTH_SHORT).show(); } }) .setNeutralButton("中立", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(mContext, "你点击了中立按钮~", Toast.LENGTH_SHORT).show(); } }).create(); //创建AlertDialog对象 alert.show(); } }); } }).start(); |
方式二:在AsyncTask可以使用ajax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
final Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); Toast.makeText(LoginActivity.this, "测试成功......", Toast.LENGTH_SHORT).show(); AlertDialog alert = null; AlertDialog.Builder builder = new AlertDialog.Builder(mContext); alert = builder.setTitle("错误提示:") .setMessage("你输入的帐号或者密码错误,请重新输入.") .setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //Toast.makeText(mContext, "你点击了确定按钮~", Toast.LENGTH_SHORT).show(); } }).create(); alert.show(); } }; new AsyncTask(){ @Override protected Object doInBackground(Object[] params) { handler.sendEmptyMessage(0x001); return null; } }.execute(); |
以上方式改用下面发送方式,会省掉很多代码
1 |
Message.obtain(handler,4,"2这是一个错误的信息").sendToTarget(); |
动态加载ListView数据:在使用ajax的时候,定义一个全局的List对象,用来保存数据,然后使用List对象创建一个adapter,然后创建Handler和AsyncTask,后者调用ajax来更新List对象, 然后发送消息给Handler,在Handler更新数据:adapter.notifyDataSetChanged();
动态获取宽度高度,动态设定宽度高度
1 2 3 4 5 6 7 8 |
//取屏幕高 int outerHeight=getResources().getDisplayMetrics().heightPixels-(int)(25*getResources().getDisplayMetrics().density);//得减去标题栏高度 //取屏幕宽 int outerwidth=getResources().getDisplayMetrics().widthPixels; LinearLayout.LayoutParams linearParams =(LinearLayout.LayoutParams) textView.getLayoutParams(); //取控件textView当前的布局参数 linearParams.height = 20;// 控件的高强制设成20 linearParams.width = 30;// 控件的宽强制设成30 textView.setLayoutParams(linearParams); //使设置好的布局参数应用到控件 |