﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Cpper-随笔分类-Java Antroid</title><link>http://www.cppblog.com/gaimor/category/16666.html</link><description>业余CPP专家</description><language>zh-cn</language><lastBuildDate>Wed, 30 Oct 2013 14:34:08 GMT</lastBuildDate><pubDate>Wed, 30 Oct 2013 14:34:08 GMT</pubDate><ttl>60</ttl><item><title>Android Animation和Visible的问题</title><link>http://www.cppblog.com/gaimor/archive/2013/10/30/204006.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Wed, 30 Oct 2013 14:26:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2013/10/30/204006.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/204006.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2013/10/30/204006.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/204006.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/204006.html</trackback:ping><description><![CDATA[发现一个问题imageView.startAnimation启动控件动画以后<br />由于一些原因需要设置控件为GONE状态，也就是imageView.s<em>etVisibility</em>(View.GONE);<br />之后发现控件处于GONE状态，但是控件还是可见的<br />上网查了下发现要清空动画，也就是imageView.clearAnimation<br /><br />其实我觉得如果调用setVisibility(View.GONE)之后无论当前有无动画都应该消失<br />设置为GONE状态后控件状态出现异常<br /><br />按照当前情况要隐藏控件需要先调用cleanAnimation,之后call setVisibility<br />所以有空想想android API也并非十全十美.<br />各位觉得呢？<img src ="http://www.cppblog.com/gaimor/aggbug/204006.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2013-10-30 22:26 <a href="http://www.cppblog.com/gaimor/archive/2013/10/30/204006.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse下编译Adnroid应用</title><link>http://www.cppblog.com/gaimor/archive/2011/12/06/161613.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 06 Dec 2011 13:36:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/12/06/161613.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/161613.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/12/06/161613.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/161613.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/161613.html</trackback:ping><description><![CDATA[现在Android很热，很多人都是在linux下编译Android程序的，但是知道能在Eclipse下开发Android应用的人不多。<br />我说下如何在Eclipse下编译Android应用<br />1.首先在Linux下编译好Android大版本<br />2.进入out/../target/common/obj/java_imminatelibraried目录，找出如下三个文件夹(core_immiaterlibraeted,framework_immiatelibraied,ext_immiatelibrary)下的classed.jar文件.<br />重新命名为core.jar,framwork.jar,ext.jar<br />然后复制到开发机器上<br />3.新建Android工程，移除原有的Android包，导入必要的java包,新建jar库,导入这3个jar包即可使用<br />本方法都大部分应用有效<br /><img src ="http://www.cppblog.com/gaimor/aggbug/161613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-12-06 21:36 <a href="http://www.cppblog.com/gaimor/archive/2011/12/06/161613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android ListActivity点击事件 (Android笔记)</title><link>http://www.cppblog.com/gaimor/archive/2011/05/30/147718.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Mon, 30 May 2011 14:23:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/05/30/147718.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/147718.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/05/30/147718.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/147718.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/147718.html</trackback:ping><description><![CDATA[<div>Android中的ListActivity涉及2类点击事件<br />1个是短按点击<br />1个是长按点击<br /><br />对于短按点击<br />只需要重载下面的函数即可
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;onListItemClick(ListView&nbsp;arg0,&nbsp;View&nbsp;arg1,&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;pos,&nbsp;</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;id)</span></div><br />对于长按<br />则需要继承接口OnItemLongClickListener并实现
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;getListView().setOnItemLongClickListener(</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;OnItemLongCLickListener(){&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">boolean</span><span style="color: #000000">&nbsp;onItemLongClick(AdapterView&nbsp;parent,&nbsp;View&nbsp;view,&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;position,&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">long</span><span style="color: #000000">&nbsp;id)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.cppblog.com/Images/dot.gif"  alt="" />&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">true</span><span style="color: #000000">;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp;&nbsp;</span></div>其方法即可<br /><br /></div><img src ="http://www.cppblog.com/gaimor/aggbug/147718.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-05-30 22:23 <a href="http://www.cppblog.com/gaimor/archive/2011/05/30/147718.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android调试桥的简单使用</title><link>http://www.cppblog.com/gaimor/archive/2011/05/06/145857.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Fri, 06 May 2011 14:54:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/05/06/145857.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/145857.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/05/06/145857.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/145857.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/145857.html</trackback:ping><description><![CDATA[本文给出当前我使用过的Android 调试桥方法<br>要使用调试桥首先需要 切换目录到Android SDK下的tools目录或者设置下路径<br>常见的使用方法如下:<br>1.把本地apk文件推入真机<br>adb push name.apk system/app<br>2.卸载真机apk程序<br>adb uninstall packagename<br>比如<br>adb uninstall cm.android.game<br>3.如果adb push 失败<br>则需要执行<br>adb remount<br>4.如果执行<br>adb uninstall .<br>失败<br>则可以尝试<br>adb shell<br>切换到app目录 cd system/app<br>执行ls查看当前所有应用列表<br>然后使用rm 名字移除apk包<br>比如rm game.apk<br>不过这样做有一个坏处就是<br>只是简单删除了应用程序并没有删除程序数据<br>
<img src ="http://www.cppblog.com/gaimor/aggbug/145857.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-05-06 22:54 <a href="http://www.cppblog.com/gaimor/archive/2011/05/06/145857.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>搭建Android开发环境</title><link>http://www.cppblog.com/gaimor/archive/2011/05/06/145849.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Fri, 06 May 2011 14:06:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/05/06/145849.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/145849.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/05/06/145849.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/145849.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/145849.html</trackback:ping><description><![CDATA[<p>&nbsp;今天晚上试着在个人电脑上搭建了Android就说说具体的步骤吧<br>1.首先下载eclipse包。地址:http://download.actuatechina.com/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-java-helios-SR2-win32.zip<br>2.解压,点击eclipse.exe 出现错误提示没有安装java包<br>3.下载java包。地址:http://download.oracle.com/otn-pub/java/jdk/6u25-b06/jdk-6u25-windows-i586.exe<br>4.点击安装。完成后启动eclipse<br>5.点击菜单Help-&gt;install new software 增加新的repository,名字随便起个<br>地址为:https://dl-ssl.google.com/android/eclipse/<br>安装ADT<br>6.安装完成后restart eclipse会发现window菜单多了一栏:Android SDK and AVD Manager<br>7.下载 Android sdk 地址为:http://dl.google.com/android/android-sdk_r08-windows.zip<br>8.解压，点击其中的SDK Manager.exe 下载其他关键包<br>9.点击eclipse window perfercences 中的android设置android sdk路径<br>成功后下面的列表框会出现安装信息比如:Target name,Vendor 和 Paltform API<br>10.点击Apply<br>11.最后还需要设置模拟器 具体为打开Android SDK and AVD Manager 点击左侧的Virtual Devices<br>然后点击右侧的New按键&nbsp; 按照要求填入信息即可<br>12.现在就可以编写Android程序并在模拟器上跑了<br>不过模拟器启动很慢 一般都是在真机上做测试<br></p>
<img src ="http://www.cppblog.com/gaimor/aggbug/145849.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-05-06 22:06 <a href="http://www.cppblog.com/gaimor/archive/2011/05/06/145849.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>设计模式-工厂方法</title><link>http://www.cppblog.com/gaimor/archive/2011/05/05/145775.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Thu, 05 May 2011 14:27:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/05/05/145775.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/145775.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/05/05/145775.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/145775.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/145775.html</trackback:ping><description><![CDATA[接上文:设计模式<a href="http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html">-简单工厂 http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html</a> <br>简单工厂是根据传入要求决定生产那类产品,其工厂只有一个<br>在简单工厂基础之上,如果一个工厂对应一个产品则形成了工厂方法<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">interface</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call();<br>};<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Product1&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call()<br>&nbsp;&nbsp;&nbsp;&nbsp;{}<br>};<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Product2&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call()<br>&nbsp;&nbsp;&nbsp;&nbsp;{}<br>};<br><br></span><span style="COLOR: #0000ff">interface</span><span style="COLOR: #000000">&nbsp;ProductFactory<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Product&nbsp;GetProduct();<br>};<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;ProductFactory1&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;ProductFactory<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Product&nbsp;GetProduct()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Product1();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;ProductFactory2&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;ProductFactory<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Product&nbsp;GetProduct()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;Product2();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br>这样使用<br>ProductFactory&nbsp;factory1&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;ProductFactory1();<br><br>Product&nbsp;p1&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;factory1.GetProduct();<br>ProductFactory&nbsp;factory2&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;ProductFactory2();<br><br>Product&nbsp;p2&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;factory2.GetProduct();</span></div>
<br><br>可以看出工厂方法中工厂和产品总是一一对应的<br>一个工厂只能生产一个产品<br>很显然工厂方法最大的弊端就在这里.<br><br>使用的场合:<span style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: " ar-sa?="" mso-bidi-language:="" zh-cn;="" mso-fareast-language:="" en-us;="" mso-ansi-language:="" mso-bidi-font-family:="" 1.0pt;="" mso-font-kerning:="" 12.0pt;="" mso-bidi-font-size:="" ?times="" mso-hansi-font-family:="" roman?;="" new="" times=""><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: " ?times="" mso-hansi-font-family:="" roman?;="" new="" times="" roman??=""><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: " ?times="" mso-hansi-font-family:="" roman?;="" new="" times="" roman??="">一个对象希望由子对象来指定它所创建的对象时,可以使用工厂方法</span></span></span></span><br><br>PS:系统那个总结下设计模式
<img src ="http://www.cppblog.com/gaimor/aggbug/145775.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-05-05 22:27 <a href="http://www.cppblog.com/gaimor/archive/2011/05/05/145775.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>设计模型系列-简单工厂</title><link>http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Mon, 02 May 2011 08:57:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/145498.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/145498.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/145498.html</trackback:ping><description><![CDATA[这段时间在学习Android，也要学点jav方面的编程知识<br>乘着这个机会，俺就总结下学过和使用过的设计模式，并使用java写下<br><br>先说简单工厂<br>简单工厂属于工厂模式的一种，不过似乎不在GOF模式之列.<br>一句话描述:简单工厂就是根据给定要求生成给定对象<br>简单的java版本代码如下:<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">interface</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call();<br>};<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Pen&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>};<br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Book&nbsp;</span><span style="COLOR: #0000ff">implements</span><span style="COLOR: #000000">&nbsp;Product<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Call()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>};<br><br><br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;clas&nbsp;Factory<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Product&nbsp;CreateProducrt(String&nbsp;name)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(name.equals(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Pen</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Pen.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">.newInstance();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(name.equals(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Book</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Book.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">.newInstance();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>};<br><br><br><br></span></div>
<br>简单工厂就是根据输入标签返回给定的对象实例<br><br>很显然，简单工厂的主要缺陷就在于:如果需要增加一个新的产品那就需要修改其产品生成函数<br><br>另外，如果把工厂和产品对象合二为一就变成了如下的形式:<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Object<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;ObjectCreateObject(String&nbsp;name);<br>&nbsp;&nbsp;&nbsp;&nbsp;other&nbsp;function.&nbsp;<br>};</span></div>
这类似于MFC中CObject<br><br>简单工厂的一个使用例子如下(之前我写的GUI):<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;WidgetFactory<br>{<br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br>&nbsp;&nbsp;&nbsp;&nbsp;Widget</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;CreateWidgetByName(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;std::</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">&nbsp;name);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>};</span></div>
在这里如果传入Spin则返回一个new Spin,传入一个Slider则返回一个new Slider对象<br>如果我增加一个新的Widget对象，则需要把CreateWidgetByName函数修改下(当然可以使用Object::CreateObject(name)函数,只是返回的对象需要做类型转换,原则一致)<br><br>下篇说说抽象工厂和工厂方法吧
<img src ="http://www.cppblog.com/gaimor/aggbug/145498.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-05-02 16:57 <a href="http://www.cppblog.com/gaimor/archive/2011/05/02/145498.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>初识Android</title><link>http://www.cppblog.com/gaimor/archive/2011/04/30/145420.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Sat, 30 Apr 2011 15:00:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/04/30/145420.html</guid><description><![CDATA[<p>之前在博客园见到过别人发的关于Android的帖子，当时只记得是关于手机开发的。<br>没想到现在洒家也要学这个了。<br></p>
不过还好经过1周多的学习，感觉Android还是很简单的。<br><br>Android的基本概念<br>1.Activity<br>2,Intent<br>3.Content Privoder<br>4.BroadCast Revicer.<br>5..<br>
<img src ="http://www.cppblog.com/gaimor/aggbug/145420.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-04-30 23:00 <a href="http://www.cppblog.com/gaimor/archive/2011/04/30/145420.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>音效编程二:Tremolo音效</title><link>http://www.cppblog.com/gaimor/archive/2011/04/26/145089.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Tue, 26 Apr 2011 14:42:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/04/26/145089.html</guid><wfw:comment>http://www.cppblog.com/gaimor/comments/145089.html</wfw:comment><comments>http://www.cppblog.com/gaimor/archive/2011/04/26/145089.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/gaimor/comments/commentRss/145089.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/gaimor/services/trackbacks/145089.html</trackback:ping><description><![CDATA[接上文.<br>Tremolo音效比较酷的音效，听上去感觉是使用电子乐器演示的。<br>从感官上将Tremolo(颤音)音效是重击一个音符然后快速提高，减小音量<br><br>下面是颤音音效的几个参数:<br>1.深度控制:用来控制音量增减速度<br>2.阈值数据:说明控制音量的频率值<br>3.波形<br><br>其基本数学表达式为:<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">data&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;data&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #000000">1.0</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;depth&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;sin(k</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;rate&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;index));</span></div>
<br>简易的c++代码如下:<br><br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Tremolo&nbsp;:&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;AudioEffect<br>{<br></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;def_depth;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;def_rate;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;depth;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;rate;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;k;<br>&nbsp;&nbsp;&nbsp;&nbsp;Tremole();<br>&nbsp;&nbsp;&nbsp;&nbsp;std::vector</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&nbsp;Filter(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;std::vector</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #0000ff">float</span><span style="COLOR: #000000">&gt;&amp;</span><span style="COLOR: #000000">&nbsp;_data)<br>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;_data;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;data.size();i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data[i]&nbsp;</span><span style="COLOR: #000000">*=</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #000000">1.0</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;depth&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;sin(</span><span style="COLOR: #000000">2.0</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;PI&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;rate&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">&nbsp;k);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;data;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<br>};</span></div>
当然有java版本的化应该是如下这个样子:<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Tremolo&nbsp;</span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">&nbsp;AudioEffect<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000">&nbsp;def_depth&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000">&nbsp;def_rate&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;depth&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;def_depth;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">&nbsp;rate&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;def_rate;<br>&nbsp;&nbsp;&nbsp;&nbsp;Tremolo()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.cppblog.com/Images/dot.gif"><br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">[]&nbsp;Filter(</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">[]&nbsp;_data)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;len&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;_data.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">[]&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">double</span><span style="COLOR: #000000">[len];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">len;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret[i]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;_data[i]</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">depth</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">Math.Sin(</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">Math.PI</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">rate</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">i</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">k));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ret;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
基本的源码就这个样子<br>不过有一个问题就是播放音效有少许杂音-不过不是大问题
<img src ="http://www.cppblog.com/gaimor/aggbug/145089.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-04-26 22:42 <a href="http://www.cppblog.com/gaimor/archive/2011/04/26/145089.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android音频播放器</title><link>http://www.cppblog.com/gaimor/archive/2011/04/22/144799.html</link><dc:creator>ccsdu2009</dc:creator><author>ccsdu2009</author><pubDate>Fri, 22 Apr 2011 13:02:00 GMT</pubDate><guid>http://www.cppblog.com/gaimor/archive/2011/04/22/144799.html</guid><description><![CDATA[包<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;android.media.AudioManager;</span></div>
获取<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">AudioManager&nbsp;audiomanage&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(AudioManager)&nbsp;context.getSystemService(Context.AUDIO_SERVICE);</span></div>
音量增大和减小(一个单位)<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; HEIGHT: 37px; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">audiomanager.adjustVolum(AudioManager.ADJUST_LOWER,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br>audiomanager.adjustVolum(AudioManager.ADJUST_RAISE,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><br><br><br></span></div>
<img src ="http://www.cppblog.com/gaimor/aggbug/144799.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/gaimor/" target="_blank">ccsdu2009</a> 2011-04-22 21:02 <a href="http://www.cppblog.com/gaimor/archive/2011/04/22/144799.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>