stdying
V2EX  ›  Android

service 数据交互

  •  
  •   stdying · Oct 14, 2015 · 13006 views
    This topic created in 4042 days ago, the information mentioned may be changed or developed.
    多个 activity 和一个 service 交互,会选择哪种方式:

    接口
    远程服务
    事件总线
    广播

    还是有其他更好的方式
    4 replies  •  2015-10-15 14:45:24 +08:00
    morethansean
    morethansean
    Oct 14, 2015
    1
    这在 android developer 的官网上不都有详细描述吗?
    stdying
    stdying
    OP
    Oct 14, 2015
    2
    @morethansean 看了,还是想问问有没有更好的方法
    lusyoe
    lusyoe
    Oct 14, 2015 via Android
    3
    更好说不上,不过也可以使用本地文件或数据库之类的存储数据,然后都去读写就好啦
    stdying
    stdying
    OP
    Oct 15, 2015
    4
    @lusyoe 这个方法我也用过,当时保存文件,而且数据比较大,序列化传递内存溢出
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   874 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:46 · PVG 07:46 · LAX 15:46 · JFK 18:46
    ♥ Do have faith in what you're doing.