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

第一次练手 app,有很多设计上的疑问,主要是 content provider,求解答- -

  •  
  •   lintiven49 · Apr 14, 2016 · 13720 views
    This topic created in 3666 days ago, the information mentioned may be changed or developed.
    1.你们平时数据库什么选择时候用 content provider ?还是直接 helper 来操作..(不用 orm)
    2.当我内部一个服务需要对比数据库和网络上内容的时候,你们是去直接操作 helper 呢还是全部都用 content provider? 比如取出条件为 xxx 的条目 blablabla 这种自定义的查询是写在一个类里面用 content provider 调用还是 直接操作 helper- -
    3.一般是用嵌套查询还是多次查询?比如首页要取 类目->订阅 这时候类目下的订阅你们是一次取出来还是?

    这几天纠结死了- -总感觉不知道 content provider 和 helper 的分界 在哪里
    5 replies    2016-04-14 15:00:24 +08:00
    bqbkbz
        1
    bqbkbz  
       Apr 14, 2016 via Android
    只有自己一个 app 使用的数据的话就没必要用 content provider 了吧
    fashioncj
        2
    fashioncj  
       Apr 14, 2016
    helper
    saberpowermo
        3
    saberpowermo  
       Apr 14, 2016
    1 只有自己一个 app 使用的数据的话就没必要用 content provider 了吧 +1 根本没必要.
    2 helper 足够
    lintiven49
        4
    lintiven49  
    OP
       Apr 14, 2016
    ok,谢啦~决定不用 provider 了
    GhostFlying
        5
    GhostFlying  
       Apr 14, 2016
    Content Provider 实现了的好处是可以简化 loader ,以及如果要做搜索会方便点,不过区别也不算很大
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3267 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 13:16 · PVG 21:16 · LAX 06:16 · JFK 09:16
    ♥ Do have faith in what you're doing.