多项服务,同一Android应用 [英] Several services, Same Android app

查看:96
本文介绍了多项服务,同一Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前维护着一个使用大量胖服务处理功能的Android应用程序:

I currently maintain an Android application which uses a big fat services handling :

  • 蓝牙通信(通过应用程序使用情况恒定)
  • 文件压缩
  • Http请求
  • 节省画布(该应用程序使用Samsung Pen SDK,可保存大量画布)

我想将服务拆分为新的服务.我是不是该?我会通过为这些服务使用太多内存来减慢我的应用程序速度吗?维护会变得一团糟吗?

I'd like to split the service into new namely services. Should I? Am I going to slow my app by using too much memory for those services? Is it going to be mess to maintain?

提前谢谢

推荐答案

如果管理得当,可以降低内存和CPU使用率.如果应用程序的某些部分仅需要文件压缩-没有必要使用其他所有文件. 此外,服务本身不会使用大量资源,这对您在内部做的事情很重要.

If managed properly several services can decrease memmory and CPU usage. If some part of the app needs only File compression- no point for it to use everything else. Also services does not use alot of resources by themselves- its important what you do inside.

查看意图服务它们对于文件压缩很有用和Canvas,而正常运行的服务对于您的蓝牙通信很有用(如果一直很需要蓝牙通信的话).

Look at Intent Service They can be usefull for your File Compression and Canvas, while normal always running service is usefull for your Bluetooth communication(if its really needed all the time).

这篇关于多项服务,同一Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆