1

I am looking into mobile app development, and I had some questions about the android platform.

  1. Does the android platform use a central settings and preferences page (much like the gears icon on an iOS device)?

  2. I've been reading about services. Are these what I would use if I wanted to develop an application that doesn't have a UI (think something like the drop box client)?

  3. In my reading about services I read that the android OS will kill your service when it thinks that it needs to reclaim resources. Is there a way to ensure a service wouldn't be killed?

  4. How much control would I as a developer have over the physical hardware? Say if I wanted to make an app to block distractions, and to do this I would need to control the networking interfaces beyond purposely misconfiguring these interfaces to block their connection? Can I programmatically turn off these interfaces?

4

1 回答 1

2
  1. 每个单独的应用程序都有自己的设置页面,但这通常是使用内置的 Android 设置类创建的(您可以只是子类PreferenceActivity

  2. 每个应用程序都必须有一个活动(带有 UI 的屏幕),但是可以,您可以在服务中完成大部分工作,这类似于台式计算机上的后台进程

  3. 没有办法确保Android不会在没有root手机的情况下终止您的服务。然而,

“如果服务绑定到具有用户焦点的活动,那么它就不太可能被杀死,如果服务被声明在前台运行(稍后讨论),那么它几乎永远不会被杀死”链接

  1. 是的,您可以通过Android API访问任何硬件(GPS、WiFi、蓝牙、3G 无线电、相机等)。但是,您必须向用户请求安装时许可才能处理它们。此外,其他程序可以重新打开它们。
于 2011-10-10T16:09:52.567 回答