Coder Social home page Coder Social logo

android-apicalls's Introduction

EXTREMELY IMPORTANT:


New RXJava: https://github.com/amitshekhariitbhu/RxJava2-Android-Samples

App as view tutorial... this is what I'm doing

Do permissions this way?

GUAU:

THIS IS HUGE:

CUSTOM VIEWS:

Todo:

  • Load from web deeplink (how do these even work?!)

Retrofit factory

Permissions on demand

Network status

Social login

API Calls cache with RxCache

Realm for local storage database.

Glide para cargar imagenes

Picaso para cacheo de imagenes

Images add much-needed context and visual flair to Android applications. Picasso allows for hassle-free image loading in your application—often in one line of code!

Dialogs

https://github.com/afollestad/material-dialogs


Testing

Repository cache: caching when user goes offline

Retrofit to Domain Entities

Cache


Done:

  • Stop weird refreshing. Remove progressbar status right having UI elements populated.

UseCases

RxJava and RxAndroid

Retrofit

Add DependencyInjecion

Working with views

  • Activity or Fragment

    • Recibe: Presenter
    • setea/esconde/muestra Fragments
  • Presenter:

    • Recibe: UseCase
    • Recibe: UserModelDataMapper
    • Internamente implementa:
      • private final class xxxSubscriber extends Rx.Subscriber

PageAdapter vs FragmentPagerAdapter vs FragmentStatePagerAdapter

  • FragmentPagerAdapter
    • Fragments are detached, NOT destroyed.
    • Useful for SMALL list of fragments.
    • Remains in memory. Fills up memory and app will crash if lots of fragments.
    • Use for static data not coming from network and does not require calculations.
  • FragmentStatePagerAdapter
    • Works well for LARGE lists.
    • It destroys fragments when not used.
    • Not kept in memory (as it keeps destroying).
    • Requires proper use of CACHING (eg: repos) when using data from network or heavy calculations.
  • PageAdapter
    • Items are destroyed.
    • Useful for SMALL lists.

android-apicalls's People

Contributors

nilportugues avatar

Watchers

 avatar  avatar  avatar

android-apicalls's Issues

repository to datasource

repository becomes:

  • data/source/api/UserApiDataSource.java
  • data/source/local/UserLocalDataSource.java
  • data/source/UserDataSource.java

You can apply NetworkState as an injection, and check if there's connection or not and fallback to local data if available to minimize downtime when losing connectivity

Presenters get a Repository and a View

For instance

    /**
     * Creates a presenter for the add/edit view.
     *
     * @param taskId ID of the task to edit or null for a new task
     * @param tasksRepository a repository of data for tasks
     * @param addTaskView the add/edit view
     */
    public AddEditTaskPresenter(
            @Nullable String taskId, 
            @NonNull TasksDataSource tasksRepository,
            @NonNull AddEditTaskContract.View addTaskView
    ) {
        mTaskId = taskId;
        mTasksRepository = checkNotNull(tasksRepository);
        mAddTaskView = checkNotNull(addTaskView);

        mAddTaskView.setPresenter(this);
    }

Presenters can Subscribe or Unsbuscribe

This is just an example from google. Make one based on Rx.Observables...

Obviously they can do more things, but not included in the interface.

package com.example.android.architecture.blueprints.todoapp;

public interface BasePresenter {

    void subscribe();

    void unsubscribe();

}

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.