V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
stdying
V2EX  ›  Android

service 数据交互

  •  
  •   stdying · Oct 14, 2015 · 12282 views
    This topic created in 3855 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   ·   748 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:36 · PVG 04:36 · LAX 13:36 · JFK 16:36
    ♥ Do have faith in what you're doing.