pushtorefresh / storio

Reactive API for SQLiteDatabase and ContentResolver.
Apache License 2.0
2.55k stars 182 forks source link

Sample Application is too complicated #622

Open careful7j opened 8 years ago

careful7j commented 8 years ago

Please, create a better (easier) sample application. Sample application should not rely on 25+ libraries and 9! projects. Thats cool that you know all of that, but some people may not. Sample app is very huge and it looks like some methods are already outdated.

If you want many people use the wonderful technology you designed, it should be easy to start with. Not everybody have 5+ years of expereince.

Rainer-Lang commented 8 years ago

What do you mean with "9! projects"?

careful7j commented 8 years ago
    // Parts of StorIO
    storIOCommon                              : project(':storio-common'),
    storIOSQLite                              : project(':storio-sqlite'),
    storIOContentResolver                     : project(':storio-content-resolver'),
    storIOSQLiteAnnotations                   : project(':storio-sqlite-annotations'),
    storIOContentResolverAnnotations          : project(':storio-content-resolver-annotations'),
    storIOCommonAnnotationsProcessor          : project(':storio-common-annotations-processor'),
    storIOSQLiteAnnotationsProcessor          : project(':storio-sqlite-annotations-processor'),
    storIOContentResolverAnnotationsProcessor : project(':storio-content-resolver-annotations-processor'),
    storIOTestCommon                          : project(':storio-test-common'),

That one

Rainer-Lang commented 8 years ago

That's the StorIO lib or better the parts of it. Later you will include only the parts you need eg contentresolver, sqlite,...

careful7j commented 8 years ago

Well, sample app contains all of that things.

Rainer-Lang commented 8 years ago

When did you start developing for android?

careful7j commented 8 years ago

At least one year already passed (or mayby more). Still studying however.

Rainer-Lang commented 8 years ago

My suggestion is - look at this parts which are really interesting for you right now, play with them and then look at the rest. I changed the sample app for me for testing. So I made my first steps. First, I'm honest, it was hard for me - but I wanted a db-lib with rxjava - and storio was the right choice. Do you know rxjava?

Focus on what you need, run the sample app and modify it.

careful7j commented 8 years ago

Yeap, i have already tried rxjava with retrofit, its quite awesome. Now i am studying database solutions, i have tried ormlite and realm and everything was fine there. However, here I am stuck. Mayby storio is not something I can take with my level of expereince (after a whole night spent I am starting to think so).

Rainer-Lang commented 8 years ago

Cool. Yes retrofit and rxjava are great. Storio is the perfect "addon". 😉 Keep trying - it's worth it. And ask explicit questions - "sample is too complicated" it's too general. The developers of StorIO are great and very helpful!

careful7j commented 8 years ago

Thank you, but it was not so much of a question, like a request from not very developed part of community :D. Just want to see an example of storio by itself, not with a lot of libraries integrated. Source code becomes extremely hard to understand and application by iteslf become heavyweight when there are so much things included. Hope you understand what i mean.

Rainer-Lang commented 8 years ago

I EXACTLY know what you mean. ☺️ But in the sample app there are a lot of more things inside which are worth to know it. Dagger2 is one of it. And look at the tests (if you are interested in testing, there is a wonderful project on github of one of the StorIO developers).

lenguyenthanh commented 8 years ago

If it's okay, I'll try to contribute a simpler sample for Storio.

artem-zinnatullin commented 8 years ago

Yo there guys :)

So, yeah, problem with Sample app is that some people ask for simple examples and some for complicated… It's totally worth to give both of them in somehow divided representation so you won't lost in it.

It's actually our bad for sure that sample app is not very obvious, we'll try to fix that in 2.0.

At the moment I'd just recommend to investigate time in learning SQLiteDatabase in Android (there are a lot of articles about it) and then realize that StorIO is wrapper around it :)

lenguyenthanh commented 8 years ago

@artem-zinnatullin yes, just try Sqlite to realize how beautiful StorIO is.

careful7j commented 8 years ago

Thanks in advance! You've made my day :) Looking forward for new sample app!

ValeriusGC commented 7 years ago

Thanks a lot to @skrzyneckik for basic sample. But it is as overly simplified example, alas. One would like to see really "печенюшки". At least:

skrzyneckik commented 7 years ago

@ValeriusGC

  • how to observe changes via Get?

To observer changes via Get you just need to observer query results as a RxJava observable - you can find how to use it here and this scenario is presented in storio-sample-app right here

Basic sample which I prepared is literally as basic as possible and storio-sample-app covers most of 'real' use cases. @artem-zinnatullin maybe it would be good idea to cover there this ManyToMany relation as well?

ValeriusGC commented 7 years ago

Of course, there is such hook, but no method to illustrate how changes are been observable. @artem-zinnatullin I made some changes in storio-sample-app.

Maybe you apply them to your sample?

nikitin-da commented 7 years ago

Would it be right to have 3 sample projects? 1) basic sample on java as is to explain how to get started 2) samples on java, with separate screen on every feature, like sqlite, content-resolver, many-to-many. 3) samples on kotlin for the same features //cc @artem-zinnatullin @pbochenski

careful7j commented 7 years ago

Hi again! Topic starter is back and I have launched Storio!!111 Yeaaa!!111 But it took me around a hour :C I should say that Basic Sample App is still NOT that easy to copy paste from. I offer you a new step of simplification: to make Basic Sample App stand-alone from the whole project.

So build gradle will have this:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {  // the latest version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
}

And this:

compile 'com.android.support:design:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile('com.android.support:appcompat-v7:25.0.1') {
    exclude group: 'com.google.android', module: 'support-v4'
}

compile 'com.pushtorefresh.storio:sqlite:1.12.0'
compile 'com.pushtorefresh.storio:sqlite-annotations:1.12.0'
apt 'com.pushtorefresh.storio:sqlite-annotations-processor:1.12.0'

Instead of Nothing and this:

compile libraries.appCompat
compile libraries.recyclerView
compile libraries.storIOSQLite
compile libraries.storIOSQLiteAnnotations
apt libraries.storIOSQLiteAnnotationsProcessor

Since it's basic app and it should not require a whole project's source code to just try what storio is. (It could have taken me around several minutes if I decided to open it on my laptop). Thank you for the job done, now I can really launch storio and use it in my projects!