The document provides an overview of the Android infrastructure and key concepts:
(1) It describes the layers of an Android application including the presentation layer, application logic layer, and domain layer.
(2) It explains important Android concepts such as the Android runtime environment, Dalvik virtual machine, application lifecycle and activities, and use of contexts.
(3) It discusses alternatives for common tasks like dependency injection with RoboGuice and Dagger, handling resources and views with ButterKnife and AndroidAnnotations, and accessing data with SQLite and ORMLite.
(4) It also briefly covers testing approaches on the DVM and JVM using AndroidTestCase, Robotium, and Robolectric
This document outlines the necessary software and tools for a project including Java Runtime Environment (JRE) and Java Development Kit (JDK) from Oracle, Android Studio and Android Development Tools (ADT) from Google, version control through Git and GitHub, and the Gradle build system.
Dagger provides an alternative way to manage object dependencies through dependency injection. It uses compile time annotation processing to generate code that handles dependency resolution. Dagger eliminates the need to manually pass dependencies between objects. It supports features like lazy injection, providers, and scopes to control object lifecycles. The New York Times leveraged Dagger to decompose activities and share singletons like presenters across an application.
Dagger is a dependency injection framework that helps manage object creation and dependencies. It allows injecting dependencies into classes rather than having them directly instantiate dependencies. This improves testability. The document discusses how Dagger is used at the New York Times, including setting up modules, components, scopes like activity scope, and testing with Dagger. Qualifiers are used to provide different implementations for different flavors. Modules provide dependencies, components compose modules and inject dependencies. This architecture allows scaling across build variants and libraries while improving testability and code organization.
ºÝºÝߣs for our (John Rodriguez and myself) talk at Droidcon SF: http://sf.droidcon.com/schedule
For the past 3 years, Square Register Android has leveraged Dagger ? to wire up Java objects. However, the app scope hierarchy and complexity increased and we started having bugs and crashes related to scoping errors. This talk will show how to structure an app around Dagger2 ? and present a strategy for incrementally migrating from Dagger1 to Dagger2.
Here are slides from basic training for Gradle.
This training is aimed to help Java Developers to get hands-on experience to use Gradle as a primary build tool for Java source code starting from simple compilation continuing with different kinds of tests and finishing with code quality analysis and artefacts publishing.
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...Dicoding
?
Gradle is a build automation tool for multi-language projects that can be used for Android development. It provides a declarative domain-specific language for declaring tasks like compiling, packaging, and testing. Gradle allows customizing build configurations, dependencies, signing, flavors, and more through build files. Its primary advantages include flexibility, extensibility through plugins, and being free and open source.
- Gradle is a build automation tool that uses a Groovy-based domain-specific language to define software builds.
- It aims to provide flexibility, performance, and ease of use for builds of any size, from small to large multi-project builds.
- Gradle supports many languages and frameworks including Java, Groovy, Scala, and C/C++ and integrates with tools like Maven and Ant.
The document discusses Gradle, an open-source build automation tool. It provides an overview of Gradle's benefits such as scripting flexibility, incremental builds, and IDE project generation. It also covers key Gradle concepts like dependency management, testing, publishing artifacts, and custom tasks/plugins.
Gradle is more than just an ANT replacement for building Android projects. It aims to make code and resource reuse easy through dependencies, create multiple app variants through flavors and build customization, and integrate well with IDEs. Gradle uses Groovy and allows customizing builds through tasks, dependencies, flavors, and build configurations to generate different APKs for debugging, releasing, and distributing through markets.
Gradle is a build automation tool that uses Groovy as its configuration language. It aims to provide a flexible, customizable, and extensible build system that understands Ant and Maven builds. Gradle builds upon the concepts of Ant and Maven but aims to provide a more flexible and customizable build system. It supports various programming languages and frameworks out of the box and has plugins for additional functionality. Gradle builds are defined using Groovy build scripts and it supports various IDEs and continuous integration servers.
Robert Munteanu presented on the Apache Sling IDE Tooling. The presentation covered the context and major features of the IDE tooling, including bundle deployment, content synchronization, and a content navigator. It also demonstrated the tooling through an example blog application, showing how to work with bundles, scripts, and content. The tooling integrates FileVault and provides APIs and utilities to enable features like content synchronization and transport between the IDE and runtime.
Architecting your GWT applications with GWT-Platform - Lesson 02rhemsolutions
?
This document discusses architecting a GWT application with the GWT-Platform framework. It recommends using a Model-View-Presenter architecture and describes some MVP frameworks for GWT including gwt-platform. It provides an overview of how to structure an app with GWT-Platform and GXT3 including using places, tokens, presenters and dependency injection with GIN. It also covers styling the app with ClientBundle and includes sample code for creating a default presenter.
This talk contains an overview of the Sling IDE tooling which has been under development under the Apache Sling project for the last year. It will focus on how a developer can connect his/her IDE to an Apache Sling installation and develop against it without the need to use other tools. We will also provide an intro to the technical foundations of the IDE tooling, for those interested in contributing.
Modularizing a project is never easy, a lot of files to move and the dependencies between them is not always what we expect. Then the Dagger configuration used in a single module project often doesn't scale well to a multi module project. Hilt is opinionated about the configuration to use (we don't need to argue anymore about using component dependencies or subcomponents!) and this configuration works perfectly even in a multi module project. In this talk we'll see first an introduction to Hilt and a comparison with Dagger to understand why it's easier to configure. Then we'll see how to leverage it in a multi module project (both in a standard layered architecture and in a Clean Architecture that uses the Dependency Inversion) to improve build speed and code testability. Spoiler alert: using sample apps that include a single feature in the app helps a lot!
Gradle plugins, take it to the next levelEyal Lezmy
?
It's now a long time Gradle is the official build system for Android. And as a very good developer you already switched to it, and you customize it depending on your needs. Most of the time, the cleaner way to manage all these customizations is to build Gradle plugins. During this talk you will discover best practices about building your plugin to make it a good citizen, more efficient, and more famous!
This presentation will tell about:
- Building a Gradly DSL
- Interact with the Android Gradle Plugin
- Test your project on the good way
How To Dependency Inject a Kitten: An Introduction to Dagger 2Todd Burgess
?
An introduction to using the Dagger 2 dependency injection framework for Android applications. Brief explanation of dependency injection and a example of how to implement Dagger 2. Includes a real world example of Dagger 2
Friday session where we explained what is gradle and some of the hidden features and possibilities that gradle gives to developers to customize their builds in a clean and easy way.
The document provides an introduction to Gradle, an open source build automation tool. It discusses that Gradle is a general purpose build system with a rich build description language based on Groovy. It supports "build-by-convention" and is flexible and extensible, with built-in plugins for Java, Groovy, Scala, web and OSGi. The presentation covers Gradle's basic features, principles, files and collections, dependencies, multi-project builds, plugins and reading materials.
This document summarizes a presentation about improvements to Gradle's daemon feature in version 3.0. The daemon runs as a long-lived background process to speed up builds. New features include the daemon being enabled by default, being more robust on Windows, and integrating with build scans. The daemon also becomes more resource-aware and intelligent over time through machine learning. Users are encouraged to try the new daemon features and provide feedback to further improve Gradle's performance.
Grails 4 takes the powerful and flexibility of the Grails framework to a new level, with the latest versions of core frameworks like Spring 5.1, Spring Boot 2.1, Gradle 5, and Groovy 2.5. Additionally, Micronaut is now part of the Grails foundation, allowing many powerful features from Micronaut to be used natively within your Grails apps. In this talk, we¡¯ll look at how you can upgrade your Grails 3 project (with a little aside for Grails 2 projects as well) to Grails 4, and get a taste of the new features at your disposal in this exciting new release.
This document summarizes a presentation given by Ken Sipe on Gradle. It begins with an introduction of Ken Sipe and his background. It then provides an overview of existing Java build tools like Ant, Maven, and Ant with Ivy. It describes some shortcomings of Ant and Maven and introduces Gradle as a build tool built on Ant and Ivy but using Groovy as a build DSL. The document outlines key functionality of a build system and shows examples of simple Gradle build files. It discusses additional Gradle features like tasks, dependencies, plugins, and customization options.
The document discusses the new build system for Android using Gradle. It provides an overview of Gradle basics, plugins, and integration with Android Studio. It describes what Gradle is, why it is used, how to install it, and introduces its build script basics and Groovy language. It also covers the Gradle plugins for Java and Android projects, including tasks, dependencies, signing configs, product flavors, and build types.
The document discusses Spring and Hibernate frameworks. It provides an overview of Hibernate's object-relational mapping capabilities and how it can be used to map Java objects to database tables. It also describes Spring's inversion of control and dependency injection features. The document outlines how Spring and Hibernate can be integrated together for data access in applications. It provides examples of configuration, transaction management, and security integration between the two frameworks.
Getting Groovy with JHipster and MicronautZachary Klein
?
JHipster is a rapid development platform that makes it easy to build modern JavaScript frontends backed by JVM microservices, including support for Micronaut. This allows you to produce microservice or monolith projects quickly, with plenty of customization options and a project structure that illustrates best practices when developing with Micronaut. As Micronaut is a JVM framework, it is compatible with Groovy, making it easy to use the Groovy language for tests (with Spock) and for general purpose application code, even within standard Java project.
Groovy is a powerful, agile and dynamic language for the Java platform. Groovy has a Java like syntax along with many features inspired by languages such as Python, Ruby and Smalltalk. The language has been embraced by popular frameworks including Grails, Micronaut, Spring Boot and many others. This session covers a lot of ground to quickly get Java developers started with Groovy including many interactive examples to highlight the powerful language features that make Groovy compelling. This session is targeted to demonstrate the power of Groovy and help Java developers understand how to leverage that power in their enterprise applications.
The world of open source libraries and tools is vast for Android developers. Writing apps using solely Android SDK is impractical. Libraries can help you in many ways. They can speed up your development, save you creating boilerplate code and dealing with platform fragmentation, simplify your code and make it more readable and maintainable. In the talk I¡¯m showing how several truly useful libraries can help a developer.
Presented at MobCon Europe 2017.
Thomas braun dependency-injection_with_robo_guice-presentation-finalDroidcon Berlin
?
The document discusses dependency injection (DI) using RoboGuice in Android applications. DI makes code more concise, modular, and easier to test by allowing classes to declare dependencies without knowing how they are satisfied. RoboGuice uses annotations to inject dependencies into activities and services. It allows for loose coupling, high cohesion, and centralized configuration through bindings. DI improves testability by increasing controllability, observability, and isolation of units under test.
Gradle is more than just an ANT replacement for building Android projects. It aims to make code and resource reuse easy through dependencies, create multiple app variants through flavors and build customization, and integrate well with IDEs. Gradle uses Groovy and allows customizing builds through tasks, dependencies, flavors, and build configurations to generate different APKs for debugging, releasing, and distributing through markets.
Gradle is a build automation tool that uses Groovy as its configuration language. It aims to provide a flexible, customizable, and extensible build system that understands Ant and Maven builds. Gradle builds upon the concepts of Ant and Maven but aims to provide a more flexible and customizable build system. It supports various programming languages and frameworks out of the box and has plugins for additional functionality. Gradle builds are defined using Groovy build scripts and it supports various IDEs and continuous integration servers.
Robert Munteanu presented on the Apache Sling IDE Tooling. The presentation covered the context and major features of the IDE tooling, including bundle deployment, content synchronization, and a content navigator. It also demonstrated the tooling through an example blog application, showing how to work with bundles, scripts, and content. The tooling integrates FileVault and provides APIs and utilities to enable features like content synchronization and transport between the IDE and runtime.
Architecting your GWT applications with GWT-Platform - Lesson 02rhemsolutions
?
This document discusses architecting a GWT application with the GWT-Platform framework. It recommends using a Model-View-Presenter architecture and describes some MVP frameworks for GWT including gwt-platform. It provides an overview of how to structure an app with GWT-Platform and GXT3 including using places, tokens, presenters and dependency injection with GIN. It also covers styling the app with ClientBundle and includes sample code for creating a default presenter.
This talk contains an overview of the Sling IDE tooling which has been under development under the Apache Sling project for the last year. It will focus on how a developer can connect his/her IDE to an Apache Sling installation and develop against it without the need to use other tools. We will also provide an intro to the technical foundations of the IDE tooling, for those interested in contributing.
Modularizing a project is never easy, a lot of files to move and the dependencies between them is not always what we expect. Then the Dagger configuration used in a single module project often doesn't scale well to a multi module project. Hilt is opinionated about the configuration to use (we don't need to argue anymore about using component dependencies or subcomponents!) and this configuration works perfectly even in a multi module project. In this talk we'll see first an introduction to Hilt and a comparison with Dagger to understand why it's easier to configure. Then we'll see how to leverage it in a multi module project (both in a standard layered architecture and in a Clean Architecture that uses the Dependency Inversion) to improve build speed and code testability. Spoiler alert: using sample apps that include a single feature in the app helps a lot!
Gradle plugins, take it to the next levelEyal Lezmy
?
It's now a long time Gradle is the official build system for Android. And as a very good developer you already switched to it, and you customize it depending on your needs. Most of the time, the cleaner way to manage all these customizations is to build Gradle plugins. During this talk you will discover best practices about building your plugin to make it a good citizen, more efficient, and more famous!
This presentation will tell about:
- Building a Gradly DSL
- Interact with the Android Gradle Plugin
- Test your project on the good way
How To Dependency Inject a Kitten: An Introduction to Dagger 2Todd Burgess
?
An introduction to using the Dagger 2 dependency injection framework for Android applications. Brief explanation of dependency injection and a example of how to implement Dagger 2. Includes a real world example of Dagger 2
Friday session where we explained what is gradle and some of the hidden features and possibilities that gradle gives to developers to customize their builds in a clean and easy way.
The document provides an introduction to Gradle, an open source build automation tool. It discusses that Gradle is a general purpose build system with a rich build description language based on Groovy. It supports "build-by-convention" and is flexible and extensible, with built-in plugins for Java, Groovy, Scala, web and OSGi. The presentation covers Gradle's basic features, principles, files and collections, dependencies, multi-project builds, plugins and reading materials.
This document summarizes a presentation about improvements to Gradle's daemon feature in version 3.0. The daemon runs as a long-lived background process to speed up builds. New features include the daemon being enabled by default, being more robust on Windows, and integrating with build scans. The daemon also becomes more resource-aware and intelligent over time through machine learning. Users are encouraged to try the new daemon features and provide feedback to further improve Gradle's performance.
Grails 4 takes the powerful and flexibility of the Grails framework to a new level, with the latest versions of core frameworks like Spring 5.1, Spring Boot 2.1, Gradle 5, and Groovy 2.5. Additionally, Micronaut is now part of the Grails foundation, allowing many powerful features from Micronaut to be used natively within your Grails apps. In this talk, we¡¯ll look at how you can upgrade your Grails 3 project (with a little aside for Grails 2 projects as well) to Grails 4, and get a taste of the new features at your disposal in this exciting new release.
This document summarizes a presentation given by Ken Sipe on Gradle. It begins with an introduction of Ken Sipe and his background. It then provides an overview of existing Java build tools like Ant, Maven, and Ant with Ivy. It describes some shortcomings of Ant and Maven and introduces Gradle as a build tool built on Ant and Ivy but using Groovy as a build DSL. The document outlines key functionality of a build system and shows examples of simple Gradle build files. It discusses additional Gradle features like tasks, dependencies, plugins, and customization options.
The document discusses the new build system for Android using Gradle. It provides an overview of Gradle basics, plugins, and integration with Android Studio. It describes what Gradle is, why it is used, how to install it, and introduces its build script basics and Groovy language. It also covers the Gradle plugins for Java and Android projects, including tasks, dependencies, signing configs, product flavors, and build types.
The document discusses Spring and Hibernate frameworks. It provides an overview of Hibernate's object-relational mapping capabilities and how it can be used to map Java objects to database tables. It also describes Spring's inversion of control and dependency injection features. The document outlines how Spring and Hibernate can be integrated together for data access in applications. It provides examples of configuration, transaction management, and security integration between the two frameworks.
Getting Groovy with JHipster and MicronautZachary Klein
?
JHipster is a rapid development platform that makes it easy to build modern JavaScript frontends backed by JVM microservices, including support for Micronaut. This allows you to produce microservice or monolith projects quickly, with plenty of customization options and a project structure that illustrates best practices when developing with Micronaut. As Micronaut is a JVM framework, it is compatible with Groovy, making it easy to use the Groovy language for tests (with Spock) and for general purpose application code, even within standard Java project.
Groovy is a powerful, agile and dynamic language for the Java platform. Groovy has a Java like syntax along with many features inspired by languages such as Python, Ruby and Smalltalk. The language has been embraced by popular frameworks including Grails, Micronaut, Spring Boot and many others. This session covers a lot of ground to quickly get Java developers started with Groovy including many interactive examples to highlight the powerful language features that make Groovy compelling. This session is targeted to demonstrate the power of Groovy and help Java developers understand how to leverage that power in their enterprise applications.
The world of open source libraries and tools is vast for Android developers. Writing apps using solely Android SDK is impractical. Libraries can help you in many ways. They can speed up your development, save you creating boilerplate code and dealing with platform fragmentation, simplify your code and make it more readable and maintainable. In the talk I¡¯m showing how several truly useful libraries can help a developer.
Presented at MobCon Europe 2017.
Thomas braun dependency-injection_with_robo_guice-presentation-finalDroidcon Berlin
?
The document discusses dependency injection (DI) using RoboGuice in Android applications. DI makes code more concise, modular, and easier to test by allowing classes to declare dependencies without knowing how they are satisfied. RoboGuice uses annotations to inject dependencies into activities and services. It allows for loose coupling, high cohesion, and centralized configuration through bindings. DI improves testability by increasing controllability, observability, and isolation of units under test.
This document provides an overview of key Android development concepts and techniques. It discusses fragments, the support library, dependency injection, image caching, threading and AsyncTask, notifications, supporting multiple screens, and optimizing ListView performance. The document also recommends several popular Android libraries and open source apps that demonstrate best practices.
Improving android experience for both users and developersPavel Lahoda
?
Android UI and User Experience has changed dramatically in the recent version(s) and while users generally enjoy the new features, there are still several areas that are left to application-level-DIY-patterns. For developers, this is double challenge, they want to provide users with the bleeding edge UI patterns and at the same time, they have to deal with evolving API, that sometimes changes dramatically.
Presentation covers the gotchas developer might face dealing with ever-moving Android API, and how to utilize Java language and the tools it have to make the experience for developer more pleasant. Typical trends in the API will get analyzed and divided into several areas or "patterns", discussing typical scenarios how these components are designed and implemented.
This talk will propose several such UI patterns, that will compete to become "de facto" standards and details on the implementation, including possible impact on existing API as we have both end users and developers in mind.
The list of patterns/areas discussed in the talk include following :
ActionBar
ListView
TimePicker
KineticGestureComponent
The document discusses opportunities to improve the Android user experience through more flexible and responsive layouts, improved action bar designs, and innovative input methods like gesture and sensor-based interactions. It presents examples of custom view groups and adapters that provide flexible resizing and binding of data to views. The talk argues the action bar could be improved through more consistent behavior and use of available screen space. Ideas for new date/time pickers and gesture-based interactions are also proposed to enhance the Android experience.
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014First Tuesday Bergen
?
We are happy to invite you to the Speakers¡¯ Corner today, on Thursday May 29, from 18.30 till 19.30 at SkyPoint to meet Thomas Vervik, Head of Development Bipper Communications who will talk on ¡°How to save money on QA - Dependency Injection and automated testing on Android¡±
Thomas is Head of Development for Bipper Communications, and has been managing the company's team in Kiev since February 2012. Originally a seasoned Java server backend/frontend developer, he has the last two years started mobile development, first with HTML 5 and later Android.
Mobile development has since its birth around 2008 gone from simple apps to more complex enterprise similar software. The increase in size and complexity yields the need for structuring the code differently in order to handle the new complexity. The tools used to handle this complexity has been applied to server side development for years, but mobile development has been lagging behind.
But not anymore. New frameworks built on proven paradigms are emerging, and in this Speakers Corner we will introduce Dependency Injection for Android, the motivation for its use, and one of the implementations - Dagger. Dependency Injection has several advantages, but in this presentation we will focus on how it enables to write proper automated tests.
We are happy to invite you to the Speakers¡¯ Corner today, on Thursday May 29, from 18.30 till 19.30 at SkyPoint to meet Thomas Vervik, Head of Development Bipper Communications who will talk on ¡°How to save money on QA - Dependency Injection and automated testing on Android¡±
Thomas is Head of Development for Bipper Communications, and has been managing the company's team in Kiev since February 2012. Originally a seasoned Java server backend/frontend developer, he has the last two years started mobile development, first with HTML 5 and later Android.
Mobile development has since its birth around 2008 gone from simple apps to more complex enterprise similar software. The increase in size and complexity yields the need for structuring the code differently in order to handle the new complexity. The tools used to handle this complexity has been applied to server side development for years, but mobile development has been lagging behind.
But not anymore. New frameworks built on proven paradigms are emerging, and in this Speakers Corner we will introduce Dependency Injection for Android, the motivation for its use, and one of the implementations - Dagger. Dependency Injection has several advantages, but in this presentation we will focus on how it enables to write proper automated tests.
Esta charla comprende las lecciones aprendidas convirtiendo la app de Android de Teambox (una app repleta de deuda t¨¦cnica y con un alto nivel de acoplamiento entre clases), en la versi¨®n actual de Redbooth, que intenta cumplir la arquitectura Hexagonal y los principios SOLID. Durante la exposici¨®n explicaremos como fuimos desenredando el c¨®digo paso a paso; como aplicamos por partes los conceptos de la arquitectura hexagonal; como dejamos de lado componentes del framework de Android que dificultaban el mantenimiento de la app; y que errores cometimos, como los solucionamos y como se podr¨ªan haber evitado.
This document discusses various open source Android libraries and tools that can be used to build Android applications more efficiently. It summarizes RoboGuice for dependency injection, ActionBarSherlock for action bar support, libraries like HTTP Request and GSON, and tools like ViewPagerIndicator, Robotium for testing, the Android Maven plugin, and fragments. It encourages leveraging these libraries and tools to build more with less code through reuse and integration of existing components.
The document discusses building native components and modules for React Native applications. It provides guidance on creating native modules and components for both iOS and Android platforms. For native modules, it describes how to expose methods and properties to JavaScript. For native components, it explains how to create custom native views and expose their properties and events to React components.
DroidParts is a library that helps handle common tasks in Android development such as:
- SQL operations, JSON serialization/deserialization, HTTP interactions, loading and caching images, background processing, logging, and dependency injection.
It provides solutions for these tasks through modular "parts" including an ORM, JSON serializer, REST client, image fetcher, logger, and more. The library aims to provide a simple yet flexible API and avoid reimplementing core Java and OO principles.
This document provides an overview of modern Android development techniques including application architecture patterns like MVC, MVP and MVVM. It discusses topics like dependency injection with Dagger 2, reactive programming with RxJava, HTTP libraries like Retrofit and OkHttp, annotations, testing, using Kotlin and the future of Android development targeting the next billion users across more devices.
This document summarizes the Guice dependency injection framework. It provides an overview of key Guice concepts like dependency injection, modules, and bindings. It also discusses Guice extensions like Warp Persist for persistence and transaction management and Google GIN which compiles Guice configuration at compile time for improved performance.
Taming Core Data by Arek Holko, MacoscopeMacoscope
?
The document discusses best practices for working with Core Data in iOS applications. It covers 9 steps: 1) setting up Core Data, 2) accessing the managed object context, 3) creating NSManagedObject subclasses, 4) creating fetch requests, 5) integrating networking, 6) using NSFetchedResultsController, 7) protocolizing models, 8) using immutable models, and 9) modularizing the code. The overall message is that Core Data code should be organized cleanly using small, single-purpose classes and protocols to improve testability, separation of concerns, and code reuse.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
This document discusses architecture components for building modern Android applications. It covers common app architecture problems and principles like separation of concerns. It introduces key Architecture Components like Activities, Fragments, Services, ContentProviders, ViewModels and LiveData. It also discusses architectural patterns like MVC, MVP, MVVM and recommendations like clean architecture. The document emphasizes principles like modularity, separation of concerns, and testability. It provides an overview of alternatives like Room, Paging Library, and recommendations for legacy apps.
This document discusses microservices architectures and provides examples of tools used in microservices architectures like those implemented at Netflix. It describes common microservices patterns like service discovery (Eureka), configuration management (Archaius), load balancing (Ribbon), circuit breaking (Hystrix), monitoring (Turbine), edge services (Zuul), and logging (Blitz4j). It also discusses using these tools with Spring Cloud and provides code samples for configuring services using Netflix OSS and Spring Cloud.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
This document provides an overview of best practices for Android development. It discusses topics such as UI design, including layouts and styles; using the action bar for search and progress indicators; accessibility; network connections; asynchronous tasks and services; fragments and navigation patterns; geolocation and performance; dependency injection; and recommended tools and libraries. The document provides code snippets and links to the Android developer documentation for further information on these topics.
42. Activity
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
43. Context
¡ñ
Context of current state of the
application/object
44. Context
¡ñ
Context of current state of the
application/object
¡ñ
Context is a handle to the system it
provides services like
¨C resolving resources
¨C obtaining access to databases and
preferences
59. Dagger
public class DaggerApplication extends Application {
private static ObjectGraph objectGraph;
@Override public void onCreate() {
super.onCreate();
objectGraph = ObjectGraph.create(new DaggerModule(this));
}
public static <T> void inject(T instance) {
if(objectGraph != null) objectGraph.inject(instance);
}
}
60. @Module(
entryPoints = { DaggerApplication.class, DaggerActivity.class}
)
public class DaggerModule {
private final Context appContext;
public DaggerModule(Context appContext) {
this.appContext = appContext.getApplicationContext();
}
@Provides @Singleton Bus provideBus() {
return new Bus();
}
@Provides Context provideContext() {
return appContext;
}
}
61. Summary
Dagger
¡ñ
More customizable
¡ñ
Easy communicates with other libraries
¡ñ
Requires more code
RoboGuice
¡ñ
Simpler
¡ñ
Out of Box functionality
72. ORMLite
@DatabaseTable(tableName = "accounts")
public class Account {
@DatabaseField(id = true) private String name;
@DatabaseField(canBeNull = false) private String password;
Account() {
// all persisted classes must define a no-arg constructor with at least package
visibility
}
}
73. ORMLite
// you get the SQLiteOpenHelper from your Android Activity
ConnectionSource connectionSource = new AndroidConnectionSource(sqliteOpenHelper);
// instantiate the DAO to handle Account with String id
Dao<Account,String> accountDao = BaseDaoImpl.createDao(connectionSource, Account.class);
TableUtils.createTable(connectionSource, Account.class);
String name = "Jim Smith";
Account account = new Account(name, "_secret");
accountDao.create(account)
Account account2 = accountDao.queryForId(name);
connectionSource.close();