<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[木子屋 - Android编程]]></title>
<link>http://www.mzwu.com/</link>
<description><![CDATA[Dnawo&#39;s BLOG]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[service@mzwu.com(Dnawo)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>木子屋</title>
	<url>http://www.mzwu.com/images/logos.gif</url>
	<link>http://www.mzwu.com/</link>
	<description>木子屋</description>
</image>

			<item>
			<link>http://www.mzwu.com/article.asp?id=4288</link>
			<title><![CDATA[WebView控件打不开网页提示ERR_UNKNOWN_URL_SCHEME解决方法]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Thu,20 Oct 2016 13:14:31 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4288</guid>
		<description><![CDATA[<img src="http://www.mzwu.com/pic/201610/074.jpg" border="0" alt=""/><br/><br/>网址前边是taobao://而不是<a href="http://" target="_blank" rel="external">http://</a>，分析是淘宝电脑版页面判断出当前是手机用户，尝试调用淘宝客户端出错，将WebView.loadUrl方法中电脑版网页地址改成手机版网页地址即可：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code70983);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code70983>webView.loadUrl(&#34;<a href="https://item.taobao.com/item.htm?id=38946217400" target="_blank" rel="external">https://item.taobao.com/item.htm?id=38946217400</a>&#34;);</div></div><br/>修改为：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code62697);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code62697>webView.loadUrl(&#34;<a href="http://h5.m.taobao.com/awp/core/detail.htm?id=38946217400" target="_blank" rel="external">http://h5.m.taobao.com/awp/core/detail.htm?id=38946217400</a>&#34;);</div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4284</link>
			<title><![CDATA[Google Play发布Android应用示例]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Sun,16 Oct 2016 15:34:57 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4284</guid>
		<description><![CDATA[在Google Play发布Android应用流程还是比较简单的，先注册一个 Google Play 发布者帐户(需支付25美元)，然后上传应用并填写相关应用信息就可以发布了：<br/><br/><img width="600" height="273" src="http://www.mzwu.com/pic/201610/052.jpg" border="0" alt=""/><br/><br/><img width="600" height="349" src="http://www.mzwu.com/pic/201610/053.jpg" border="0" alt=""/><br/><br/><img width="600" height="296" src="http://www.mzwu.com/pic/201610/054.jpg" border="0" alt=""/><br/><br/><img width="600" height="273" src="http://www.mzwu.com/pic/201610/055.jpg" border="0" alt=""/><br/><br/><img width="600" height="882" src="http://www.mzwu.com/pic/201610/058.jpg" border="0" alt=""/><br/><br/>整个过程比较麻烦的是怎么支付那25美元注册费，我试了国内几家银行信用卡都不能支付，后来知道有虚拟信用卡这种东东，在<a target="_blank" href="http://dwz.cn/4nfSwu" rel="external">万事达卡全球付</a>网站上申请了一张，并最终支付成功完成注册：<br/><br/><img width="600" height="326" src="http://www.mzwu.com/pic/201610/056.jpg" border="0" alt=""/><br/><br/><img width="600" height="161" src="http://www.mzwu.com/pic/201610/057.jpg" border="0" alt=""/><br/><br/><i>PS：万事达卡全球付申请成功后会分配一张虚拟卡，有卡号、有效期、安全码等基本信息，需先充值后消费，可提现，仅能用于网上支付。</i><br/><br/><strong>相关链接</strong><br/><br/>[1].开始发布应用：<a href="https://developer.android.com/distribute/googleplay/start.html" target="_blank" rel="external">https://developer.android.com/distribute/googleplay/start.html</a><br/>[2].Google Play开发者平台：<a href="https://play.google.com/apps/publish/?hl=zh-CN" target="_blank" rel="external">https://play.google.com/apps/publish/?hl=zh-CN</a><br/>[3].万事达卡全球付：<a target="_blank" href="http://dwz.cn/4nfSwu" rel="external">https://www.globalcash.hk/</a><br/>[4].易简学汉语拼音点读机：<a href="https://play.google.com/store/apps/details?id=com.neargou.pinyin" target="_blank" rel="external">https://play.google.com/store/apps/details?id=com.neargou.pinyin</a>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4282</link>
			<title><![CDATA[Android设置Theme.NoTitleBar去除标题栏总出错解决方法]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Sat,15 Oct 2016 08:23:55 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4282</guid>
		<description><![CDATA[在AndroidManifest.xml配置去除应用标题栏，手机安装后一打开就出错：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code49872);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code49872>&lt;activity<br/>&nbsp;&nbsp;&nbsp;&nbsp;android:name=&#34;.MainActivity&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:Red">android:theme=&#34;@android:style/Theme.NoTitleBar&#34;</span>&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;intent-filter&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action android:name=&#34;android.intent.action.MAIN&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;category android:name=&#34;android.intent.category.LAUNCHER&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/intent-filter&gt;<br/>&lt;/activity&gt;</div></div><br/>接着尝试在代码中去除标题栏，也是一打开就出错：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code89393);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code89393>getWindow().requestFeature(Window.FEATURE_NO_TITLE);</div></div><br/>最后发现原因是我的Activity继承自AppCompatActivity，改成Activity再用上边任一种方法都可去除应用标题栏：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code70830);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code70830>public class MainActivity extends Activity</div></div><br/>其实在创建Activity时可以选择的，只是没留意：<br/><br/><img width="600" height="540" src="http://www.mzwu.com/pic/201610/048.jpg" border="0" alt=""/><br/><br/><img width="600" height="490" src="http://www.mzwu.com/pic/201610/049.jpg" border="0" alt=""/><br/><br/><strong>资料参考</strong><br/><br/>[1].android应用中去掉标题栏的方法：<a href="http://blog.csdn.net/liuzhidong123/article/details/7818531" target="_blank" rel="external">http://blog.csdn.net/liuzhidong123/article/details/7818531</a><br/>[2].解决安卓添加Theme.NoTitleBar报错问题：<a href="http://blog.csdn.net/gs12software/article/details/44570399" target="_blank" rel="external">http://blog.csdn.net/gs12software/article/details/44570399</a><br/>[3].解决无法在theme中设置NoTitleBar属性的问题：<a href="http://blog.csdn.net/helene1996/article/details/52643557" target="_blank" rel="external">http://blog.csdn.net/helene1996/article/details/52643557</a>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4281</link>
			<title><![CDATA[Android使用MediaPlayer播放mp3音乐示例]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Fri,14 Oct 2016 21:15:33 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4281</guid>
		<description><![CDATA[<div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code99960);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code99960>package com.mzwu.www;<br/><br/>import android.content.res.AssetFileDescriptor;<br/>import android.media.MediaPlayer;<br/>import android.support.v7.app.AppCompatActivity;<br/>import android.os.Bundle;<br/>import android.view.View;<br/>import android.widget.Button;<br/>import android.view.View.OnClickListener;<br/>import android.widget.EditText;<br/>import android.widget.Toast;<br/>import java.io.IOException;<br/><br/>public class MainActivity extends AppCompatActivity {<br/>&nbsp;&nbsp;&nbsp;&nbsp;//播放器<br/>&nbsp;&nbsp;&nbsp;&nbsp;private MediaPlayer mp = new MediaPlayer();<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;@Override<br/>&nbsp;&nbsp;&nbsp;&nbsp;protected void onCr&#101;ate(Bundle savedInstanceState) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.onCr&#101;ate(savedInstanceState);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//开始播放<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Button btnPlay = (Button)findViewById(R.id.button);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;btnPlay.setOnClickListener(new OnClickListener(){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public void onClick(View v) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String soundfile = ((EditText)findViewById(R.id.editText)).getText().toString();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.reset();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(soundfile.startsWith(&#34;http:&#34;)){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setDataSource(soundfile);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AssetFileDescriptor fileDescriptor = MainActivity.this.getAssets().openFd(soundfile);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setDataSource(fileDescriptor.getFileDescriptor(),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getStartOffset(),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getLength());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.close();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.prepare();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.start();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} catch (IllegalArgumentException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} catch (IllegalStateException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} catch (IOException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//播放结束<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public void onCompletion(MediaPlayer mp) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Toast.makeText(MainActivity.this, &#34;播放结束！&#34;, Toast.LENGTH_SHORT).show();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//释放播放器占用的资源<br/>&nbsp;&nbsp;&nbsp;&nbsp;@Override<br/>&nbsp;&nbsp;&nbsp;&nbsp;protected void onDestroy() {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(mp != null)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.release();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.onDestroy();<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}</div></div><br/><br/><strong>参考资料</strong><br/><br/>[1].深入Android MediaPlayer的使用方法详解：<a href="http://www.jb51.net/article/38722.htm" target="_blank" rel="external">http://www.jb51.net/article/38722.htm</a><br/>[2].Android MediaPlayer基本使用方式：<a href="http://blog.csdn.net/ddna/article/details/5176233" target="_blank" rel="external">http://blog.csdn.net/ddna/article/details/5176233</a><br/>[3].MediaPlayer实现列表选歌：<a href="http://www.cnblogs.com/snake-hand/archive/2013/02/22/2922923.html" target="_blank" rel="external">http://www.cnblogs.com/snake-hand/archive/2013/02/22/2922923.html</a><br/>[4].创建OnClickListener方法报错的解决办法：<a href="http://blog.csdn.net/wpyily/article/details/46503709" target="_blank" rel="external">http://blog.csdn.net/wpyily/article/details/46503709</a>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4279</link>
			<title><![CDATA[Playing Audio on Android from an HTML5 File[转]]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Fri,14 Oct 2016 10:09:34 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4279</guid>
		<description><![CDATA[<strong>Introduction</strong><br/><br/>Earlier today, I came across a problem. I have been working on an App in Android that displays HTML5 files from the assets folder inside a WebView. One of the big problems with playing Audio in an HTML5 page is that a lot of browsers do not support the &lt;audio&gt; tag; this includes several versions of the WebView control in different versions of Android. The bottom line is that you can&#39;t expect standardized results across different versions of Android when using the HTML5 &lt;audio&gt; tag. So we&#39;re going to use a workaround that uses the native Android method of playing audio.<br/><br/>Here is a synopsis of the paragraphs below that describe how to implement the code.<br/><br/>·Configuring your WebView control<br/>·Creating an Audio Interface for the HTML5 web page<br/>·Attaching the Audio Interface to the WebView control<br/>·Invoking an Audio Interface function from the HTML5 page using Javascri&#112;t<br/><br/><strong>Implementing the Code</strong><br/><br/><span style="color:Brown">Configuring your WebView control</span><br/><br/>Cr&#101;ate a WebView control inside your layout. This is the XML code for the layout I used:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code86011);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code86011>&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;<br/>&lt;WebView&nbsp;&nbsp;xmlns:android=&#34;<a href="http://schemas.android.com/apk/res/android" target="_blank" rel="external">http://schemas.android.com/apk/res/android</a>&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;android:id=&#34;@+id/webview&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;android:layout_width=&#34;fill_parent&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;android:layout_height=&#34;fill_parent&#34; /&gt;</div></div><br/>This is the Java that I used to initially configure the WebView:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code5901);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code5901> //Configures the WebView during the onCr&#101;ate method<br/>@Override<br/>protected void onCr&#101;ate(Bundle savedInstanceState) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;super.onCr&#101;ate(savedInstanceState);<br/>&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;WebView myWebView = (WebView) findViewById(R.id.webview);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//Set it to a webChromeClient<br/>&nbsp;&nbsp;&nbsp;&nbsp;myWebView.setWebChromeClient(new WebChromeClient());<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//the default for WebView is that Javascri&#112;t isn&#39;t enabled in WebView<br/>&nbsp;&nbsp;&nbsp;&nbsp;myWebView.getSettings().setJavascri&#112;tEnabled(true);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//the index.html file is placed in the assets folder<br/>&nbsp;&nbsp;&nbsp;&nbsp;myWebView.loadUrl(&#34;file:///android_asset/index.html&#34;);<br/>}</div></div><br/><span style="color:Brown">Creating an Audio Interface for the HTML5 web page</span><br/><br/>Next, we&#39;re going to cr&#101;ate an AudioInterface Java class to play audio MP3s from the assets folder.<br/><br/>Cr&#101;ate a new Java Class and call it &#34;AudioInterface.Java&#34;<br/><br/>Here is the Java code for the class:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code72789);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code72789>import java.io.IOException;<br/>import android.content.Context;<br/>import android.content.res.AssetFileDescriptor;<br/>import android.media.MediaPlayer;<br/>import android.webkit.Javascri&#112;tInterface;<br/><br/>public class AudioInterface {<br/>&#160;&#160;&#160;&#160;Context mContext;<br/><br/>&#160;&#160;&#160;&#160;AudioInterface(Context c) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mContext = c;<br/>&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;//Play an audio file from the webpage<br/>&#160;&#160;&#160;&#160;@Javascri&#112;tInterface<br/>&#160;&#160;&#160;&#160;public void playAudio(String aud) { //String aud - file name passed <br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//from the Javascri&#112;t function<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;final MediaPlayer mp;<br/><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;try {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;AssetFileDescriptor fileDescriptor = <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mContext.getAssets().openFd(aud);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp = new MediaPlayer();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setDataSource(fileDescriptor.getFileDescriptor(), <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getStartOffset(), <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getLength());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.close();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.prepare();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.start();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&nbsp;&nbsp;} catch (IllegalArgumentException e) {<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;} catch (IllegalStateException e) {<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#160;&#160;&#160;&#160;&nbsp;&nbsp;} catch (IOException e) {<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// TODO Auto-generated catch block<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&#160;&#160;&#160;&#160;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br/>&#160;&#160;&#160;&#160;}<br/>}</div></div><br/>The above code cr&#101;ates a public method that accepts a string argument which is used as the URL for the mp3 file location. So I store my mp3 files in a sub folder in the assets folder called audio. So the playAudio method needs an argument similar to this: &#34;audio/example.mp3&#34;. If it was stored directly in the assets folder it would look like this: &#34;example.mp3&#34;.<br/><br/><span style="color:Brown">Attaching the Audio Interface to the WebView control</span><br/><br/>Now, we need to attach the AudioInterface class to the WebView control in the onCr&#101;ate method in o&#114;der to make it available for the Javascri&#112;t code. So add the following code to the onCr&#101;ate method we edited earlier in the layout&#39;s Java file:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code72126);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code72126>myWebView.addJavascri&#112;tInterface(new AudioInterface(this), &#34;AndAud&#34;);</div></div> <br/><span style="color:Brown">Invoking an Audio Interface function from the HTML5 page using Javascri&#112;t</span><br/><br/>Now we can call the playAudio function from Javascri&#112;t inside the HTML5 file by using this method:<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code47558);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code47558>&lt;script type=&#34;text/javascri&#112;t&#34;&gt;<br/>&#160;&#160;&#160;&#160;//AndAud is the alias of the AudioInterface class that we attached to the WebView<br/>&#160;&#160;&#160;&#160;AndAud.playAudio(&#34;audio/One.mp3&#34;);<br/>&lt;/script&gt; </div></div><br/>And that&#39;s it, it&#39;s kind of an annoying work around but at least you know it will work rather than waiting on the &lt;audio&gt; kinks to be worked out.<br/><br/><strong>dnawo补充：</strong><br/><br/>若想让playAudio方法也能播放网络音频，只需稍做修改即可：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code21260);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code21260>@Javascri&#112;tInterface<br/>public void playAudio(String aud) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;final MediaPlayer mp;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;try {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp = new MediaPlayer();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(aud.startsWith(&#34;<a href="http://" target="_blank" rel="external">http://</a>&#34;)){<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setDataSource(aud);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AssetFileDescriptor fileDescriptor = mContext.getAssets().openFd(aud);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.setDataSource(fileDescriptor.getFileDescriptor(),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getStartOffset(),<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.getLength());<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fileDescriptor.close();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.prepare();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mp.start();<br/>&nbsp;&nbsp;&nbsp;&nbsp;} catch (IllegalArgumentException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;} catch (IllegalStateException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;} catch (IOException e) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}</div></div><br/><strong>资源链接</strong><br/><br/>[1].原文链接：<a target="_blank" href="http://www.codeproject.com/Tips/677841/Playing-Audio-on-Android-from-an-HTML-File" rel="external">http://www.codeproject.com/Tips/677841/Playing-Audio-on-Android-from-an-HTML-File</a><br/>[2].Playing local audio file in Android webview app：<a target="_blank" href="http://stackoverflow.com/questions/9201893/playing-local-audio-file-in-android-webview-app" rel="external">http://stackoverflow.com/questions/9201893/playing-local-audio-file-in-android-webview-app</a><br/>[3].android webview加载html5 audio标签 路径问题：<a target="_blank" href="http://zhidao.baidu.com/question/589462287" rel="external">http://zhidao.baidu.com/question/589462287</a>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4277</link>
			<title><![CDATA[Androrid控件WebView使用示例]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Thu,13 Oct 2016 22:52:08 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4277</guid>
		<description><![CDATA[<img src="http://www.mzwu.com/pic/201610/040.jpg" border="0" alt=""/><br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code20482);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code20482>protected void onCr&#101;ate(Bundle savedInstanceState) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;super.onCr&#101;ate(savedInstanceState);<br/>&nbsp;&nbsp;&nbsp;&nbsp;//setContentView(R.layout.activity_main);<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//WebView控件<br/>&nbsp;&nbsp;&nbsp;&nbsp;WebView webView = new WebView(this);<br/>&nbsp;&nbsp;&nbsp;&nbsp;webView.getSettings().setJavascri&#112;tEnabled(true);<br/>&nbsp;&nbsp;&nbsp;&nbsp;webView.loadUrl(&#34;<a href="http://www.mzwu.com/" target="_blank" rel="external">http://www.mzwu.com/</a>&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;//webView.loadUrl(&#34;file:///android_asset/Index.html&#34;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;setContentView(webView);<br/>&nbsp;&nbsp;&nbsp;&nbsp;//禁止WebView调用系统浏览器或第三方浏览器<br/>&nbsp;&nbsp;&nbsp;&nbsp;webView.setWebViewClient(new WebViewClient() {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public boolean shouldOverrideUrlLoading(WebView view, String url)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;view.loadUrl(url);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;});<br/>}</div></div><br/>记得在AndroidManifest.xml设置访问网络权限：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code63467);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code63467>&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;<br/>&lt;manifest xmlns:android=&#34;<a href="http://schemas.android.com/apk/res/android" target="_blank" rel="external">http://schemas.android.com/apk/res/android</a>&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;package=&#34;com.mzwu.www&#34;&gt;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;application<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:allowBackup=&#34;true&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:icon=&#34;@mipmap/ic_launcher&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:label=&#34;@string/app_name&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:supportsRtl=&#34;true&#34;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;android:theme=&#34;@style/AppTheme&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;activity android:name=&#34;.MainActivity&#34;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;intent-filter&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action android:name=&#34;android.intent.action.MAIN&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;category android:name=&#34;android.intent.category.LAUNCHER&#34; /&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/intent-filter&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/activity&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/application&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:Red">&lt;uses-permission android:name=&#34;android.permission.INTERNET&#34;/&gt;</span><br/>&lt;/manifest&gt;</div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4276</link>
			<title><![CDATA[手机移动端不能触发jQuery双击事件dblclick解决方法]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Thu,13 Oct 2016 20:18:05 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4276</guid>
		<description><![CDATA[今天意外发现移动手机端不能触发jQuery的dblclick事件，做了个简单的页面重现问题：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code87629);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code87629>&lt;input name=&#34;btn1&#34; id=&#34;btn1&#34; type=&#34;button&#34; value=&#34;随便点&#34;&gt;<br/>&lt;script type=&#34;text/javascri&#112;t&#34;&gt;<br/>$(document).ready(function(){<br/>&#160;&#160;&#160;&#160;$(&#34;#btn1&#34;).on(&#34;click&#34;, function(){console.log(&#34;click&#34;)});<br/>&#160;&#160;&#160;&#160;$(&#34;#btn1&#34;).on(&#34;dblclick&#34;, function(){console.log(&#34;dblclick&#34;)});<br/>});<br/>&lt;/script&gt;</div></div><br/><img src="http://www.mzwu.com/pic/201610/038.jpg" border="0" alt=""/><br/><br/>如上图所示，手机端只触发了两次click事件，没有触发dblclick事件。既然click事件都能正常触发，那么我们应该可以通过判断两次单击间隔时间来模拟dblclick双击事件，修改脚本如下：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code15142);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code15142>&lt;input name=&#34;btn1&#34; id=&#34;btn1&#34; type=&#34;button&#34; value=&#34;随便点&#34;&gt;<br/>&lt;script type=&#34;text/javascri&#112;t&#34;&gt;<br/>$(document).ready(function(){<br/>&#160;&#160;&#160;&#160;var touchtime = new Date().getTime();<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;$(&#34;#btn1&#34;).on(&#34;click&#34;, function(){<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if((new Date()).getTime() - touchtime &lt; 300 ){<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;console.log(&#34;dblclick&#34;);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}else{<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;touchtime = new Date().getTime();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;console.log(&#34;click&#34;)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br/>&#160;&#160;&#160;&#160;});<br/>});<br/>&lt;/script&gt;</div></div><br/><img src="http://www.mzwu.com/pic/201610/039.jpg" border="0" alt=""/><br/><br/>OK，问题解决！]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=4275</link>
			<title><![CDATA[Android连续按两次返回键退出应用示例]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Thu,13 Oct 2016 13:55:38 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=4275</guid>
		<description><![CDATA[<img src="http://www.mzwu.com/pic/201610/037.jpg" border="0" alt=""/><br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code38836);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code38836>import android.support.v7.app.AppCompatActivity;<br/>import android.os.Bundle;<br/>import android.view.KeyEvent;<br/>import android.widget.Toast;<br/><br/>public class MainActivity extends AppCompatActivity {<br/>&nbsp;&nbsp;&nbsp;&nbsp;//记录第一次按返回键的时间<br/>&nbsp;&nbsp;&nbsp;&nbsp;private long mExitTime = 0;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;@Override<br/>&nbsp;&nbsp;&nbsp;&nbsp;protected void onCr&#101;ate(Bundle savedInstanceState) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super.onCr&#101;ate(savedInstanceState);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setContentView(R.layout.activity_main);<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;//5秒内按两次返回键退出应用<br/>&nbsp;&nbsp;&nbsp;&nbsp;public boolean onKeyDown(int keyCode, KeyEvent event) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (keyCode == KeyEvent.KEYCODE_BACK) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ((System.currentTimeMillis() - mExitTime) &gt; 5000) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Toast.makeText(this, &#34;再按一次退出应用&#34;, Toast.LENGTH_SHORT).show();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mExitTime = System.currentTimeMillis();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finish();<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return super.onKeyDown(keyCode, event);<br/>&nbsp;&nbsp;&nbsp;&nbsp;}<br/>}</div></div><br/>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=3991</link>
			<title><![CDATA[启动Android Studio一直停在fetching Android sdk compoment解决方法]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Fri,16 Jan 2015 15:46:38 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=3991</guid>
		<description><![CDATA[<img src="http://www.mzwu.com/pic/201501/070.jpg" border="0" alt=""/><br/><br/>进入Android Studio安装文件夹，打开bin/idea.properties文件，在末尾添加下边内容即可解决：<br/><br/><div class="UBBPanel codePanel"><div class="UBBTitle"><a onClick="copycode(code72353);" style="float:right;cursor: pointer;font-weight: normal; font-style: normal">复制内容到剪贴板</a><img src="http://www.mzwu.com/images/code.gif" style="margin:0px 2px -3px 0px;" alt="程序代码"/> 程序代码</div><div class="UBBContent" id=code72353>disable.android.first.run=true</div></div>]]></description>
		</item>
		
			<item>
			<link>http://www.mzwu.com/article.asp?id=3809</link>
			<title><![CDATA[怎么查看安卓手机WiFi密码]]></title>
			<author>service@mzwu.com(dnawo)</author>
			<category><![CDATA[Android编程]]></category>
			<pubDate>Mon,16 Jun 2014 01:41:33 +0800</pubDate>
			<guid>http://www.mzwu.com/default.asp?id=3809</guid>
		<description><![CDATA[安卓手机WiFi密码以明文形式保存在/data/misc/wifi/wpa_supplicant.conf文件中，安装Root Explorer、ES文件浏览器等应用赋于root权限打开该文件即可查看WiFi密码：<br/><br/><img src="http://www.mzwu.com/pic/201406/020.jpg" border="0" alt=""/>]]></description>
		</item>
		
</channel>
</rss>
