08 2012 档案

关于delphi点击webbrowser中任意一点的问题
摘要:有时候我们需要delphi载入webbrowser1打开网页的时候 需要点击某一个点的位置 可能是坐标 可能是按钮 可能是其他的控件应该如何来实现呢? 这里来简单说明一下点击坐标的过程点击过程很明显我们移动鼠标来点击或者发送消息来点击移动鼠标点击的比较常见 这里详细说明一下发送消息来点击的办法发送消息来点击的思路是sendmessage()发送消息来实现的导入句柄 点击的就可以了。但是这里的句柄(webbrowser的句柄)其实是不好找的。如果找到了合适的正确的句柄点击起来还是非常容易的这里有一个过程可以清楚的说明sendmessage的点击过程procedure sendclick(var 阅读全文

posted @ 2012-08-30 23:17 jxgxy 阅读(3492) 评论(1) 推荐(0)

android 类似微信的摇一摇实现
摘要:packagecom.eboy.testyaoyiyao;importjava.text.SimpleDateFormat;importjava.util.Date;importandroid.app.Activity;importandroid.hardware.Sensor;importandroid.hardware.SensorEvent;importandroid.hardware.SensorEventListener;importandroid.hardware.SensorManager;importandroid.os.Bundle;importandroid.os.Vibr 阅读全文

posted @ 2012-08-29 15:23 jxgxy 阅读(6906) 评论(0) 推荐(0)

android 获取已安装程序列表
摘要:publicvoidbtn1Click(Viewv){Stringstr=null;PackageManagermanager=this.getPackageManager();List<PackageInfo>pkgList=manager.getInstalledPackages(0);for(inti=0;i<pkgList.size();i++){PackageInfopI=pkgList.get(i);str=str+"\n"+pI.packageName;}TextViewtv1=(TextView)findViewById(R.id.text 阅读全文

posted @ 2012-08-26 21:53 jxgxy 阅读(3027) 评论(0) 推荐(0)

Android中的“再按一次返回键退出程序”实现
摘要:用户退出应用前给出一个提示是很有必要的,因为可能是用户并不真的想退出,而只是一不小心按下了返回键,大部分应用的做法是在应用退出去前给出一个Dialog,我觉得这样不太友好,用户还得移动手指去按dialog中的按钮。个人觉得“再按一次返回键退出程序”是best practice,实现也很简单,直接上代码:privatelongexitTime=0;@OverridepublicbooleanonKeyDown(intkeyCode,KeyEventevent){if(keyCode==KeyEvent.KEYCODE_BACK&&event.getAction()==KeyEve 阅读全文

posted @ 2012-08-23 22:46 jxgxy 阅读(61300) 评论(7) 推荐(7)

android 改变文字的大小和字体
摘要:先在 assets 目录中新建 fonts 目录,然后把字体文件拷进去,我以"汉仪柏青体简"为例。设置代码: TextViewtxtView=(TextView)findViewById(R.id.textView1);txtView.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/haiyiboqingti.ttf"));txtView.setTextSize(30);txtView.setText("我是刘一手,Helloworld.");效果如下: 阅读全文

posted @ 2012-08-23 16:56 jxgxy 阅读(1478) 评论(0) 推荐(0)

android AlertDialog显示错误 Unable to add window token null is not for an application解决办法
摘要:publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);findViewById(R.id.button1).setOnClickListener(newButton.OnClickListener(){publicvoidonClick(Viewv){newAlertDialog.Builder(getApplicationContext()).setTitle(R.string.dialogTitle).set 阅读全文

posted @ 2012-08-23 11:47 jxgxy 阅读(16403) 评论(0) 推荐(1)

android 获取所有传感器数据
摘要:main.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><Te 阅读全文

posted @ 2012-08-23 10:41 jxgxy 阅读(12068) 评论(2) 推荐(0)

android 使用style修饰内容
摘要:res/values/style.xml内容:<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="eboyStyle"> <item name="android:textSize">24sp</item> <item name="android:textColor">#EC9237</item> </style>< 阅读全文

posted @ 2012-08-22 22:52 jxgxy 阅读(419) 评论(0) 推荐(0)

android 取屏幕分辩率
摘要://取屏幕分辩率DisplayMetricsdisplayMetrics=newDisplayMetrics();getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);txtView.setText("屏幕分辨率为:"+displayMetrics.widthPixels+":"+displayMetrics.heightPixels); 阅读全文

posted @ 2012-08-22 22:15 jxgxy 阅读(306) 评论(0) 推荐(0)

android 让 EditText, TextView自动识别链接
摘要:设置属性:android:layout_centerHorizontal="true"然后:edtText.setText("m432电影网 http://www.985dy.com");txtView.setText("985电影网 http://www.m432.com"); 阅读全文

posted @ 2012-08-22 21:20 jxgxy 阅读(507) 评论(0) 推荐(0)

android 让 TextView 自带滚动条
摘要:一、Xml代码<TextViewandroid:id="@+id/textview"android:layout_width="fill_parent"android:layout_height="wrap_content"android:singleLine="false"android:maxLines="5"android:scrollbars="vertical"/>二、还需要在代码中设置 TextView 相应的方法TextViewtextView=(T 阅读全文

posted @ 2012-08-21 17:03 jxgxy 阅读(14660) 评论(0) 推荐(1)

程序员的艺术:排序算法舞蹈
摘要:1、冒泡排序: 2、希尔排序: 3、选择排序: 4:插入排序: 5、快速排序: 6、归并排序: 阅读全文

posted @ 2012-08-20 22:43 jxgxy 阅读(239) 评论(0) 推荐(0)

Android 屏幕自动旋转-Sensor属性
摘要:在activity中加入下面加粗部分即可,<activity android:name=".demo" android:label="@string/app_name"android:screenOrientation="sensor"> 阅读全文

posted @ 2012-08-19 00:05 jxgxy 阅读(1742) 评论(0) 推荐(0)

MSDN Windows8 中文版 下载地址
摘要:Windows 8 (x86) 简体中文版(包含专业版和Core版)文件名: cn_windows_8_x86_dvd_915414.iso语言: Chinese - SimplifiedSHA1:0C4A168E37E38EFB59E8844353B2535017CBC587http://kuai.xunlei.com/d/LBFDDGYODAHK(迅雷离线)http://urlxf.qq.com/?UzYBJbe(腾讯离线)Windows 8 (x64) 简体中文版(包含专业版和Core版)文件名: cn_windows_8_x64_dvd_915407.iso语言: Chinese - 阅读全文

posted @ 2012-08-16 09:17 jxgxy 阅读(4012) 评论(0) 推荐(0)

android activity生命周期
摘要:程序启动时:onCreateonStartonResume按返回按钮关闭程序时:onPauseonStoponDestory打开新Activity时:onSaveInstanceStateonPauseonStop打开程序后,直接按Home键时(或者说打开应用后,有来电进来时):onSaveInstanceStateonPauseonStop直接按Home键后,重新打开程序时(或者说来电被挂断了,恢复到程序界面时)(或从别的Activity返回时):onRestartonStartonResume屏幕旋转时:onSaveInstanceStateonPauseonStoponDestroyon 阅读全文

posted @ 2012-08-15 17:15 jxgxy 阅读(472) 评论(0) 推荐(0)

android Log图文详解(Log.v,Log.d,Log.i,Log.w,Log.e)
摘要:在Android群里,经常会有人问我,Android Log是怎么用的,今天我就把从网上以及SDK里东拼西凑过来,让大家先一睹为快,希望对大家入门Android Log有一定的帮助.android.util.Log常用的方法有以下5个:Log.v()Log.d()Log.i()Log.w()以及Log.e()。根据首字母对应VERBOSE,DEBUG,INFO,WARN,ERROR。1、Log.v 的调试颜色为黑色的,任何消息都会输出,这里的v代表verbose啰嗦的意思,平时使用就是Log.v("","");2、Log.d的输出颜色是蓝色的,仅输出de 阅读全文

posted @ 2012-08-15 17:05 jxgxy 阅读(66155) 评论(3) 推荐(9)

android widget的编写
摘要:/Files/jxgxy/widget.rar 阅读全文

posted @ 2012-08-15 11:38 jxgxy 阅读(271) 评论(0) 推荐(0)

SQL 列出某列有重复的记录
摘要:select*fromReportCustomMissionwhereProjectCodein(selectProjectCodefromReportCustomMissiongroupbyProjectCodehaving(count(*)>1)) 阅读全文

posted @ 2012-08-13 17:39 jxgxy 阅读(466) 评论(0) 推荐(0)

android 取网址的HTML代码
摘要:/****@paramaUrl网址*@paramaEncode编码*@return返回的HTML代码*@throwsException对外抛出异常*/publicStringgetHTML(StringaUrl,StringaEncode)throwsException{URLurl=newURL(aUrl);HttpURLConnectionconn=(HttpURLConnection)url.openConnection();conn.setConnectTimeout(5000);conn.setRequestMethod("GET");if(conn.getRes 阅读全文

posted @ 2012-08-13 16:00 jxgxy 阅读(488) 评论(0) 推荐(0)

android 判断SIM卡是哪个运营商
摘要:packagecom.eboy.checksimoperator;importandroid.app.Activity;importandroid.content.Context;importandroid.os.Bundle;importandroid.telephony.TelephonyManager;importandroid.view.Menu;importandroid.view.View;importandroid.widget.Toast;publicclassMainActivityextendsActivity{@OverridepublicvoidonCreate(Bun 阅读全文

posted @ 2012-08-13 14:55 jxgxy 阅读(2944) 评论(0) 推荐(0)

@Override must override a superclass method 问题解决
摘要:如果在使用Eclipse开发Java项目时,在使用 @Override 出现以下错误:The method *** of type *** must override a superclass method主要是因为你的Compiler是jdk5,(5不支持@Override等形式的批注)只要把它改为6就可以了。方法:将window->preferences->java-compiler中的Compiler compliance level修改为6.0。 阅读全文

posted @ 2012-08-13 14:09 jxgxy 阅读(960) 评论(0) 推荐(0)

android 通话录音实现
摘要:因受系统限制,只能录自已麦的声音,录不到对方的声音,可能需要改内核才能实现双向录音;接通电话和挂断电话时,震动一下;使用广播接收者实现自启动;服务代码:packagecom.eboy.phoneListener;importjava.io.File;importandroid.app.Service;importandroid.content.Context;importandroid.content.Intent;importandroid.media.MediaRecorder;importandroid.os.Environment;importandroid.os.IBinder;im 阅读全文

posted @ 2012-08-13 11:55 jxgxy 阅读(15607) 评论(1) 推荐(1)

android 发送通知栏消息,点击后打开指定网页
摘要:packagecom.eboy.testnotification;importandroid.app.Activity;importandroid.app.Notification;importandroid.app.NotificationManager;importandroid.app.PendingIntent;importandroid.content.Context;importandroid.content.Intent;importandroid.net.Uri;importandroid.os.Bundle;importandroid.view.Menu;importandr 阅读全文

posted @ 2012-08-12 22:19 jxgxy 阅读(6621) 评论(0) 推荐(0)

android 调用系统的音乐和视频播放器
摘要:packagecom.eboy.testsystemaudiovideo;importandroid.app.Activity;importandroid.content.Intent;importandroid.net.Uri;importandroid.os.Bundle;importandroid.os.Environment;importandroid.view.View;importandroid.view.View.OnClickListener;importandroid.widget.Button;publicclassMainActivityextendsActivity{@ 阅读全文

posted @ 2012-08-11 20:36 jxgxy 阅读(20939) 评论(0) 推荐(1)

Android 调用系统自带的拍照,返回JPG文件
摘要:/Files/jxgxy/testCamera1.rarpackagecom.eboy.testcamera1;importjava.io.File;importjava.io.FileOutputStream;importandroid.app.Activity;importandroid.content.Intent;importandroid.graphics.Bitmap;importandroid.os.Bundle;importandroid.os.Environment;importandroid.provider.MediaStore;importandroid.view.Me 阅读全文

posted @ 2012-08-04 20:41 jxgxy 阅读(4974) 评论(0) 推荐(0)

Android 自制拍照软件
摘要:/Files/jxgxy/testCamera.rar 阅读全文

posted @ 2012-08-03 14:43 jxgxy 阅读(341) 评论(0) 推荐(0)

使用google的GSON处理JSON
摘要:/Files/jxgxy/testJSON.rarperson.javapackagecom.eboy.testJSON;publicclassperson{privateStringurl_3w;privateintreplyCount;privateinthasImg;privateStringdigest;privateStringurl;privateStringdocid;privateStringtitle;privateintorder;privateintpriority;privateStringlmodify;//有可能是日期类型privateStringsubtitle; 阅读全文

posted @ 2012-08-02 22:45 jxgxy 阅读(6886) 评论(0) 推荐(0)

JAVA 从文本文件返回字符串内容
摘要:privatestaticStringReadTxtFile(StringFileName)throwsException{BufferedInputStreambufferedInputStream=newBufferedInputStream(newFileInputStream(FileName));ByteArrayOutputStreammemStream=newByteArrayOutputStream();byte[]buffer=newbyte[1024];intlen=0;while((len=bufferedInputStream.read(buffer))!=-1){m. 阅读全文

posted @ 2012-08-02 22:38 jxgxy 阅读(2924) 评论(0) 推荐(0)

Ubuntu 11.04 下安装配置 JDK 7
摘要:转载自:http://blog.csdn.net/yang_hui1986527/article/details/6677450第一步:下载jdk-7-linux-i586.tar.gz[plain]view plaincopy wget-chttp://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz(注:如果下载不下来,建议使用迅雷下载,然后拷贝到Linux系统上。)第二步:解压安装[plain]view plaincopy sudotarzxvf./jdk-7-linux-i586.tar.gz-... 阅读全文

posted @ 2012-08-02 15:10 jxgxy 阅读(273) 评论(0) 推荐(0)

导航