上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页

2012年12月3日

日志12.03

摘要: Gson 是 Google 提供的用来在 Java 对象和 JSON 数据之间进行映射的 Java 类库。可以将一个 JSON 字符串转成一个 Java 对象,或者反过来。示例代码:Gson gson = new Gson();int[] ints = {1, 2, 3, 4, 5};String[] strings = {"abc", "def", "ghi"};(Serialization) gson.toJson(ints); ==> prints [1,2,3,4,5]gson.toJson(strings); ==&g 阅读全文

posted @ 2012-12-03 20:04 勤修 阅读(181) 评论(0) 推荐(0) 编辑

2012年11月30日

漫谈C语言及如何学习C语言(转)

摘要: 云风最近写了一篇博客《C语言的前世今生》。作为长期使用C语言开发网络游戏服务器的程序员,云风是有理由写这样一篇文字,不过还是感觉谈的不够深入,C语言在业界使用的现状没有怎么描写,有些意犹未尽。在这里想比较系统的谈谈个人对C语言学习方式方法的理解。分别按照书籍、实验环境搭建、网络资源来分别介绍,希望能写的比较完整全面一些,给想学习C语言的朋友一个有价值的参考。为什么要学习C语言?为什么要学习、使用C语言?为什么要学习一个可能比自己都岁数大的编程语言?我在前面如何学习编程语言的博客文章http://sunxiunan.com/?p=1597 里提到,选择一门编程语言,“为什么而学”这个目的是最重要 阅读全文

posted @ 2012-11-30 16:51 勤修 阅读(179) 评论(0) 推荐(0) 编辑

2012年11月29日

字符编码详解及由来(UNICODE,UTF-8,GBK)(转)

摘要: 很久很久以前,有一群人,他们决定用8个可以开合的晶体管来组合成不同的状态,以表示世界上的万物。他们看到8个开关状态是好的,于是他们把这称为"字节"。 再后来,他们又做了一些可以处理这些字节的机器,机器开动了,可以用字节来组合出很多状态,状态开始变来变去。他们看到这样是好的,于是它们就这机器称为"计算机"。 开始计算机只在美国用。八位的字节一共可以组合出256(2的8次方)种不同的状态。 他们把其中的编号从0开始的32种状态分别规定了特殊的用途,一但终端、打印机遇上约定好的这些字节被传过来时,就要做一些约定的动作。遇上00x10, 终端就换行,遇上0x07 阅读全文

posted @ 2012-11-29 22:39 勤修 阅读(139) 评论(0) 推荐(0) 编辑

2012年11月28日

监听短信数据库变化

摘要: void android.content.ContentResolver.registerContentObserver(Uri uri, boolean notifyForDescendents, ContentObserver observer)Register an observer class that gets callbacks when data identified by a given content URI changes.Parameters:uri The URI to watch for changes. This can be a specific row URI, 阅读全文

posted @ 2012-11-28 19:05 勤修 阅读(554) 评论(0) 推荐(0) 编辑

阅读短信

摘要: 查看收件箱中的短信 // 查看收件箱中的短信 public void watchInboxSMS() { Uri uri = Uri.parse("content://sms/inbox"); String[] projection = new String[] { "_id", "address", "person", "body", "date", "type" }; String selection = null; String[] selectio 阅读全文

posted @ 2012-11-28 15:43 勤修 阅读(389) 评论(0) 推荐(0) 编辑

在src文件中寻找短信数据库表

摘要: android.provider.TelephonyThe Telephony provider contains data related to phone operation.android.provider.Telephony.TextBasedSmsColumnsBase columns for tables that contain text based SMSs.SMS = (Short Message Service)短信服务android.provider.Telephony.SmsContains all text based SMS messages.android.pro 阅读全文

posted @ 2012-11-28 14:36 勤修 阅读(195) 评论(0) 推荐(0) 编辑

收发短信API

摘要: void android.telephony.SmsManager.sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent)Send a text based SMS.Parameters: destinationAddress the address to send the message to scAddress is the service center address or null t 阅读全文

posted @ 2012-11-28 13:29 勤修 阅读(350) 评论(0) 推荐(0) 编辑

从数据库中查询数据

摘要: ContentResolver的query方法Cursor android.content.ContentResolver.query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)Query the given URI, returning a Cursor over the result set.For best performance, the caller should follow these guidelines:•Provide an explici 阅读全文

posted @ 2012-11-28 11:41 勤修 阅读(990) 评论(0) 推荐(0) 编辑

2012年11月27日

拦截短信示例1

摘要: 广播有两种不同的类型:普通广播(normal broadcasts)和有序广播(ordered broadcasts)。普通广播是完全异步的,可以被所有的接收者接收到,并且接收者无法终止广播的传播。然而有序广播是按照接收者声明的优先级别,被接收者依次接收到。优先级别声明在 intent-filter 元素的 android:priority 属性中,数越大优先级别越高,取值范围:-1000到1000,优先级别也可以调用IntentFilter对象的setPriority()进行设置。有序广播的接收者可以终止广播Intent的传播,广播Intent的传播一旦终止,后面的接收者就无法接收到广播。发 阅读全文

posted @ 2012-11-27 18:13 勤修 阅读(262) 评论(0) 推荐(0) 编辑

发送短信示例1

摘要: 发送短信示例代码 1 public class SendMsgActivity extends Activity { 2 private EditText et_phone, et_content; 3 private Button bt; 4 5 @Override 6 public void onCreate(Bundle savedInstanceState) { 7 super.onCreate(savedInstanceState); 8 setContentView(R.layout.main); 9 10 ... 阅读全文

posted @ 2012-11-27 17:11 勤修 阅读(286) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页

导航