stdying
V2EX  ›  Android

service 数据交互

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

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

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