jhuster/android Documentation

repository·master·Indexed 18 days ago

https://github.com/jhuster/android

A collection of Android development patterns, utility classes, and demonstration code. Covers UI components, JNI (callbacks, buffer passing, and signature generation), networking (WiFi scanning, Socket/UDP broadcasting), custom threading with LoopThread, and image processing utilities including BitmapHelper and ImageConvertor.

Tokens
542
Snippets
0
Records
9
Agent score
13%

What's inside jhuster-android

  1. Overview of Android development examples

    master
    This repository contains a collection of Android development examples and utility classes derived from the 《Android应用开发》 blog series. The code provides encapsulated implementations of various Android APIs, ranging from basic UI components to advanced JNI and networking implementations, which can be integrated directly into Android projects.
  2. Custom View and ViewGroup implementation

    master

    The CustomView module provides guidance and implementation examples for creating custom UI components. Key areas covered include:

    • Overriding onMeasure() for precise dimension calculation.
    • Overriding onLayout() for custom ViewGroup positioning logic.
    • Implementing custom Views with animations (e.g., bar charts).
  3. JNI: Passing Buffers between Java and Native layers

    master
    The JniBuffer module provides demonstrations of various methods for passing data buffers between the Java layer and the Native (JNI) layer, which is critical for high-performance data processing.
  4. Custom Threading with LoopThread

    master
    The LoopThread module demonstrates how to implement a custom worker thread that includes a message loop (Looper). This allows the thread to process a queue of messages or tasks sequentially, similar to how the Android Main Thread operates.
  5. JNI: Callback from Native threads to Java

    master
    The JniCallback module demonstrates how to trigger Java function calls from within a Native (C/C++) thread using JNI. This is useful when your native processing logic needs to notify the Android application layer of events or results.
  6. Image and Bitmap utilities

    master

    The Utils directory contains several specialized image processing tools:

    • BitmapHelper.java: Encapsulates common Bitmap operations including opening, saving, cropping, and rotating images.
    • ImageConvertor.java: Handles conversions between various image formats and color spaces, including NV21, YUY2, RGB565, ARGB8888, PNG, JPEG, and Bitmap.