- 博客(46)
- 资源 (4)
- 收藏
- 关注
原创 mysql找出包含非ASCII、非中文字符值的记录
-- 查询非ASCII编码的数据SELECT email_id,send_log FROM redm_email_others WHERE NOT HEX(send_log) REGEXP '^([0-7][0-9A-F])*$'; -- 查询ACSII编码数据SELECT email_id,send_log FROM redm_email_others WHERE HEX(s...
2014-04-09 16:16:30
1189
原创 Oracle表解锁
//查询被锁的表SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username, b.os_user_name FROM v$process p, v$session a, v$locked_object b, all_objects c WHERE p.addr = a.padd...
2011-06-09 12:38:33
144
原创 处理按键长按事件
public boolean dispatchKeyEvent(KeyEvent event) { if(event.getRepeatCount()>0){ //Your code here return true; //表示已经处理,系统不会处理此事件 ...
2011-02-23 17:54:56
349
原创 调用系统软件详情
Intent intent = new Intent("android.intent.action.VIEW"); intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails"); intent.putExtra("com.android.set...
2011-02-23 17:45:29
100
原创 PopupWindow设置AnimationStyle
<?xml version="1.0" encoding="utf-8"?><resources><style name="YourAnimationName"> <item name="android:windowEnterAnimation">@anim/push_up_in&l
2010-10-15 14:21:26
617
原创 键盘显示与隐藏
InputMethodManager imm = (InputMethodManager)getSystemService(SendActivity.this.INPUT_METHOD_SERVICE);//显示键盘imm.showSoftInput(editText, 0);//隐藏键盘imm.hideSoftInputFromWindow(editTex...
2010-10-15 14:18:51
125
原创 PopupWindow 点击返回不消失
注册一个PopupWindow 显示出来按返回键居然不消失,很是郁闷,结果查查资料原来是没有设置background加上一句 PopupWindow.setBackgroundDrawable(new BitmapDrawable()); 就Ok了。 ...
2010-09-23 16:45:22
384
原创 【转】千万要避免的五种程序注释方式
转自:http://www.aqee.net/2010/08/12/5-types-of-comments-to-avoid-making-in-your-code/#more-618 你是否有过复查程序时发现有些注释毫无用处?程序注释是为了提高代码的可读性,为了让原作者以外的其他开发人员更容易理解这段程序。我把这些让人郁闷的注释方式归为了五类,同时把写出这些注释的程序员也归为了五...
2010-08-19 10:15:11
113
原创 不错的线程队列
import java.util.LinkedList;public class WorkQueue { private final int nThreads;// 线程池的大小 private final PoolWorker[] threads;// 用数组实现线程池 private final LinkedList<Runnable> queue;/...
2010-08-13 09:39:38
170
原创 (转)管理学的效应
转载 http://blessdyb.iteye.com/blog/711907文章分类:IT生活【蝴蝶效应】【青蛙现象】【鳄鱼法则】 【鲇鱼效应】 【羊群效应】 【刺猬法则】 【手表定律】 【破窗理论】【二八定律】【木桶理论】 【马太效应】 【鸟笼逻辑】 【责任分散效应】【帕金森定律】 【晕轮效应】【霍桑效应】【习得性无助实验】【证人的记忆】【罗森塔尔效应】【虚假同感偏差】 ...
2010-08-12 09:17:15
248
原创 android 下的ftp注意问题
以下代码在pc上测试通过,可是在android模拟器上就不工作,不过还可以链接到服务器但不能得到文件 纠结了半天,原来是模式的问题,具体请Google 模拟器中采用建议被动模式 public void doWork(){ FTPClient ftp = new FTPClient(); try { ftp.connect(server); ...
2010-07-28 14:44:23
223
原创 关闭键盘显示
两种方法:法一:InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE...
2010-07-14 10:13:49
104
原创 使用Git下载Google Android源代码
文章来自:http://zzmccnu.iteye.com/blog/457297 收藏一下 使用Git下载Google Android源代码 准备资源 Android资源分布说明:http://source.android.com/projects#TOC-External-projects Android的Git资源:http://android.git.kernel.org/ Git...
2010-07-14 08:53:44
186
原创 AutoCompleteTextView 实现汉字和拼音双向关联 只需改写ArrayAdapter
具体看代码: public class CityAdapter<T> extends BaseAdapter implements Filterable { /** * Contains the list of objects that represent the data of this ArrayAdapter. * The content o...
2010-07-08 10:49:05
147
定制个性化屏保(转)
转自:http://blog.youkuaiyun.com/wukunting/archive/2010/01/24/5251302.aspx 每次我们锁键盘的时候,都看到如下页面: 看多了就产生审美疲劳, 手机是追求个性化的消费品,想到就是替换她,再找一个。 如何替换呢?Android 提供如下函数: KeyguardManager mKeyguardManag...
2010-03-30 17:08:30
159
自定义Dialog
代码如下:SearchDialog.javaimport android.app.Dialog;import android.content.Context;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;...
2010-03-09 09:08:14
119
TextView滚动效果
<TextView android:id="@+id/app_shortcontent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:textC...
2010-03-02 10:15:43
98
原创 Activitie之间传对象,通过Parcelable
对象必须实现Serializable,对象代码如下:import java.io.Serializable;import android.graphics.drawable.Drawable;//传送的对象public class MyApplicationInfo extends Object implements Serializable{ //Yo...
2010-02-26 15:42:46
240
程序卸载应用程序
Uri packageURI = Uri.parse("package:"+packageName); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivityForResult(uninstallIntent,ISUNINS...
2010-02-26 15:33:23
144
本地程序打开其它程序
Intent i = new Intent("android.intent.action.MAIN");i.setComponent(new ComponentName(packageName, className));startActivity(i); packageName包名className类名
2010-02-26 15:31:01
95
调用market搜索软件
Intent installIntent = new Intent("android.intent.action.VIEW"); installIntent.setData(Uri.parse("market://search?q=pname:"+packageName)); startActivity(installIntent);...
2010-02-26 15:27:44
156
RGB转成ARGB
colors.xml<?xml version="1.0" encoding="utf-8"?><resources><color name="solid_blue">#0000ff</color></resources> 转换代码:int color = getResources().
2010-02-26 15:19:11
1458
改写Preference
代码如下:import android.content.Context;import android.preference.Preference;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.Rat...
2010-02-26 15:15:19
105
改写ListView样式
<ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawSelectorOnTop="true" android:listS...
2010-02-26 15:08:22
144
重写SimpleCursorAdapter
import android.content.Context;import android.database.Cursor;import android.provider.MediaStore;import android.view.View;import android.widget.SimpleCursorAdapter;import android.widget.Text...
2010-02-26 15:01:25
212
获取系统音乐
ContentResolver resolver = getContentResolver();Cursor c = query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER);//Cursor就能得到系统的音...
2010-02-26 14:56:22
95
原创 广播发送与接收
发送端:Intent i = new Intent("Broadcast one!");i.put......想要的内容//发送广播android.content.ContextWrapper.sendBroadcast(Intent intent); 接收端:// 增加一个Intent过滤,添加Receiver监听service发送的广播 Inten...
2010-02-26 14:48:25
151
原创 Adapter增加选中状态
import java.util.List;import java.util.Map;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget....
2010-02-26 14:34:41
375
Android调用MediaScanner进行扫描
代码如下;import android.content.Context;import android.media.MediaScannerConnection;import android.net.Uri;public class MediaScanner { private MediaScannerConnection mediaScanConn = null;...
2010-02-26 14:29:45
457
原创 Android图片总结
图片缩放:public static Drawable resizeImage(Drawable d, int w, int h) { // load the origial Bitmap Bitmap BitmapOrg = ((BitmapDrawable) d).getBitmap(); int width = Bitma...
2010-02-26 14:22:08
81
Android下修改ImageButton样式
只需在res/drawable 下价格xml文件即可配置如下:<ImageButton android:id="@+id/player_sound" android:layout_width="55px" android:layout_height="55px" android:layout_marginTop=...
2010-02-26 14:18:21
880
原创 Android下修改SeekBar样式
SeekBar配置文件: <SeekBar android:id="@+id/player_seekbar" android:layout_width="245px" android:layout_height="25px" android:progressDrawable="@drawable/seekbar_st...
2010-02-26 14:01:44
114
原创 volatile 变量使用指南
转自:http://www.ibm.com/developerworks/cn/java/j-jtp06197.html级别: 中级Brian Goetz (brian.goetz@sun.com), 高级工程师, Sun Microsystems2007 年 7 月 05 日 Java™ 语言包含两种内在的同步机制:同步块(或方法)和 volatile 变量。这两种机制的提出...
2009-12-04 17:05:17
118
文件搜索
自己写的文件搜索,如有疑义请留言:private File[] forder;private File[] files;private List<File> listforder = new ArrayList<File>();//存放文件夹private String root = Properties.ROOT;//根目录private File f...
2009-12-04 13:42:32
113
原创 算法---排序
转自:http://ons.iteye.com/blog/470618 排序的关键字时间复杂度:整个排序算法运行所需要的时间。空间复杂度:排序算法运行过程汇总所需要额外空间稳定性:若待排的序列中有大小相同的两个数,若整个排序过程中不存在两数次序交换的可能新内阁,则该排序算法是稳定的。in-place:算法使用的额外存储空间是常数级的...
2009-12-04 13:32:31
146
原创 Android横竖屏总结
//设置为无标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); //设置为全屏模式getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //设置为横屏 s...
2009-12-04 13:19:38
100
原创 网络下载
//连接网络下载资源 URL url = new URL(filepath); URLConnection conn = url.openConnection(); conn.setConnectTimeout(10000); conn.connect();InputStream is = conn.getInputStream(); totalsize...
2009-12-04 13:15:39
168
原创 判断是否插入SD存储卡
public boolean hasStorage() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { return true; } ...
2009-12-04 13:11:52
245
usb3.0 U盘低级格式化修复工具 v3.9.0.0
2016-08-16
2016最新手机号码归属地数据库
2016-08-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人