-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
16 lines (16 loc) · 11.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html><html lang="zh-cn"><head><meta charset="utf-8"><meta name="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="author" content="Holo Wang"><meta name="description"><title>加贝龙</title><link rel="icon" href="/long_02.jpg"><link rel="canonical" href="http://yoursite.com/"><link rel="alternate" href="/atom.xml" title="加贝龙"><link rel="stylesheet" href="/fonts/iconfont/iconfont.css"><link rel="stylesheet" href="/css/style.css"></head><body><div id="main"><header><a href="/." class="logo">加贝龙</a><ul class="nav"><li class="nav-link"><a href="/" class="active">首页</a></li><li class="nav-link"><a href="/archives/" target="_self">归档</a></li><li class="nav-link"><a href="/categories/" target="_self">分类</a></li><li class="nav-link"><a href="/tags/" target="_self">标签</a></li><li class="nav-link"><a href="/about/" target="_self">关于</a></li></ul></header><section id="container"><ul class="home"><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2017/04/08/Cordova_custom_plugin/" class="post-link">Cordova : 自定义Plugin</a></h2><span class="post-time">2017年4月8日</span><div class="post-content"><h3 id="Cordova之自定义Plugin"><a href="#Cordova之自定义Plugin" class="headerlink" title="Cordova之自定义Plugin"></a>Cordova之自定义Plugin</h3><p>本文通过自定义一个简单的Toast插件来介绍一下如何从0开始自定义自己的plugin,基于cordova6.2.1版本。在这之前你需要创建一个Cordova项目,如何创建一个Corodva项目可以参考<a href="http://kidloserme.github.io/2016/11/25/Cordova_Plugin_2016-11-25/">Cordova:Plugin</a>中的1-5步骤,这里不在赘述。</p>
<h4 id="1-原生插件开发"><a href="#1-原生插件开发" class="headerlink" title="1.原生插件开发"></a>1.原生插件开发</h4><p>首先创建一个<code>ToastPlugin</code>,我把他放在了主工程中,所有自定义的<code>Plugin</code>都是继承自<code>CordovaPlugin</code>,然后重写<code>CordovaPlugin</code>的<code>execute</code>方法来实现插件的功能,<code>CordovaPlugin</code>中定义了三个<code>execute</code>,这里我选择重写方法<code>public boolean execute(String action, JSONArray args, CallbackContext callbackContext)</code>,至于重写哪个好,全凭自己喜欢。下面看下<code>ToastPlugin</code>的代码:</p></div><a href="/2017/04/08/Cordova_custom_plugin/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/11/25/JingoalPush_2016-11-25/" class="post-link">Android项目集成小米、华为、个推</a></h2><span class="post-time">2016年11月25日</span><div class="post-content"><p>为了项目中方便使用,首先要把这三家push sdk集成到一个library项目中,并将通过广播接收到的推送消息统一分发到一个广播中,在主项目中直接引用此项目即可。<br>项目地址:<a href="https://github.com/kidloserme/JingoalPushDemo">JingoalPushDemo</a><br>集成很简单:</p>
<h3 id="1-添加项目依赖"><a href="#1-添加项目依赖" class="headerlink" title="1.添加项目依赖"></a>1.添加项目依赖</h3><p>项目中导入pushlibrary,在主项目的build.gradle添加对libray项目的依赖:<br><code>compile project(':pushlibrary')</code></p>
<h3 id="2-申请帐号"><a href="#2-申请帐号" class="headerlink" title="2.申请帐号"></a>2.申请帐号</h3><p>在三个平台注册开发者帐号,并创建自己的应用,获取所需要的appid、appkey等信息,华为的需要打包签名文件的SHA256值,这个在新建华为帐号的时候会有说明。<br>小米推送需要信息:APPID , APPKEY<br>个推推送需要信息:APPID , APPKEY,APPSECRET<br>华为推送需要信息:华为推送客户端不需要设置这些参数,只要保证包名以及打包签名文件的SHA256信息跟开发者平台配置的一样即可。</p></div><a href="/2016/11/25/JingoalPush_2016-11-25/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/11/25/Cordova_Plugin_2016-11-25/" class="post-link">Cordova:Plugin</a></h2><span class="post-time">2016年11月25日</span><div class="post-content"><p>跟着<a href="http://kidloserme.github.io/2016/11/22/Cordova_Helloword_2016-11-22/">Cordova:HelloWord</a>搞定了怎么创建一个Android项目之后,看看怎么使用Cordova的Plugin吧。<br>因为使用命令行创建的项目导图AS时报错,有问题,所以这里直接创建一个项目,然后将需要的文件拷贝到项目中去即可。</p>
<blockquote>
<p>1.添加插件</p>
</blockquote>
<p>首先要通过cordova命令添加所需要的插件,此次测试一个比较简单的插件dialog,添加的命令<code>cordova plugin add cordova-plugin-dialogs</code>,看下图:<br><img src="../../../../images/cordova/add_plugin.png" width = "70%" align=center /><br>OK,添加成功了,从上图中可以看到进入到android/assets/www/plugins目录中已经有我们刚才添加的插件了,下面开始看怎么使用他吧。</p></div><a href="/2016/11/25/Cordova_Plugin_2016-11-25/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/11/22/Cordova_Helloword_2016-11-22/" class="post-link">Cordova : HelloWord</a></h2><span class="post-time">2016年11月22日</span><div class="post-content">如何搭建Cordova所需的环境以及创建第一个Cordova HelloWord项目</div><a href="/2016/11/22/Cordova_Helloword_2016-11-22/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/09/24/RxJava_Create_2016-09-24/" class="post-link">操作符Create</a></h2><span class="post-time">2016年9月24日</span><div class="post-content"><h3 id="1-Observables"><a href="#1-Observables" class="headerlink" title="1.Observables"></a>1.Observables</h3><p> 先认识几个重要的概念 </p>
<ul>
<li><strong>Observable</strong>:一个可观察对象或者被观察者</li>
<li><strong>Observer</strong>:观察者(订阅者)</li>
<li><strong>Subscribe</strong>:Observer的子类,比Observer多了onStart和unsubscribe两个方法</li>
</ul>
<p>在RxJava中,一个实现了Observer接口的对象可以订阅(subscribe)一个Observable 类的实例。订阅者(subscriber)对Observable发射(emit)的任何数据或数据序列作出响应。</p></div><a href="/2016/09/24/RxJava_Create_2016-09-24/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/09/24/2016-03-09-mediacodec/" class="post-link">Android MediaCodec 硬编码H264格式</a></h2><span class="post-time">2016年9月24日</span><div class="post-content"><p>最近在研究EasyDarwin的Push库EasyPuhser,EasyPuhser可以推送H264视频到Easydarwin服务器,终端可以通过rtsp协议访问该实时流,达到手机直播的功能,延迟基本在2秒以内。<br>EasyDarwinQQ群:496258327<br>本文主要记录一下最近研究的关于Android手机如何获取实时画面,并将数据编码为H264的格式的视频流,编码使用的是Android自带的MediaCodec,也就是硬解。<br>本demo的下载地址:<a href="https://github.com/kidloserme/MediaCodecDemo">MediaCodecDemo</a></p></div><a href="/2016/09/24/2016-03-09-mediacodec/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/09/24/2016-03-17-EventBus/" class="post-link">EventBus源码阅读之事件的注册</a></h2><span class="post-time">2016年9月24日</span><div class="post-content"><p>之前看过EventBus的源码,不是很深入,导致有些模糊,此次仔细阅读了一下,记录笔记,方便以后熟悉。<br>本篇主要说一下register的过程:<br></p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">synchronized</span> <span class="keyword">void</span> <span class="title">register</span><span class="params">(Object subscriber, <span class="keyword">boolean</span> sticky, <span class="keyword">int</span> priority)</span> </span>{</div><div class="line"> <span class="comment">//查找subscriber(执行register的类)中注册事件的方法,onEvent开头,参数只允许一个,超过一个将被忽略</span></div><div class="line"> List<SubscriberMethod> subscriberMethods = subscriberMethodFinder.findSubscriberMethods(subscriber.getClass());</div><div class="line"> <span class="keyword">for</span> (SubscriberMethod subscriberMethod : subscriberMethods) {</div><div class="line"> <span class="comment">//根据事件类型以及订阅类进行数据处理</span></div><div class="line"> subscribe(subscriber, subscriberMethod, sticky, priority);</div><div class="line"> }</div><div class="line">}</div></pre></td></tr></table></figure></div><a href="/2016/09/24/2016-03-17-EventBus/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/09/24/2016-03-17-Points/" class="post-link">知识点总结</a></h2><span class="post-time">2016年9月24日</span><div class="post-content"><h3 id="HaspMap原理"><a href="#HaspMap原理" class="headerlink" title="HaspMap原理"></a>HaspMap原理</h3><p>根据key的hashCode与Enty[]长度取模获取index来决定放入Enty中的位置,index重复则使用Entry.next在同一个index中放入多个值<br>具体可看:<a href="http://www.cnblogs.com/xwdreamer/archive/2012/05/14/2499339.html">http://www.cnblogs.com/xwdreamer/archive/2012/05/14/2499339.html</a> 介绍</p>
<h3 id="HashMap和HashTable的区别"><a href="#HashMap和HashTable的区别" class="headerlink" title="HashMap和HashTable的区别"></a>HashMap和HashTable的区别</h3><p>HaspMap继承AbstractMap ,HashTable继承Dictionary<br>HashMap的方法不是同步的,HashTable的方法是同步的<br>HashMap允许key和value为Null,HashTable不允许key和value为null<br>详见:<a href="http://blog.csdn.net/shohokuf/article/details/3932967">http://blog.csdn.net/shohokuf/article/details/3932967</a></p></div><a href="/2016/09/24/2016-03-17-Points/" class="read-more">阅读全文..</a></article></li><li class="post-item"><article class="post"><h2 class="post-title"><a href="/2016/09/24/hello-world/" class="post-link">Hello World</a></h2><span class="post-time">2016年9月24日</span><div class="post-content">Hello World ,第一篇测试文章</div><a href="/2016/09/24/hello-world/" class="read-more">阅读全文..</a></article></li></ul><div class="paginator"></div></section><footer><div class="social"><a href="mailto:1341957752@qq.com" title="email" class="iconfont icon-email"></a><a href="http:/github.com/kidloserme" title="github" class="iconfont icon-github"></a><a href="/atom.xml" title="rss" class="iconfont icon-rss"></a></div><div class="copyright"><p class="power">Powered by <a href="https://hexo.io/">Hexo</a> and Theme by <a href="https://github.com/ahonn/hexo-theme-even"> Even</a></p><p class="since">©2017<span class="heart"><i class="iconfont icon-heart"></i></span><span class="author">Holo Wang</span></p></div><label id="back2top"><i class="iconfont icon-up"></i></label></footer></div><script src="/js/zepto.min.js"></script><script src="/js/theme.js"></script></body></html>