GithubHelp home page GithubHelp logo

thedancercodes / trakt-client-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walmyrcarvalho/trakt-client-test

0.0 2.0 0.0 371 KB

A simple Android trakt.tv client project made for a interview process.

Java 100.00%

trakt-client-test's Introduction

Recrutamento Android - Trakt Client

Projeto teste para processo seletivo.

Hero image

Sobre

O aplicativo consiste em um cliente simples do Trakt.tv que trás informações de uma série, como a lista de episódios de uma temporada e outros detalhes, como imagens e rating.

Demonstração (Vídeo): Link

Detalhes do projeto

API

Trakt.tv (Docs): http://docs.trakt.apiary.io/

Arquitetura e Libraries

  • Arquitetura MVP
  • API mínima 16 e target 23
  • Android Support Library 23.2.0
  • Cliente REST/HTTP com Retrofit + OkHttp
  • Carregamento de imagens com Picasso
  • View binding com Butterknife
  • Testes unitários com JUnit + Mockito
  • Testes de UI com Espresso

Requisitos

  • Layout diferente para landscape ✔︎
  • Tratamento de erros (falta de conexão, erros do servidor) ✔︎
  • Efeito parallax no cabeçalho ✔︎
  • Tornar a toolbar opaca conforme o scroll da listagem de episódios ✔︎
  • Testes automatizados ✔︎
  • Layout diferente para tablet ou orientação landscape ✔︎

Como gerar uma build?

Para fazer build do projeto é necessário criar um arquivo de nome secret.properties na raiz do projeto, contendo um Client ID válido do Trakt.tv no seguinte ormato:

API_KEY=your_client_id

Para conseguir o Client ID basta acessar esse link e criar uma nova aplicação no Trakt.tv.

Essa configuração é necessária pois dentro do build.gradle existe o método getAPIKey que lê o arquivo secret.properties e retorna o Client ID dinamicamente:

def getAPIKey() {
   	def Properties props = new Properties()
    props.load(new FileInputStream(new File('secret.properties')))
   	return props['API_KEY']
}

Dessa forma, podemos criar um buildConfigField custom no app/build.gradle:

buildConfigField "String", "API_KEY", "\""+getAPIKey()+"\""

E acessar esse valor dentro do projeto, através de uma constante da classe BuildConfig.java, que gerada automaticamente após o build do Gradle:

BuildConfig.API_KEY

Esse apprach é recomendado pois evita que o Client ID seja commitado junto com o projeto.

Licença

The MIT License (MIT)

Copyright (c) 2016 Walmyr Carvalho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

trakt-client-test's People

Contributors

walmyrcarvalho avatar

Watchers

James Cloos avatar Roger Taracha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.