开发者

Android development specifics

开发者 https://www.devze.com 2023-04-12 13:39 出处:网络
I am looking into mobile app development, and I had some questions about the android platform. Does the android platform use a central settings and preferences page (much like the gears icon on an i

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?


  1. Each individual application has its own settings page, but this is generally created by using the built-in Android settings class (you can just subclass PreferenceActivity)

  2. Every application must have an activity (A screen with a UI), but yes, you can do the majority of your work in a service, which is analogous to a background process on a desktop computer

  3. There is no way to ensure that Android won't kill your service without rooting the phone. However,

"If the service is bound to an activity that has user focus, then it's less likely to be killed, and if the service is declared to run in the foreground (discussed later), then it will almost never be killed" link

  1. Yes, you have access to any hardware (GPS, WiFi, Bluetooth, 3G radios, camera, etc) through the Android API. You will have to request an install time permission from the user in order to deal with them, however. Also, other programs can turn them back on.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号