码迷,mamicode.com
首页 >  
搜索关键字:getsystemservice    ( 396个结果
Android获取手机状态和监听手机来电状态
获取手机状态: import android.content.Context; import android.telephony.TelephonyManager; //获得相应的系统服务 TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); /**...
分类:移动开发   时间:2015-01-28 16:01:33    阅读次数:217
监听系统音量发生变化
AudioManager audioManager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE) ; ????????sound = (SeekBar) findViewById(R.id.sb_sound); ????????/** * 注册...
分类:其他好文   时间:2015-01-27 16:36:21    阅读次数:176
振动和抖动效果
1、得到系统的振动器Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);2、设置振动时间vibrator.vibrate(500);// vibrator.vibrate(1000); // long[] pattern...
分类:其他好文   时间:2015-01-23 06:06:18    阅读次数:112
Android检测网络是否可用并获取网络类型
在类中使用getSystemService的时候需要这样进行使用:1.public class JajaMenu extends Activity { public static JajaMenu instance; @Override public void onCrea...
分类:移动开发   时间:2015-01-19 15:40:05    阅读次数:221
2种方法自定义对话框
1:全部布局自定义 LayoutInflater addBlackNumberInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); View view = addBlackNumberInflater.inflate(R.layout.ale...
分类:其他好文   时间:2015-01-15 16:05:17    阅读次数:165
获取android手机基本信息
Java代码/***获取android当前可用内存大小*/privateStringgetAvailMemory(){//获取android当前可用内存大小ActivityManageram=(ActivityManager)getSystemService(Context.ACTIVITY_SER...
分类:移动开发   时间:2015-01-15 09:19:32    阅读次数:221
心跳震动Vibrator使用
设备振动器,可以设置震动的频率,模拟心跳的震动。 获取设备振动器有两种方法: vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE); vibrator = (Vibrator) getApplicationContext().getSystemService(Service.VIBRATOR_SERVICE); 开...
分类:其他好文   时间:2015-01-13 19:55:05    阅读次数:295
加速度传感器Accelerometer
Android系统为传感器支持强大的管理服务,开发传感器应用的步骤如下: (1)调用Context的 getSystemService(Context.SENSOR_SERVICE)方法获取Sensor Manager对象,SensorManager对象代表系统的传感器管理服务。 (2)调用SensorManager的getDefaultSensor(int type)方法来获取制定类型的传感...
分类:其他好文   时间:2015-01-13 14:23:54    阅读次数:184
Android 判断是否能真正上网
Android里判断是否可以上网,常用的是如下方法: /** * 检测网络是否连接 * * @return */ private boolean isNetworkAvailable() { // 得到网络连接信息 ConnectivityManager manager = (ConnectivityManager) getSystemService(Context...
分类:移动开发   时间:2015-01-12 21:05:03    阅读次数:229
[android] 百度地图开发 (三).定位当前位置及getLastKnownLocation获取location总为空问题
前一篇百度地图开发讲述"(二).定位城市位置和城市POI搜索",主要通过监听对象MKSearchListener类实现城市兴趣点POI(Point of Interest)搜索。该篇讲述定位当前自己的位置及使用getLastKnownLocation获取location总时为空值的问题。其基本步骤如下: 1.先实例LocationManager,getSystemService(Context.LOCATION_SERVICE)再确定获取系统的定位服务;2.选择位置提供器...最后提出问题及解决方法包括源码...
分类:移动开发   时间:2015-01-11 06:15:01    阅读次数:468
396条   上一页 1 ... 23 24 25 26 27 ... 40 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!