RxJava for Android Developers /
RxJava for Android Developers begins by inviting you to think about programming and data the reactive way. This engaging, hands-on essential reference introduces you to the central pattern of RxJava for Android, then explains the View Model before exploring highly sought-after app features like chat...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Autor Corporativo: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Manning Publications,
2019.
|
Edición: | 1st edition. |
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Machine generated contents note: pt. 1 Core reactive programming
- 1. Introduction to reactive programming
- Perhaps you picked up this book because ...
- Don't read this book if ...
- OOP, Rx, FP, and FRP
- Benefits of Rx
- What you code is what you get
- The reactive landscape
- What do you need to know before you start?
- About this book
- RxJava 2 and Android
- Setting up the Android environment
- Java 8 lambdas
- Deep dive into Rx: Live search
- Project setup
- Text input as an emitter of data
- The publish-subscribe pattern
- Text input as an observable
- Filtering observables
- Bending time
- Bending time to your benefit
- Debounce: The bus stop operator
- Putting your code into Android
- Principles of reactive programming
- Events and marble diagrams
- 2.Networking with observables
- RxJava and event streams
- Subscribers
- RxJava 2 observable types
- Subscribing to and converting different observables
- Note continued: What happens when you make a normal network request?
- What happens when you make a network request with an observable?
- Network request as an observable
- Example: An RSS feed aggregator
- The feed structure
- Getting the data
- The combineLatest operator
- The Rx code so far
- Asynchronous data processing chains
- Putting the list in order
- The map operator
- Brief introduction to immutability
- Error handling
- Adding more feeds to the client
- 3. Building data processing chains
- Different roles of observables
- Events vs. reactive state
- Internal state of an observable
- Arrow diagrams and different observable types
- Example: Credit card validation form
- First step: Expiration date
- Credit card number type and checksum
- CVC code validation
- Putting it all together
- The abstraction level of reactive programming
- How RxJava works
- 4. Connecting the user interface with networking
- Subscriptions explained
- Note continued: Terminating subscriptions
- RxJava 2 concepts and subscription management
- Advanced Rx chains example: Flickr search client
- Setting up the Flickr client project
- Overview of the search chain
- Step 1 A simple hardcoded search
- Making it click
- Implementing the reactive chain
- How switchMap works
- Getting thumbnail information
- Step 1 Expand the list into an observable
- Step 2 Apply operations to each item individually
- Step 3 Collect results
- The complete solution
- Adding a username from another API
- 5. Advanced RxJava
- Observables and subjects in detail
- Example: File browser
- User flow of the File Browser app
- Getting the file listing for a directory
- Threading basics
- Threading in functional programming
- Changing the thread by using getFileListingObservable
- Making the file listing dynamic
- Making the list click
- Different types of subjects
- Using a subject as the FileObservable
- Note continued: Adding buttons for Previous and Root
- Expanded graph for Previous and Root
- Improved version with cleaner observables
- The Previous button
- Putting it all together
- The detailed graph
- The full code so far
- Saving and releasing the subscriptions
- A final note on subjects
- pt. 2 Architectures in RxJava
- 6. Reactive view models
- The view layer
- Platform containers
- View models
- The blueprint of a view model
- Connecting views and view models
- The whole picture
- View model lifecycle
- View models and the Android lifecycles
- The view affinity of the code
- 7. Reactive architectures
- Fundamentals of reactive architectures
- Model-View-View model
- Reactive model
- Retrieving data from the model
- Coffee break
- Revising the file browser
- Constructing the model for the file browser
- Using the model
- Rules of the model and its consumers
- Single source of truth
- Persisting app state
- Note continued: BehaviorSubjects and stores
- Simple SharedPreferencesStore
- 8. Developing with view models
- View models and the view
- Example: Tic-tac-toe
- Drawing the game grid
- Making it interactive
- Events vs. reactive state
- Immutable data and the game grid
- Adding the code for interaction
- Wrapping the logic into a view model
- Click coordinate processing
- Changing turns
- Filtering illegal moves
- Winning conditions
- One more thing: Restarting the game
- 9. Expanding existing Rx apps
- Working with existing reactive code
- The game of Connect Four
- Updating grid size and assets
- Checking for valid moves
- Saving and loading the game
- Creating the model
- Sharing the model
- Loaded games activity
- PersistedGameStore
- Saving games
- Loading games
- 10. Testing reactive code
- Reactive architectures and testing
- Test granularity
- The pyramid of dependencies
- Unit-testing basics
- Testing reactive chains
- Note continued: TestObservable class
- Synchronous or asynchronous
- Writing tests for view models
- Choosing what to test
- Testing the GameViewModel initial state
- Testing partial observable chains
- Testing Connect Four drop logic
- pt. 3 Advanced RxJava architectures
- 11. Advanced architectures: Chat client 1
- Chat client with WebSockets
- How to transfer messages
- WebSockets
- WebSockets as broadcasters
- Connecting to the server
- ChatMessage structure
- Sending ChatMessages
- Wrapping listeners into observables
- Basic Ul
- Showing messages
- The view model
- Accumulating ChatMessages
- Putting together message processing
- Consuming values from the view model
- View model lifecycle
- Making the view model lifecycle
- 12. Advanced architectures: Chat client 2
- View models, stores, and the model
- Message pending state
- Handling state updates
- Store as an aggregator
- The code for the store
- Implementing pending messages
- Note continued: Replacing pending messages with confirmed ones
- Updated store code
- Pending state handling code
- The model
- The code for the model
- Model lifecycle
- Singleton modules
- Android tools for production use
- 13. Transitions with Rx
- Transitioning between states
- How it should have been
- Animation progress using one number
- Reactive parametrization
- Example: The fan widget
- Setting the transformations for the child views
- Animating with RxJava and Android
- Code changes to FanView
- The view model
- View model logic
- Animating parametrized values in view models
- animateTo operator
- animateTo operator on Android
- Adding a dimmed background
- 14. Making a maps client
- Maps example
- Getting started with map tiles
- Making an initial view model
- Calculating tiles based on zoom level
- Using the offset to move tiles
- Dragging the map
- The code so far
- Viewport and hiding tiles
- Loading map tiles
- Note continued: Adding zoom-level controls
- Adding support for map coordinates.