All Projects → TayfunCesur → Pokehub

TayfunCesur / Pokehub

Licence: other
This is a sample project that uses Graphql API's with Rx implementation.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Pokehub

nytclient-android
This sample app is created to demonstrate the usage of Android Architecture Components with MVVM architecture
Stars: ✭ 24 (-40%)
Mutual labels:  data-binding, dagger2, glide, architecture-components
flickr-android
A small sample app to showcase architecting app using Clean Architecture and MVVM
Stars: ✭ 25 (-37.5%)
Mutual labels:  data-binding, dagger2, architecture-components
movies
An example approach for modularization, reactive clean architecture and persistancy.
Stars: ✭ 110 (+175%)
Mutual labels:  dagger2, repository-pattern, architecture-components
Simple-Notes-Kotlin-App
✍️ Simple Note Making App use mvvm architecture , dagger , coroutines and navigation component. Features includes 🗒️ create , edit and ❌ delete notes
Stars: ✭ 40 (+0%)
Mutual labels:  dagger2, repository-pattern, architecture-components
BESTV
Android TV App powered by TMDb. It is a easy way to find the best TV content, the top movies, series... all of that in your TV.
Stars: ✭ 49 (+22.5%)
Mutual labels:  dagger2, glide, lottie
Wanandroid
🏄 基于Architecture Components dependencies (Lifecycles,LiveData,ViewModel,Room)构建的WanAndroid开源项目。 你值得拥有的MVVM快速开发框架:https://github.com/jenly1314/MVVMFrame
Stars: ✭ 410 (+925%)
Mutual labels:  dagger2, glide, architecture-components
Blockchain Tracker
A blockchain market tracking app. Example implementation of reactive clean architecture and testing.
Stars: ✭ 30 (-25%)
Mutual labels:  dagger2, repository-pattern, architecture-components
Price Tracker
Price Tracking Application - An experimental Kotlin Android project with complex android app requirements.
Stars: ✭ 80 (+100%)
Mutual labels:  dagger2, repository-pattern, architecture-components
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (+217.5%)
Mutual labels:  dagger2, repository-pattern, architecture-components
FoodApp
Proof of concept for food app [JetPack + Coroutines + Flow + MockK + JaCoCo coverage + SonarQube]
Stars: ✭ 25 (-37.5%)
Mutual labels:  repository-pattern, architecture-components
BakingApp
Udacity Android Developer Nanodegree, project 2.
Stars: ✭ 54 (+35%)
Mutual labels:  dagger2, glide
Hibiscus
Hibiscus, mobile microblogging application.
Stars: ✭ 14 (-65%)
Mutual labels:  dagger2, glide
Games
The Games app has two features which are listing and showing detail of games.
Stars: ✭ 15 (-62.5%)
Mutual labels:  dagger2, repository-pattern
wikilight
A lightweight Wikipedia Client
Stars: ✭ 50 (+25%)
Mutual labels:  dagger2, repository-pattern
FlickOff
A lite movie guide app, with MVVM architecture, that lets you discover movies from TMDb.
Stars: ✭ 31 (-22.5%)
Mutual labels:  dagger2, glide
Kriptofolio
Free open source minimalistic cryptocurrencies portfolio app for Android.
Stars: ✭ 79 (+97.5%)
Mutual labels:  data-binding, glide
ContactsApp
Go-Jek Engineering Task Used MVP and Unit Testing Espresso, Mock Webserver and Activity Instrumentation Tests ,RxJava + RxAndroid + Retrofit 2 + OkHttp 3 + Dagger2 + ButterKnife+ Glide + Active Android ORM
Stars: ✭ 21 (-47.5%)
Mutual labels:  dagger2, glide
AndroidMultiModuleCleanArchTemplate
An Android kotlin project template with Dagger2, Rx and Architecture Components
Stars: ✭ 33 (-17.5%)
Mutual labels:  dagger2, architecture-components
DaggerExoPlayer
This repository demonstrates ExoPlayer injection with Dagger2
Stars: ✭ 58 (+45%)
Mutual labels:  dagger2, architecture-components
MVVM-Demo
This demo for MVVM Design pattern for android
Stars: ✭ 20 (-50%)
Mutual labels:  glide, repository-pattern

PokeHub

This is my personal project to learn about new tech for me. This is a sample project that uses Graphql API's with Rx implementation. If you are bored with REST API's and create a model class for every new API, go forward! :)

Libraries



So what is the difference between REST?

As I am an Android Developer, I can compare them in client side.Rest is network architectural concept, but Graphql is a query language.Apollo Android is a good client framework for Graphql

  • In Apollo-Android, you don't have to create your own classes to retrieve network response.
  • Once you define your query like below, it will generate your model class automatically. That is really good thing, if you have knowledge about traditional way.
query PokemonRepository($first:Int!){
  pokemons(first:$first) {
    id
    image
    name
  }
}

The above query is equalivent of some REST API. This is the way to define a new API in Graphql. And as you see, it's so simple.

RX implementation

With Apollo-Rx support dependency, you can use Apollo Calls with Rx. For this, you must add this,

implementation "com.apollographql.apollo:apollo-rx2-support:$apolloVersion"

This dependency is in the end of the Apollo's github page. So it's pretty hard to find. After add this dependecy, the rest of work is below,

var observable = Rx2Apollo.from(apolloClient.query(PokemonRepositoryQuery.builder().first(count).build()))
          .map {  
               it.data()?.pokemons()  
          }

That's it. Now you have your observable and you must just subscribe it and observe the incoming datas :)

Warning for Dagger2 fans

While setting up the project, you must add the graphql folder under the app/src folder. You can just put the API.graphql file under there and you can use it in proper way. But if you want use dagger, you must put it under the app/src/graphql/{PACKAGENAME}/ folder. I wasn't careful while I was doing this and I struggled for this issue about 2 days. Dagger does not recognize your auto-generated classes if you don't put them under the app/src/graphql/{PACKAGENAME}/ folder.

Outputs

Thanks

Thanks for @lucasbento to provide these useful API's. Graphql Pokemon API

Licence

Copyright 2019 Tayfun CESUR

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].