2013年8月19日

摘要: 一、如何控制Android LED等?(设置NotificationManager的一些参数) 代码如下:final int ID_LED=19871103; NotificationManager nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(); notification.ledARGB = 0xFFFFFF; //这里是颜色,我们可以尝试改变,理论上0xFF0000是红色,0x00FF00是绿色 noti... 阅读全文
posted @ 2013-08-19 09:11 魏滋珑 阅读(776) 评论(0) 推荐(1) 编辑

2013年8月15日

摘要: 1,调web浏览器Uri myBlogUri = Uri.parse("http://xxxxx.com");returnIt = new Intent(Intent.ACTION_VIEW, myBlogUri);2,地图Uri mapUri = Uri.parse("geo:38.899533,-77.036476");returnIt = new Intent(Intent.ACTION_VIEW, mapUri);3,调拨打电话界面Uri telUri = Uri.parse("tel:100861");returnIt = 阅读全文
posted @ 2013-08-15 15:08 魏滋珑 阅读(424) 评论(0) 推荐(1) 编辑
 
摘要: GridLayout初步研究:可以这么说这个布局绝对是开发者的福音,它大大简化了对复杂布局的处理,包括性能提高不是一倍两倍。它与GridView是完全不同的概念,GridView是一种适配器布局,它的继承关系是:ViewGroup > AdapterView > AbsListView > GridView,而GridLayout的继承关系是:ViewGroup > GridLayout,可以看出如果论辈分的话,GridLayout是GridView的爷爷辈的,但不是亲生爷爷哦,GridView的亲生爷爷是AdapterView,而GridLayout是AdapterV 阅读全文
posted @ 2013-08-15 14:51 魏滋珑 阅读(3613) 评论(1) 推荐(0) 编辑
 
摘要: 1、SQLiteDataBase对象的query()接口:public Cursor query (String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having,String orderBy,String limit)Query the given table, returning a Cursor over the result set.Parameterstable The ta... 阅读全文
posted @ 2013-08-15 14:13 魏滋珑 阅读(503) 评论(0) 推荐(0) 编辑
 
摘要: java.math.Math类常用的常量和方法:Math.PI 记录的圆周率Math.E记录e的常量Math.abs 求绝对值Math.sin 正弦函数 Math.asin 反正弦函数Math.cos 余弦函数 Math.acos 反余弦函数Math.tan 正切函数 Math.atan 反正切函数Math.atan2 商的反正切函数Math.toDegrees 弧度转化为角度 Math.toRadians 角度转化为弧度Math.ceil 得到不小于某数的最大整数Math.floor 得到不大于某数的最大整数例如:Math.floor(12.7) =12.0 Math.... 阅读全文
posted @ 2013-08-15 14:04 魏滋珑 阅读(1751) 评论(0) 推荐(0) 编辑
 
摘要: 1.获取屏幕尺寸、密度等信息。 1)最常用的方法: WindowManager windowManager = getWindowManager(); Display display = windowManager.getDefaultDisplay(); int w = display.getWidth(); int h = display.getHeight(); 2)用DisplayMetrics来获得参数: DisplayMetrics displayMetrics = new Disp... 阅读全文
posted @ 2013-08-15 13:27 魏滋珑 阅读(1074) 评论(0) 推荐(2) 编辑
 
摘要: android系统在Manifest.permission中有这样一条RECEIVE_BOOT_COMPLETED的定义,当你自己的程序加 入这个权限后,就可以在系统启动完毕后收到一条系统的广播,这个广播的标志为ACTION_BOOT_COMPLETED,因此我们只要定义一个 BroadcastReceiver用来接收这个广播,然后加入自定义的动作即可。代码如下: public class LocationLoggerServiceManager extends BroadcastReceiver { public static final String TAG = "... 阅读全文
posted @ 2013-08-15 13:09 魏滋珑 阅读(800) 评论(0) 推荐(0) 编辑
 
摘要: private long exitTime = 0; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN){ if((System.currentTimeMillis()-exitTime) > 2000){ Toast.makeText(getApplicationContext(), "再按一次... 阅读全文
posted @ 2013-08-15 12:54 魏滋珑 阅读(1184) 评论(2) 推荐(1) 编辑
 
摘要: 1 package com.iteye.androidtoast; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 6 import android.app.Activity; 7 import android.content.Intent; 8 import android.os.Bundle; 9 import android.view.View; 10 import android.view.View.OnClickListener; 11 import android.widget.Arr... 阅读全文
posted @ 2013-08-15 11:18 魏滋珑 阅读(738) 评论(2) 推荐(1) 编辑