摘要: android:layout_gravity="top"。android:layout_gravity="bottom" 阅读全文
posted @ 2011-09-23 15:57 镇水古月 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_54100_5221[代码]main.xmlview sourceprint?01<?xmlversion="1.0"encoding="utf-8"?>02<LinearLayoutxmlns:Android="http://schemas.android.com/apk/res/android"03Android:orientation="vertical"04Android:layout_width="f 阅读全文
posted @ 2011-09-23 15:45 镇水古月 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_54100_5507//获取本地ip地址4748publicString getLocalIpAddress() {49try{50Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();51while(en.hasMoreElements()) {52NetworkInterface intf = en.nextElement();53Enumeration<InetAddress> enumIpA 阅读全文
posted @ 2011-09-23 15:22 镇水古月 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 引用:01//安装apk文件0203privatevoidinstallAPK(File file) {04Intent intent =newIntent(Intent.ACTION_VIEW);05Uri data = Uri.fromFile(file);06String type ="application/vnd.android.package-archive";07intent.setDataAndType(data, type);08startActivity(intent);09}10111213//卸载apk文件1415privatevoiduninsta 阅读全文
posted @ 2011-09-23 15:21 镇水古月 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.cnblogs.com/salam/archive/2011/04/04/2005329.htmlhttp://www.oschina.net/code/snippet_54100_5217 阅读全文
posted @ 2011-09-23 15:19 镇水古月 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_54100_1423SurfaceView 由于可以直接从内存或者DMA等硬件接口取得图像数据,因此是个非常重要的绘图容器,网上介绍 SurfaceView的用法有很多,写法也层出不同,例如继承SurfaceView类,或者继承SurfaceHolder.Callback类等,这个可以根据功能实际需要自己选择,我这里就直接在普通的用户界面调用SurfaceHolder的lockCanvas和 unlockCanvasAndPost。对比下面的第二、三两图,三图用.lockCanvas(null),而二图用.lockC 阅读全文
posted @ 2011-09-23 15:18 镇水古月 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_163910_6086[代码]AsyncImageLoader.java01packagecn.com.mzba.service;0203importjava.io.InputStream;04importjava.lang.ref.SoftReference;05importjava.net.URL;06importjava.util.HashMap;0708importandroid.graphics.drawable.Drawable;09importandroid.os.Handler;10importand 阅读全文
posted @ 2011-09-23 15:11 镇水古月 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_97818_4400[代码]java bean代码01publicclassBean{02privateString title;0304publicvoidsetTitle(String title){05this.title = title;06}0708publicString getTitle(){09returnthis.title;10}11}[代码]android端01packagecom.xu81.tw4a;0203importjava.util.List;0405importandroid.app. 阅读全文
posted @ 2011-09-23 14:57 镇水古月 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.jjos.org/android/2010/05/10/312_webkit-webkit-for-android.html一、WebKit简介WebKit是一个开源的浏览器网页排版引擎,包含WebCore排版引擎和JSCore引擎。WebCore和JSCore引擎来自于KDE项目的KHTML和KJS开源项目。Android平台的Web引擎框架采用了WebKit项目中的WebCore和JSCore部分,上层由Java语言封装,并且作为API提供给Android应用开发者,而底层使用WebKit核心库(WebCore和JSCore)进行网页排版。二、WebKit目录结 阅读全文
posted @ 2011-09-23 14:55 镇水古月 阅读(1232) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_163910_6094[代码]JavaScript判断方法view sourceprint?1if(navigator.userAgent.match(/Android/i)) {2// Do something!3// Redirect to Android-site?4window.location ='http://android.davidwalsh.name';5}[代码]PHP判断方法1if(strstr($_SERVER['HTTP_USER_AGENT'],'A 阅读全文
posted @ 2011-09-23 14:52 镇水古月 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_54100_6227[代码][Java]代码01//打开本包内asset目录下的index.html文件0203wView.loadUrl(" file:///android_asset/index.html ");0405//打开本地sd卡内的index.html文件0607wView.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");0809//打开指定URL的html文件1011wVie 阅读全文
posted @ 2011-09-23 14:44 镇水古月 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.oschina.net/code/snippet_163910_6189[代码][Java]代码01publicclassConnectionChangeReceiverextends02BroadcastReceiver03{04@Override05publicvoidonReceive( Context context, Intent intent )06{07ConnectivityManager connectivityManager =08(ConnectivityManager) context.getSystemService09( Context. 阅读全文
posted @ 2011-09-23 14:40 镇水古月 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 引用:http://hi.baidu.com/chatcoco/blog/item/ac6b2818f51868dea6866971.htmlwebView=(WebView)findViewById(R.id.browser);//其中r.id.browser 是 layout/xx.xml 中的 webviewwebView.getSettings().setJavaScriptEnabled(true);//支持jsWebSettingsws=webView.getSettings();ws.setUseWideViewPort(true);//让浏览器支持用户自定义viewwebVie 阅读全文
posted @ 2011-09-23 10:56 镇水古月 阅读(1051) 评论(0) 推荐(0) 编辑
摘要: 引用:android:launchMode="singleTask"和 onNewIntent(Intent intent)两个特性,现总结一下经验:android:launchMode="singleTask" 配置在 Mainifest 中,它保证了栈中此Activity总是只有一个,无论你启动它多少次;onNewIntent(Intent intent) 是Override Activity的父类方法,只有仅在点Home键退出Activity而再次启动新的Intent进来才被调用到;它们两结合使用,可以做到监听home键(仅当发起新的Intent) 阅读全文
posted @ 2011-09-22 23:50 镇水古月 阅读(1319) 评论(0) 推荐(0) 编辑
摘要: A:onPause -> B:onCreated -> B:onResume -> A:onStop.... 阅读全文
posted @ 2011-09-22 21:44 镇水古月 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 引用:http://0755-oopp.blog.163.com/blog/static/2673281201011632617841/div的visibility可以控制div的显示和隐藏,但是隐藏后页面显示空白style="visibility: none;"document.getElementById("typediv1").style.visibility="hidden";//隐藏document.getElementById("typediv1").style.visibility="vis 阅读全文
posted @ 2011-09-22 15:36 镇水古月 阅读(9893) 评论(0) 推荐(0) 编辑
摘要: //read.xml内容<?xml version="1.0" encoding="utf-8" ?><contents> <itemcount>18</itemcount> <item> <title>美女</title> <content /> <filetype>jpg,gif</filetype> <filecount>37</filecount> </item> </contents& 阅读全文
posted @ 2011-09-22 14:20 镇水古月 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 参考资料:http://www.w3school.com.cn/xmldom/dom_element.asp//read2.xm内容如下<?xml version="1.0" encoding="utf-8" ?><contents>123213<a>111</a></contents>//html内容如下:<html><head><script> var request_success = false; function OnLoad() { var req 阅读全文
posted @ 2011-09-22 11:03 镇水古月 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.cnblogs.com/whyoop/archive/2011/03/01/1968405.htmlW3CSchool的教程中提供过一个loadXMLDoc函数:function loadXMLDoc(url) { var xmlDoc; try{ xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } catch(e){ try{ xmlDoc=document.implementation.createDocument("","",null); ... 阅读全文
posted @ 2011-09-21 18:10 镇水古月 阅读(540) 评论(0) 推荐(0) 编辑
摘要: 一:读本地xml<script type="text/javascript"> var xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.load("../test5/xml/read1.xml"); var xsl = new ActiveXObject("Microsoft.XMLDOM"); xsl.async = false; xsl.load("../test5/xml/read1.xml" 阅读全文
posted @ 2011-09-21 13:18 镇水古月 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 引用:http://blog.csdn.net/wang_shaner/article/details/6293498(一)断点续传的原理 其实断点续传的原理很简单,就是在Http的请求上和一般的下载有所不同而已。打个比方,浏览器请求服务器上的一个文时,所发出的请求如下: 假设服务器域名为wwww.sjtu.edu.cn,文件名为down.zip。GET /down.zip HTTP/1.1Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/ms.. 阅读全文
posted @ 2011-09-20 11:07 镇水古月 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.cnblogs.com/sunjialiang/archive/2011/08/17/2142808.html访问登记属性android.permission.ACCESS_CHECKIN_PROPERTIES ,读取或写入登记check-in数据库属性表的权限获取错略位置android.permission.ACCESS_COARSE_LOCATION,通过WiFi或移动基站的方式获取用户错略的经纬度信息,定位精度大概误差在30~1500米获取精确位置android.permission.ACCESS_FINE_LOCATION,通过GPS芯片接收卫星的定位信息, 阅读全文
posted @ 2011-09-20 10:52 镇水古月 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 参考:http://zhidao.baidu.com/question/250649898.htmlWeb开发: 下面三点不好用,总是有版本对应问题,最后用了一个简单方法在线更新,就是下面的4 //1.Eclipse IDE for Java Developers ( helios)+wtp插件(http://www.eclipse.org/webtools/) //2.下集成插件版 //3.lomboz的网站下载一个它打包好的eclipse(http://forge.ow2.org/projects/lomboz) 4.Help菜单->Eclpise MarketPlace 能在线.. 阅读全文
posted @ 2011-09-20 10:37 镇水古月 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 软件: JDK: eclipse: Lomboz: http://lomboz.ow2.org/ Tomcat: http://tomcat.apache.org/download-60.cgi 阅读全文
posted @ 2011-09-19 17:16 镇水古月 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.pin5i.com/showtopic-android-asynctask-sample.htmlAsyncTask 看上去修改后的connect()方法已经可用了,但是这种匿名线程的方式是存在缺陷的:第一,线程的开销较大,如果每个任务都要创建一个线程,那么应用 程序的效率要低很多;第二,线程无法管理,匿名线程创建并启动后就不受程序的控制了,如果有很多个请求发送,那么就会启动非常多的线程,系统将不堪重负。 另外,前面已经看到,在新线程中更新UI还必须要引入handler,这让代码看上去非常臃肿。 为了解决这一问题,OPhone在1.5版本引入了Async... 阅读全文
posted @ 2011-09-19 15:43 镇水古月 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 详细介绍:http://wenku.baidu.com/view/fcf6d3f47c1cfad6195fa724.html?from=rec&pos=0&weight=14&lastweight=1&count=5 /** * 在SD卡上创建文件 * * @throws IOException */ public File creatSDFile(String fileName) throws IOException { File file = new File(SDPATH + fileName); f... 阅读全文
posted @ 2011-09-19 15:04 镇水古月 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.cnblogs.com/skylaugh/archive/2006/09/15/505393.html我的xml文件Login.xml如下.<?xmlversion="1.0"encoding="utf-8"?><Login><Character><CText="热血"Value="0"></C><CText="弱气"Value="1"></C><CText= 阅读全文
posted @ 2011-09-19 13:33 镇水古月 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 引用:http://hi.baidu.com/coyeah/blog/item/c8ff20fab1f25d17a9d31129.html一:环境搭建sqlserver2005或者sqlserver2008请先到此处下载驱动http://www.microsoft.com/downloads/details.aspx?FamilyId=61BF87E0-D031-466B-B09A-6597C21A2E2A&displaylang=en下载后解压文件配置:1.将解压的php_sqlsrv.dll 和 php_sqlsrv_ts.dll 放到PHP的扩展目录中(PHP\EXT)。2.编辑 阅读全文
posted @ 2011-09-16 15:59 镇水古月 阅读(506) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.php100.com/html/webkaifa/PHP/PHP/2009/0417/943.htmlEclipse支持PHP自动提示其实如果你已经安装好了php环境(安装过程见)的话,只需要下面2步就可以了。hoho,很简单的。1,下载eclipse中php的插件phpeclipse地址:http://www.phpeclipse.de/tiki-view_articles.phphttp://prdownloads.sourceforge.net/phpeclipse/PHPEclipse1.1.3-2005-01-29.zip?use_mirror=jaist 阅读全文
posted @ 2011-09-16 13:55 镇水古月 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.php100.com/html/webkaifa/PHP/PHP/2009/0417/943.html安装:首先必须确认系统中已经安装了IIS系统推荐:win2003服务器版,win2000专业版和xp系统不支持多用户IIS虚拟主机管理系统无法进行管理,xp系统IIS存在问题调试程序会经常出现不正常。对于作网站和经常调试教本的朋友还是推荐使用win2003服务器版把系统做好配置好玩游戏的话这两个系统都很不错的,有朋友说win2003系统很多功能都关闭了而且界面也没有XP好看,不适合个人用,其实这个东西只需要您稍微改一下,把默认关闭的东西打开,就是一个很不错的个人电脑 阅读全文
posted @ 2011-09-16 13:42 镇水古月 阅读(309) 评论(0) 推荐(0) 编辑
摘要: view.setLayoutParams(new GridView.LayoutParams(100, 100));如果父布局为Gridview 要用Gridview 阅读全文
posted @ 2011-09-16 09:45 镇水古月 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 引用:http://zhidao.baidu.com/question/174461404.html?push=ql方法在实现中使用了reflect技术,你只要告诉方法你的class是哪个就可以了。象你这个代码,就是传入了一个GreetingService的interface类型。接口调用时,只要传入实现该接口的任何一个类都可以。接口调用优点:1、隐藏了实现类。2、修改或更换实现类只需要非常小的改动。3、解耦合。有兴趣了解详情的话,去找源码查考一下。 reflect技术参考:http://baike.baidu.com/view/1865203.html接口参考:http://baike.ba 阅读全文
posted @ 2011-09-16 09:27 镇水古月 阅读(2410) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.cnblogs.com/not-code/archive/2011/07/16/2108369.html扩展:UI设计技巧http://www.cnblogs.com/not-code/category/291732.htmlXMPP协议简介XMPP协议(Extensible Messaging and PresenceProtocol,可扩展消息处理现场协议)是一种基于XML的协议,目的是为了解决及时通信标准而提出来的,最早是在Jabber上实现的。它继承了在XML环境中灵活的发展性。因此,基于XMPP的应用具有超强的可扩展性。并且XML很易穿过防火墙,所以用XM 阅读全文
posted @ 2011-09-16 00:43 镇水古月 阅读(270) 评论(0) 推荐(0) 编辑
摘要: LinearLayout linearLayout = new LinearLayout(context); LinearLayout.LayoutParams linearLayoutParas = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); linearLayout.setLayoutParams(linearLayoutParas); 阅读全文
posted @ 2011-09-15 17:19 镇水古月 阅读(451) 评论(0) 推荐(0) 编辑
摘要: privateList<ResolveInfo>loadApps() { List<ResolveInfo> mApps; Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); mApps = getPackageManager().queryIntentActivities(mainIntent, 0); returnmApps; }使用List<ResolveInfo> mApp =loadAp 阅读全文
posted @ 2011-09-15 16:52 镇水古月 阅读(172) 评论(0) 推荐(0) 编辑
摘要: android:background="@android:color/transparent"要注意它的父布局有没有透明,有的时候,是父布局的颜色 阅读全文
posted @ 2011-09-15 16:48 镇水古月 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.eoeandroid.com/thread-14382-2-1.html<HorizontalScrollView android:id="@+id/hsView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone"android:background="#E9E9E9"> <LinearLayout and 阅读全文
posted @ 2011-09-15 16:38 镇水古月 阅读(1448) 评论(0) 推荐(1) 编辑
摘要: 引用:http://www.cnblogs.com/salam/archive/2010/10/06/1844596.htmlGridView是Android中的数据显示控件,先体验一下它的效果这是GridView只呈现图片的效果。源码下载下面详细介绍一下GridView。一、简介 在二维可滚动网格中呈现子项(Item),Item来自于与之相关的ListAdapter.二、重要方法 getStretchMode():获取GridView的延伸模式。 onKeyDown(int keyCode,KeyEventevent):默认KeyEvent.Callback.onKeyMultip... 阅读全文
posted @ 2011-09-15 15:15 镇水古月 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.cnblogs.com/vir56k/archive/2011/07/04/2097570.html相信使用过android手机的朋友都见过下面样子的选项卡,本文我们尝试做的演示。这个选项卡页面,或者说是标签卡。分为两部分:一个顶部的按钮(可点击的)的切换卡部分一个主内容区(上图显示“第二个窗体”字体的)的主显示区。我们想实现的效果是点击切换的选项卡卡部分,主显示区的内容随之改变。那么我们看下页面布局代码<TabHostxmlns:android="http://schemas.android.com/apk/res/android"and 阅读全文
posted @ 2011-09-15 13:25 镇水古月 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.linuxidc.com/Linux/2010-08/28156.htmApk文件的格式Androidapplication package文件。每个要安装到android平台的应用都要被编译打包为一个单独的文件,后缀名为.apk,其中包含了应用的二进制代码、资源、配置文件等。apk文件实际是一个zip压缩包,可以通过解压缩工具解开。可以用zip解开*.apk文件,下面是一个helloword的apk示例文件|–AndroidManifest.xml|– META-INF| |– CERT.RSA| |– CERT.SF| `– MANIFEST.MF|– clas 阅读全文
posted @ 2011-09-15 11:42 镇水古月 阅读(390) 评论(0) 推荐(0) 编辑