上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 45 下一页
  2012年4月10日
摘要: //创建创建全局变量类1publicclassMyApplicationextendsApplication{23/**4*创建全局变量5*全局变量一般都比较倾向于创建一个单独的数据类文件,并使用static静态变量6*7*这里使用了在Application中添加数据的方法实现全局变量8*注意在AndroidManifest.xml中的Application节点添加android:name=".MyApplication"属性9*10*/11privateWindowManager.LayoutParamswmParams=newWindowManager.LayoutPa 阅读全文
posted @ 2012-04-10 16:34 lee0oo0 阅读(18734) 评论(0) 推荐(1) 编辑
  2012年4月9日
摘要: 以下是短信广播接收内容步骤: 1. 常见一个接收类,此类继承BroadcastReceiver ,需要创建一个action; 2.需要在AndroidManifest中注册这个接收类(关键字receiver)并为action绑定,最后注册短信接收权限 <receiver android:name="EX06_01_SMSreceiver"> //继承BroadcastReceiver 的类名 <!-- 設定要捕捉的訊息名稱為provider中Telephony.SMS_RECEIVED --> <intent-filter> <ac 阅读全文
posted @ 2012-04-09 10:30 lee0oo0 阅读(4280) 评论(0) 推荐(0) 编辑
  2012年4月7日
摘要: //能够取得屏幕的信息DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm);dm.widthPixels; //取得宽像素 dm.heightPixels; //取得高像素//获取当地的日历Calendar c=Calendar.getInstance(); mYear=c.get(Calendar.YEAR);//获取年份 mMonth=c.get(Calendar.MONTH);//获取月份mDay=c.get(Calendar.... 阅读全文
posted @ 2012-04-07 20:52 lee0oo0 阅读(3659) 评论(0) 推荐(1) 编辑
  2012年4月6日
摘要: 主线程给主线程发送消息: public class mainSendToMain extends Activity { private Button btnTest; private TextView textView; private Handler handler; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btnTest = (Butt... 阅读全文
posted @ 2012-04-06 17:26 lee0oo0 阅读(10536) 评论(0) 推荐(0) 编辑
摘要: 图一: 程序主界面图2:新建界面图3:新建后的界面图4:查询界面图5:点击每个List后弹出的修改与删除界面图6:修改界面源代码下载:/Files/lee0oo0/FirstSQLiteApp.rar 阅读全文
posted @ 2012-04-06 14:42 lee0oo0 阅读(827) 评论(0) 推荐(0) 编辑
  2012年4月5日
摘要: 在AndroidManifest中注册相应的权限: <uses-permission android:name="android.permission.FLASHLIGHT" /> <uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.h 阅读全文
posted @ 2012-04-05 22:07 lee0oo0 阅读(25371) 评论(5) 推荐(1) 编辑
  2012年4月4日
摘要: *** User 是用户*** Service Provider是网络服务(例如是新浪微博)*** Consumer是客户端程序 阅读全文
posted @ 2012-04-04 15:28 lee0oo0 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 接收方创建步骤: 1.创建一个DatagramSocket对象,并指定监听的端口号 DatagramSocket socket = newDatagramSocket (4567); 2. 创建一个byte数组用于接收 byte data[] = new byte[1024]; 3. 创建一个空的DatagramPackage对象 DatagramPackage package = newDatagramPackage(data , data.length); 4. 使用receive方法接收发送方所发送的数据,同时这也是一个阻塞的方法 socket.receive(p... 阅读全文
posted @ 2012-04-04 13:32 lee0oo0 阅读(27412) 评论(4) 推荐(0) 编辑
摘要: Wifi网卡状态: WIFI_STATE_DISABLED : WIFI网卡不可用 WIFI_STATE_DISABLING : WIFI正在关闭 WIFI_STATE_ENABLED : WIFI网卡可用 WIFI_STATE_ENABLING : WIFI网卡正在打开 WIFI_STATE_UNKNOWN : 未知网卡状态第一步: 通过WifiManager manager = (WifiManager)Context.getSystemService(Service.WIFI_SERVICE) 得到WifiManager 对象第二步: 打开或者关闭WifisetWifiEnabled(. 阅读全文
posted @ 2012-04-04 12:37 lee0oo0 阅读(537) 评论(0) 推荐(0) 编辑
  2012年4月1日
摘要: WebViewallows you to create your own window for viewing web pages (or even develop a complete browser). In this tutorial, you'll create a simpleActivitythat can view and navigate web pages. Create a new project namedHelloWebView.Open theres/layout/main.xmlfile and insert the following:<?xml v 阅读全文
posted @ 2012-04-01 09:58 lee0oo0 阅读(813) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 45 下一页