摘要:
引用:http://www.eoeandroid.com/thread-30515-1-1.htmlwebView.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { //实现下载的代码... 阅读全文
posted @ 2011-09-23 17:38
镇水古月
阅读(423)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_12_1259[图片]shot.jpg[代码]SplashScreen.java01publicclassSplashScreenextendsActivity {0203/**04* The thread to process splash screen events05*/06privateThread mSplashThread;0708/** Called when the activity is first created. */09@Override10publicvoidonCreate(Bundle 阅读全文
posted @ 2011-09-23 17:28
镇水古月
阅读(202)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_54100_6262Android中自带的view种类很多,但是有时候不能满足我们的需求,下面介绍一种自定义view的方法,实现了拖动矩形到屏幕任意位置的需求。标签: Android SDK代码片段(5)[图片]程序截图[代码]Activity.java01packagecom.zhuozhuo;0203importandroid.app.Activity;04importandroid.os.Bundle;0506publicclassCSDNActivityextendsActivity {07/** Calle 阅读全文
posted @ 2011-09-23 17:27
镇水古月
阅读(205)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_163910_6093[图片]1.jpg[代码][Java]代码1requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);2setContentView(R.layout.main);3setProgressBarIndeterminateVisibility(true);---------------------------------------------------------[代码][Java]代码view sourceprint?1prote 阅读全文
posted @ 2011-09-23 17:26
镇水古月
阅读(196)
评论(0)
推荐(0)
摘要:
引用http://www.oschina.net/code/snippet_163910_6069[文件]RecordActivity.java~5KB下载(12)view sourceprint?001packagecom.cons.dcg.collect;002003importjava.io.File;004importjava.text.SimpleDateFormat;005importjava.util.*;006importandroid.app.*;007importandroid.content.Intent;008importandroid.database.Cursor; 阅读全文
posted @ 2011-09-23 17:19
镇水古月
阅读(194)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_12_4121[图片]pic3.jpg[图片]pic4.jpg[代码][Java]代码01publicclassPlayerextendsAnimatedSprite {02...03@Override04protectedvoidonManagedUpdate(finalfloatpSecondsElapsed) {05super.onManagedUpdate(pSecondsElapsed);06onBeforePositionChanged();07}0809privatebooleanonBeforePos 阅读全文
posted @ 2011-09-23 17:17
镇水古月
阅读(214)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_4873_4437//1,已将图片保存到drawable目录下0203//通过图片id获得Drawable0405Resource res=gerResource();06Drawable drawable=res.getDrawable(id);//id为R.drawable.图片名称0708//通过图片id获得Bitmap0910Resource res=gerResource();1112Bitmap bitmap=BitmapFactory.decodeResource(res, id);1314//若只知道 阅读全文
posted @ 2011-09-23 17:08
镇水古月
阅读(171)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_54100_62331privatebooleandrawall=false;02privateRefreshHandler mRedrawHandler =newRefreshHandler();03classRefreshHandlerextendsHandler {0405@Override06publicvoidhandleMessage(Message msg) {07KetrisCanvas.this.update();08KetrisCanvas.this.invalidate();09}1011pub 阅读全文
posted @ 2011-09-23 17:05
镇水古月
阅读(178)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_4873_6112好像是Activity里声明的Dialog。其实是两个Activity,而且甚至是两个不同的App的Activity。实现这个效果很简单。我创建了一个新的android项目。然后,给AndroidManifest文件中Activity添加了Dialog样式属性:这样,如果运行该app的时候屏幕上正显示其他应用的Activity,就会出现上图的效果。在这里Activity被伪装成Dialog了。Activity一般给人的印象是要占满全屏的。伪装成Dialog的效果是只显示在部分屏幕中。标签: Andr 阅读全文
posted @ 2011-09-23 17:01
镇水古月
阅读(310)
评论(0)
推荐(0)
摘要:
JXTA 资料完善参考:http://www.oschina.net/code/snippet_149945_5616 阅读全文
posted @ 2011-09-23 16:51
镇水古月
阅读(574)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_12_698[代码]java代码01ImageView iv = (ImageView) findViewById(R.id.ImageView01);02ImageView iv2 = (ImageView) findViewById(R.id.ImageView02);03ImageView iv3 = (ImageView) findViewById(R.id.ImageView03);0405//draw的方式对整屏截取,但信息栏为黑色06View cv = getWindow().getDecorView( 阅读全文
posted @ 2011-09-23 16:46
镇水古月
阅读(297)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_54100_6263 阅读全文
posted @ 2011-09-23 16:38
镇水古月
阅读(127)
评论(0)
推荐(0)
摘要:
引用:http://www.oschina.net/code/snippet_12_1257[图片]android_xy.gif[文件]xy_plot_4_Android_src.zip~57KB下载(127)[代码]绘制网格线的方法view sourceprint?01publicstaticvoiddraw_the_grid(Canvas this_g, Vector these_labels)02{03doublerounded_max =0.0;04doublerounded_min =0.0;05doublerounded_max_temp;06Object curElt;07Str 阅读全文
posted @ 2011-09-23 16:30
镇水古月
阅读(858)
评论(0)
推荐(0)
摘要:
android:layout_gravity="top"。android:layout_gravity="bottom" 阅读全文
posted @ 2011-09-23 15:57
镇水古月
阅读(185)
评论(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
镇水古月
阅读(216)
评论(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
镇水古月
阅读(477)
评论(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
镇水古月
阅读(197)
评论(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
镇水古月
阅读(132)
评论(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
镇水古月
阅读(277)
评论(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
镇水古月
阅读(241)
评论(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
镇水古月
阅读(421)
评论(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
镇水古月
阅读(1249)
评论(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
镇水古月
阅读(511)
评论(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
镇水古月
阅读(340)
评论(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
镇水古月
阅读(251)
评论(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
镇水古月
阅读(1082)
评论(0)
推荐(0)

浙公网安备 33010602011771号