一、这是一篇关于如何将自定义的 homescreen 设定为Android的默认主页,而不需要用户选择的讨论贴,原文如下:

Another additional info: If you want that your homescreen is always the default and that the system doesn't ask to choose between different home screens simply put it that way: XML:

<intent-filter priority="1">

<action name="android.intent.action.MAIN"></action>

<category name="android.intent.category.HOME"></category>

<category name="android.intent.category.DEFAULT"></category><

category name="android.intent.category.MONKEY"></category>

</intent-filter>

The difference to the XML above is android:priority="1". It seems that the default home screen has priority 0 and therefore setting the priority of your home screen to 1 is sufficient to force the usage of your home screen.

二、

其实,对于Ophone跟Android来说有许许多多的不一样,比如说联网方式,还比如一些UI的细节实现等

下边的是我收集到得跟Android略有不同的获取CellId跟IMEI的代码:

TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();

int cellid =location .getCid();

String imei = tm.getDeviceId();

注:别忘加权限啊

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>

这样就成了,呵呵

更多相关文章

  1. Do's and Don'ts for Android(安卓)development
  2. OpenGL ES教程VI之纹理贴图(原文对照)
  3. 【转】Android(安卓)SDK版本与API Level对照表
  4. android driver for ubuntu 手机驱动
  5. 不让屏幕翻转扰乱你的进度对话框
  6. 【Android平台】 Alljoyn学习笔记四 Android(安卓)Core API参考
  7. android 按两次返回键退出
  8. Android教程收集贴
  9. android 9.0 SD卡权限问题 文件管理器没有权限

随机推荐

  1. android中shape的属性
  2. android兼容oppo手机刘海屏解决方案
  3. 详解Android AM命令
  4. Android学习之 使用依赖注入函数库Robogu
  5. android install
  6. Android 中插件的编写方法
  7. android开发之布局常用属性
  8. 安卓中RelativeLayout布局
  9. Android异步处理一:使用Thread+Handler实
  10. Android中EditText的inputType属性值