#java
32 posts tagged java. All posts
ButterKnife on Android: binding views and click listeners, and migrating to View BindingHow ButterKnife's @BindView and @OnClick annotations work, the setup gotchas on current Android Gradle Plugin versions, and the View Binding code that replaces them.
Adding a Google Map with a marker to an Android appSet up a Maps SDK for Android API key, add the play-services-maps dependency, and show a map with a marker using SupportMapFragment in Java.
Getting started with Apache Maven: project layout, lifecycle and dependenciesWhat Apache Maven does, the standard project layout, how the build lifecycle and dependencies work, and how to generate, build and run a project from the command line.
Building a simple Swing GUI in Java with a button click handlerCreate a Java Swing window with a label and a button, start it on the event dispatch thread, and handle clicks with an ActionListener.
Sets and maps in Java: HashSet, HashMap and picking an implementationHow to use HashSet and HashMap in Java, when to choose the LinkedHash or Tree variants, and the equals/hashCode and immutability gotchas.
Apache Thrift: a Java server and Python client from one IDL fileDefine a service in Thrift IDL, generate Java and Python code, and call a Java Thrift server from a Python client, with notes on protocols and versions.
Apache Tomcat: architecture, configuration and a first servletWhat Apache Tomcat is, how Catalina, Coyote and Jasper fit together, which config file does what, and how to deploy a Jakarta servlet on Tomcat 11.
JUnit basics: writing and running unit tests in JavaWrite and run JUnit Jupiter tests in Java, covering the Maven dependency, lifecycle annotations, assertions, parameterized tests and what changed in JUnit 6.
Espresso UI tests on Android: setup, matchers, idling resources and intentsHow to set up Espresso with AndroidX Test, write a UI test with ActivityScenarioRule, handle background work with idling resources, and verify intents.
RxJava 3 on Android: observables, operators and threadingHow RxJava 3 models async work on Android: Observable, Single and friends, common operators, schedulers, Retrofit integration, and disposing subscriptions.
C++ interoperability with C, Python and Java: extern "C", pybind11, JNI and SWIGHow to call C++ from C, Python and Java using extern "C" wrappers, ctypes, pybind11, JNI, JNA, SWIG and Java's Foreign Function and Memory API.
Java standard library overview: the core packages and what they're forA tour of the core Java standard library packages (java.lang, java.util, java.time, java.io, java.nio.file, java.net) and what each one is for, with a runnable example.
Mockito for Android unit tests: mocks, stubbing, and verificationUse Mockito 5 in Android unit tests: create mocks, stub return values, verify calls, use argument matchers and answers, and mock final classes.
Retrofit on Android: calling a REST API from JavaSet up Retrofit in an Android app, define an API interface, make an async call with enqueue, and share one OkHttpClient for caching, auth headers and pooling.
Dagger 2 on Android: components, modules, scopes and a working setupHow Dagger's components, modules, @Inject constructors and scopes fit together, with a working Java example for an Android app and when to use Hilt instead.
Hibernate ORM basics: map, save and query Java entities with Hibernate 7What Hibernate ORM does and how to use it today: annotated entities, a SessionFactory, persisting and querying with HQL in Hibernate 7, plus the old APIs that are now gone.
Firebase Realtime Database on Android: setup, reads, writes and security rulesAdd Firebase Realtime Database to an Android app with the Firebase BoM, write and listen for data in Java, enable offline persistence, and lock it down with rules.
Places SDK for Android: nearby search, place details, autocomplete, and photosSet up the Places SDK for Android with Places API (New), then run a nearby search, fetch place details, show autocomplete predictions, and load place photos in Java.
Apache Commons Lang, IO and Collections: examples in JavaWorking examples of Apache Commons Lang (StringUtils, NumberUtils), Commons IO (FileUtils) and Commons Collections (MultiValuedMap), with current Maven coordinates.
Loading images on Android with Glide: setup, placeholders, transformations and cachingHow to add Glide to an Android project, load images into an ImageView with placeholders, apply built-in and custom transformations, and control caching.
Apache Lucene basics: indexing and searching text in JavaHow Apache Lucene indexes and searches text, how BM25 ranks results, and a runnable Java example that builds an index and queries it with Lucene 10.
Netty basics: channels, pipelines and an echo server in JavaThe core Netty concepts (Channel, ChannelPipeline, handlers, ByteBuf) and a complete echo server and client written against Netty 4.2.
Spring Framework basics: dependency injection, modules and Spring BootWhat the Spring Framework does: the IoC container and dependency injection, its main modules, a runnable example, and how Spring Boot fits in.
Apache POI: reading and writing Excel, Word and PowerPoint files in JavaUsing Apache POI 6 to create, style and read Excel workbooks and to generate Word and PowerPoint files from Java, with runnable examples.
Apache Struts 2: actions, interceptors and security practicesHow Apache Struts 2 handles requests with actions, interceptors and struts.xml, with a small Struts 7 example and the security practices that matter most.
Eclipse Jetty: an introduction to the Java web server and servlet containerWhat Eclipse Jetty is, how its server, connectors and handlers fit together in Jetty 12, and how to embed it in a Java app or run it standalone.
Log4j 2 basics: configuring loggers, appenders and layouts in JavaHow Log4j 2 loggers, appenders and layouts fit together, with a minimal log4j2.xml, the Maven dependency, and logging from Java code.
Picasso on Android: loading, resizing, and transforming imagesLoad images into Android ImageViews with Square's Picasso: placeholders, resizing, and custom transformations, plus the Coil equivalent now that Picasso is deprecated.
Jackson basics: reading and writing JSON in JavaConvert Java objects to and from JSON with Jackson's ObjectMapper, covering records, field renaming, generic lists, the tree model and Jackson 2 vs 3 differences.
OkHttp on Android: making requests and adding interceptorsAdd OkHttp 5 to an Android app, make an asynchronous GET request without leaking responses, and write an interceptor for logging or auth headers.
Google Guava for Java developers: collections, caching and concurrencyWhat Google Guava still adds to modern Java: immutable collections, Multimap, BiMap, Table, LoadingCache, ListenableFuture and Service, with runnable examples.
Publishing a Java Maven package to GitHub Packages and JitPackHow I published a small Java library to GitHub Packages with a GitHub Actions workflow, and made it available through JitPack.
© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)