Giter Site home page Giter Site logo

bandhook-kotlin's Introduction

Bandhook Kotlin

This project is a small replica of the app I developed some time ago. Bandhook can still be found on Play Store

At the moment it will only connect to LastFm and retrieve some music bands. It will let navigate to the artist detail. This is what you´ll get:

Bandhook Kotlin

The purpose of the project is to show a complex (at least in architecture) project entirely written using Kotlin. This example also supports the articles written in antonioleiva.com related to Kotlin for Android:

This sample project is still in development, and could easily break or have some messy code. However, any idea or suggestion to improve it will be welcomed. Feel free to open an issue if you think something could be improved.

How to use this project

You can use Android Studio or Intellij to work with this repository.

First thing you will need to compile this project is to get an API Key from Last.fm. It will we used to connect to the service that will provide artists info. Then create a resource file app/src/main/res/values/api_key.xml (this path is ignored by git) with the following content:

<string name="last_fm_api_key">YOUR_KEY</string>

The Kotlin plugin for Android Studio is also required.

Many ideas on how this project is organized were taken from Clean Contacts project, by PaNaVTEC. There are some slight differences, but reading How to start section will be helpful.

License

Copyright 2015 Antonio Leiva

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.

bandhook-kotlin's People

Contributors

antoniolg avatar bryant1410 avatar jacksonweekes avatar mabdurrahman avatar pgreze avatar plastix avatar tonilopezmr avatar vic-gonzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bandhook-kotlin's Issues

Update instrumentation tests

AndroidTestCase and ActivityInstrumentationTestCase2 come from old and deprecated Android platform testing API.

May we consider to migrate current UI tests to Espresso 3.0?

Gradle Core Plugins (plugin is not in 'org.gradle' namespace)

Hi, I got the error when build this project:

Error:(21, 0) Plugin [id: 'com.android.application'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Gradle Central Plugin Repository (plugin dependency must include a version number for this source)
    Open File

what should I do?

Change in readme regarding api key placement

In gitignore there is an instruction:

# Api key
app/src/main/res/values/api_key.xml

I believe the readme should tell about it and ask to store api key there rather than in the config.xml file

Move dependency injection to Dagger 2

Dagger 2 is supposed to be working on Kotlin, so it´s a good idea to try and move DI to that direction. Reasons:

  • Current DI is supported by language, which is really good. But it´s a bit verbose and hard to maintain.
  • Couldn´t find a way to make scoped injections, very useful for Android.
  • The sole reason of learning Dagger 2 and see how it fits in a Kotlin project.

Grade import error at the current state

Hi thank you for sharing this awesome project.

Right now when I download and try to launch using the Android Studio 3.0 Canary version, I get the following error:

Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'.
Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Related artists

An artist will show related artists, and a click will navigate to their detail.

Can't import

I tried to even update the gradle plugin, but it keeps failing.

At first it shows this:

image

And after trying to update, it shows this:

image

Albums

An artist will show their albums, and clicking on them will navigate to the album detail. Something similar to this could be enough for now:

image

Interactors x RxJava

Hi!

This isn't a issue, but it's more like some doubt.

The Interactor pattern is quite simular to the Command pattern, just returning some Event instead of being void and didn't support undo like we saw in design pattern books. In this case, it is wrong to create a second method to call if we have a presenter with 2 or more calls - e.g creating some action in DetailsActivity - to Interactors?

In bandhook the Thread Executor is from Path, which I cannot see working with RxJava. Those executors can be used with RxJava (I tried to accomplish that but without success)? I'm thinking to create some structure that the Interactor will return an Observable instead of some Event (I use this in normal Java development, but not Kotlin until now). If you think that this can be useful, I can made a PR to the project with this second approach.

AlbumsFragmentTest failing on testOnCreateView

val createdView = albumsFragment.onCreateView(layoutInflater, null, null)
// Then assertNotNull(albumsFragment.adapter)

is failing as the container is null, if we mock the container it will fail as it will search for the context.

Search

Allow Search functionality:

  • A search option on every screen
  • It will let find artists based on their name
  • A click on any items of the search will lead to artist detail

Unresolved reference: last_fm_api_key

I'm trying to build this via ./gradlew clean build and I'm getting following error :
`Download https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/27.0.2/support-annotations-27.0.2.jar
Download https://jcenter.bintray.com/com/google/code/gson/gson/2.7/gson-2.7.jar
Download https://jcenter.bintray.com/org/jetbrains/anko/anko-sdk15/0.10.4/anko-sdk15-0.10.4.jar
Download https://jcenter.bintray.com/org/jetbrains/anko/anko-design/0.10.4/anko-design-0.10.4.jar
Download https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common/1.0.3/common-1.0.3.jar
e: /Users/plasta/Desktop/Bandhook-Kotlin-master/app/src/main/java/com/antonioleiva/bandhookkotlin/di/DataModule.kt: (28, 100): Unresolved reference: last_fm_api_key

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2m 27s
`

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.