摘要: 在Android里,所有的wifi操作都在 android.net.wifi包里,而常用的类也就只用几个,对于一般的开发人员来说,常用的操作也是有限的,不需要刻意的去记,用的时候现查就ok 了,下面是《Android应用开发揭秘》里面关于wifi的范例package com.yarin.android.Examples_08_08; import java.util.List; import android.content.Context; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfigura... 阅读全文
posted @ 2013-11-21 10:18 最後的輕語 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 在c#中访问javascript函数 方法一 Page.RegisterStartupScript("a",""); 2. 方法二 使用 Literal类 private void Button2_Click(object sender, System.EventArgs e) { string str; str=""; / teral1.Visible=true; Literal1.Text=str; } 在 JavaScript访问C#变量?答案如下:方法一:1、通过页面上隐藏域访问方法二:1、如后台定义了 ... 阅读全文
posted @ 2013-11-14 09:32 最後的輕語 阅读(631) 评论(0) 推荐(0) 编辑
摘要: package com.zhoucj.bluetooth;import android.os.Bundle;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilt 阅读全文
posted @ 2013-10-28 22:40 最後的輕語 阅读(989) 评论(0) 推荐(0) 编辑
摘要: 本文介绍Android中蓝牙的基本操作检测本地是否有蓝牙设备获取远程蓝牙设备的地址MainActivity中一个Button,单击Button打开蓝牙设备package com.zhoucj.bluetooh;import java.util.Iterator;import java.util.Set;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.content.Intent;import 阅读全文
posted @ 2013-10-28 21:45 最後的輕語 阅读(1459) 评论(0) 推荐(0) 编辑
摘要: 1.无参数Activity跳转 Intent it = new Intent(Activity.this, Activity2.class); startActivity(it); 2.向下一个Activity传递数据(使用Bundle或Intent.putExtras) Intent it = new Intent(Activity.this, Activity2.class); Bundle bundle=new Bundle(); bundle.putString("name", "This is from MainActivity!"); it. 阅读全文
posted @ 2013-10-22 09:08 最後的輕語 阅读(692) 评论(0) 推荐(0) 编辑
摘要: 关于c#发送邮件,废话不多说、直接上代码public static void SendEmail() { try { //实例化SmtpClient SmtpClient client = new SmtpClient("smtp.163.com", 25); //出站方式设置为NetWork client.DeliveryMethod = SmtpDeliveryMethod.Netw... 阅读全文
posted @ 2013-10-19 09:30 最後的輕語 阅读(300) 评论(0) 推荐(1) 编辑
摘要: SD卡作为手机的扩展存储设备,在手机中充当硬盘角色,可以让我们手机存放更多的数据以及多媒体等大体积文件。因此查看SD卡的内存就跟我们查看硬盘的剩余空间一样,是我们经常操作的一件事,那么在Android开发中,我们如何能获取SD卡的内存容量呢?要操作Sdcard首先要获得访问Sdcard的权限,因此在AndroidManifes.xml中添加权限 其次,要判断Sdcard是否存在,存在Sdcard的情况我们才能访问,因此这里要用if判断//得到外部储存sdcard的状态 private String sdcard=Environment.getExternalStorageState(); // 阅读全文
posted @ 2013-09-06 10:33 最後的輕語 阅读(8086) 评论(0) 推荐(0) 编辑
摘要: 知识点:UDP协议和TCP协议的不同。UDP是把数据都打成数据包,数据包上自带通信的地址,但是数据包发出去之后UDP协议不能保证你能否收到。而TCP协议要求接收方收到数据后给个回应,当发送重要数据的时候就可以选择TCP协议。UDP发送数据的量是有限的,而TCP是没有限制的,当然这导致UDP很快,TCP相对慢点。根据不同的情况,有不同的选择。一、通信的基本结构:客户端和服务器端 客户端这边是Socket类:客户端指定给某个服务器端上的某个端口发送消息。比如向10.10.16.162这台机器的10000号端口发送消息。 服务器端是ServiceSocket类:服务器端就在9000号这个端口上监听, 阅读全文
posted @ 2013-09-05 15:04 最後的輕語 阅读(2029) 评论(0) 推荐(0) 编辑
摘要: 在Android的官方文档当中,对android:screenOrientation的说明如下:android:screenOrientationThe orientation of the activity's display on the device.The value can be any one of the following strings:"unspecified"The default value. The system chooses the orientation. The policy it uses, and therefore the c 阅读全文
posted @ 2013-09-04 11:12 最後的輕語 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 主要代码如下:private void getScreen(View view, String filePath) { try { Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Config.ARGB_8888); Canvas canvas=new Canvas(); canvas.setBitmap(bitmap); view.draw(canvas); ... 阅读全文
posted @ 2013-09-02 11:16 最後的輕語 阅读(583) 评论(0) 推荐(0) 编辑