Android下getSystemService与getService的联系与区别?

xqhrs232 2012-03-21 09:31:57
Android下getSystemService与getService的联系与区别?
...全文
1024 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
swmz 2013-08-10
  • 打赏
  • 举报
回复
不错 ,受教了 谢谢
xqhrs232 2012-03-30
  • 打赏
  • 举报
回复
android下的系统service可以同时被多个进程同时访问???

搜索Context.POWER_SERVICE这个可以在很多地方文件里面找到!!!

搜索Context.LOCATION_SERVICE也是一样,也是多个地方出现了
qthsrs232 2012-03-21
  • 打赏
  • 举报
回复
可以通过getSystemService函数获取的SERVICE有没限制连接的客户断数量?Location Service很值得借鉴。GPS数据怎么到达各个APP(ACTIVITY)。
xqhrs232 2012-03-21
  • 打赏
  • 举报
回复
解析Android启动脚本init.rc && Android的启动模式
http://blog.csdn.net/xqhrs232/article/details/7362168

init.rc介绍说明性文件----Androidsourcecode/system/core/init/readme.txt


xqhrs232 2012-03-21
  • 打赏
  • 举报
回复
在init.rc里面启动的service服务跟在ServerThread服务线程类中启动的service服务有什么区别?

比如:init.rc(bluetoothd)------serverthread(bluetooth service)
xqhrs232 2012-03-21
  • 打赏
  • 举报
回复
Android初始化过程
http://blog.csdn.net/huanyufeng/article/details/5884060

1.
init进程(system/core/init/init.c---init.rc)------->zygote(app_process)------->javaVM------>systemserver(init1()++++init2( )).

2.
init进程先解析init.rc文件然后再是init.hardware.rc
qthsrs232 2012-03-21
  • 打赏
  • 举报
回复
serversocket.java这个类起什么这样的?目前还不清楚在JAVA层怎么使用SOCKET进行通信!!!
xqhrs232 2012-03-21
  • 打赏
  • 举报
回复

statusBar=new StatusBarManagerService(contex);
ServiceManager.addService(Context.STATUS_BAR_SERVICE,statusBar);




init2( )里面注册都注到Context里面去,所以可以用getSystemService函数访问了。
xqhrs232 2012-03-21
  • 打赏
  • 举报
回复
Android系统service的注册过程在systemserver.java的init2()函数里面。难道这里注册的service都可以用getSystemService函数访问吗?
xqhrs232 2012-03-21
  • 打赏
  • 举报
回复
getService与addService函数配对使用,一般使用在Android的C/C++层,一般会指定一个16字节大小的Service名称。
getSystemService只能获取在Context.java(frameworks/base/core/java/android/Context)下定义的Service。
qthsrs232 2012-03-21
  • 打赏
  • 举报
回复
ZygoteInit.java的main( )函数
{

registerZygoteSocket( );

}

frameworks/base/core/java/android/Net

android.net.LocalServerSocket
android.net.LocalSocket
android.net.LocalSocketAddress

LocalSocketImpl

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧