工作第十三周:身体掏空,精神饱满

一连 7 天班,晨兴理荒秽,带月荷键归,身体累的像条狗,脑子却转得飞快。
心态转变以后,即使工作生活里有些不顺的事,也没那么发愁了,毕竟它们只是过客。

新单词

  • from scratch 从0开始
  • braces 括弧
    吊带,背带;托架( brace的名词复数 );箍子;括弧;(儿童)牙箍
  • sophisticated 复杂的;精致的;富有经验的;深奥微妙的
    • Simplicity is the ultimate sophistication 至繁归于至简
  • occupy 占领;使用,住在…;使从事,使忙碌;任职
  • identical 同一的; 完全同样的,相同的; 恒等的; 同卵的
  • capitalization of the first character 大写首字母
  • redundantly 多余地
  • nested 嵌套地
  • modifier 修饰语
  • mutations 突变 very rare mutations
    • this class provides methods to manipulate the size of the array
  • capacity 容量;性能;才能;生产能力
    • Constructs a new instance of {@code ArrayList} with the specified initial capacity.
  • backed by 依靠,基于 ArrayList is backed by an array

这一周

1.向郭霖大神公众号投稿得了 11 元打赏,第一笔稿费哈哈。

2.在 廖雪峰 前辈博客上看到一篇文章,摘一段:
《软技能:代码之外的生存指南》:

  • 不要做宅男;
  • 和面试官成为好朋友后再去面试(结果你懂的);
    • (是的没错,熟人好办事,不过还是要有里子别人才给你面子)
  • 如何成为自由职业者;
  • 假装自己能成功;
    • (的确,首先要有成功者的姿态,自信)
  • 打造自身品牌:坚持写博客;
    • (劝劝自己:还是先把基础知识学好吧 )
  • 有效管理时间以提升效率;
  • 学会理财:要善于炒股炒房(炒股在中国可能不算理财算赌博);
    • (炒房 - -)
  • 不要刷爆信用卡(这个问题可能美国人比较严重);
    • (买房贷款一样有影响)
  • 少看电视多运动,争取练成肌肉男。
    • (不花钱办健身卡没动力啊 )

3.阅读如果没有真正找出作者想要传递的思想,那么和没读有什么区别。

技术上的收获

1.多种服务器接口地址环境配置思路
  • assets下写个json,把不同环境不同业务的域名写进去
  • 自定义一个环境选择View DebugEnvView
  • 读取 assets 中的文件并解析
  • 用户选择后进行相应配置
2.加载 base64 图片

了解到,图片加载库帮我们做了哪些工作呢?

  • 下载
  • 解压
  • 加载

http://stackoverflow.com/questions/37426711/converting-base64-into-bitmap-and-loading-into-recycler-view
http://stackoverflow.com/questions/17506428/convert-base64-string-to-image-in-java
http://stackoverflow.com/questions/30167205/base64-decode-for-image-jpegbase64-in-android

3.uri 类 :

对一个 url 进行操作,获取 scheme,host,authority, path, queryParameter 等

4.加快 gradle build 时间

https://medium.com/@cesarmcferreira/speeding-up-gradle-builds-619c442113cb#.q6b7onhsu

5.微信第三方接入时回调要求在包名路径下的.wxapi.WXCallBackxxx 固定写死这个文件才能回调。就是说如果你修改了ApplicationId没有修改PackageName是无法收到微信回调的。
6.Building Android Apps — 30 things that experience made me learn the hard way
7.module 不如打成 jar 包或者 aar 包,那样可以减少 build 时间

Don’t use more modules than you actually need. If that modules are not constantly modified, it’s important to have into consideration that the time needed to compile them from scratch (CI builds are a good example), or even to check if the previous individual module build is up-to-date, can be up to almost 4x greater than to simply load that dependency as a binary .jar/.aar.

8.vim 修改文件,解决冲突
  • 打开文件
vim app/src/main/res/values/strings.xml 
  • 按 I 键进入 Intert 模式
  • 删掉冲突内容
  • 按 esc 退出编辑
  • shift + : 进入命令行模式
  • 输入 wq,保存并退出

若要继续 rebase

 git rebase --continue

退出 rebase

git rebase --abort
9.onNewIntent

This is called for activities that set launchMode to “singleTop” in their package, or if a client used the {@link Intent#FLAG_ACTIVITY_SINGLE_TOP} flag when calling {@link #startActivity}. In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it.

An activity will always be paused before receiving a new intent, so you can count on {@link #onResume} being called after this method.

Note that {@link #getIntent} still returns the original Intent. You can use {@link #setIntent} to update it to this new Intent.

下面摘自
http://baurine.github.io/2015/12/26/android_onnewintent.html
有图

当 activity (假设为 A) 的 launchMode 为 singleTop 且 A 的实例已经在 task 栈顶,或者 launchMode 为 singleTask 且 A 的实例已在 task 栈里 (无论是栈顶还是栈中),再次启动 activity A 时,便不会调用 onCreate() 去产生新的实例,而是调用 onNewIntent() 并重用 task 栈里的 A 实例。

如果 A 在栈顶,那么调用顺序依次是 A.onPause() –> A.onNewIntent() –> A.onResume()。A 的 launchMode 可以是 singleTop 或者是 singlTask。android 开发者官网 上描述的是这种情况。

如果 A 不在栈顶,此时它处于 A.onStop() 状态,当再次启动时,调用顺序依次是 [A.onStop()] –> A.onNewIntent() –> A.onRestart() –> A.onStart() –> A.onResume()。A 的 launchMode 只能是 singleTask。

10.使用 EventBus 注册后,退出一定要记得 unRegister,否则一个消息会有多个订阅者接受,导致回调多次!!
@Override
protected void onDestroy() {
    super.onDestroy();
    if (EventBus.getDefault().isRegistered(this)) {
        EventBus.getDefault().unregister(this);
    }
}
11.Activity A 可能需要由 Activity B 根据情况关闭,有两种方式:
  • 维护一个 activity stack / list,A 添加进去,需要删除时遍历,删掉
  • 用 EventBus (好像是观察者模式) 在 A 中写一个 onEvent,B 中调用 EventBus.getDefault().post(new XXEvent());
  • 类似上面,写个回调
12.客户端明文保存密码有问题,存在密码泄露隐患

图片压缩网站 https://tinypng.com/

总结

来不及了!继续努力!

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拭心

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值