Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AndroidGoLab/ndk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.0
Choose a base ref
...
head repository: AndroidGoLab/ndk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.0.1
Choose a head ref
  • 14 commits
  • 251 files changed
  • 1 contributor

Commits on Mar 15, 2026

  1. Configuration menu
    Copy the full SHA
    d0bbc3b View commit details
    Browse the repository at this point in the history
  2. docs: move ndkcli section after Usage Examples, add install instructions

    Moved ## ndkcli from line 1022 to line 252 (right after Usage Examples).
    Added install instructions with pre-built binary download and build-
    from-source options. Added quick start section with common commands.
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    d532ebf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    589c656 View commit details
    Browse the repository at this point in the history
  4. feat: real-time sensor data streaming via looper + event queue

    Replaces the static sensor info polling with actual event streaming:
    - CreateEventQueue, EnableSensor, SetEventRate, HasEvents added to
      idiomatic sensor package via overlay
    - sensor read command now creates a looper, event queue, enables the
      sensor, and reads ASensorEvent structs in real-time
    - Verified on Pixel 8a: accelerometer (31 events/2s at 100ms rate),
      gyroscope (20 events/1s at 50ms rate)
    
    Example: ndkcli sensor read --type 1 --duration 5s --rate 50000
    Output:  [0] t=7362583743842  x=1.303490  y=9.522836  z=2.161317
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    5acc06c View commit details
    Browse the repository at this point in the history
  5. docs: remove JNI examples from README

    Remove GPS, WiFi, and notification examples that used the jni library.
    These examples belong in the jni project's own documentation, not here.
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    057f3bb View commit details
    Browse the repository at this point in the history
  6. fix: toSnakeCase treating each uppercase letter as a word boundary

    The function was designed for PascalCase (StreamBuilder → stream_builder)
    but received ALL_CAPS input (AUDIO, IMAGE_FORMATS) from autoGoTypeName,
    producing absurd filenames like a_u_d_i_o.go and i_m_a_g_e__f_o_r_m_a_t_s.go.
    
    Fix: only insert underscore on lowercase/digit → uppercase transitions.
    Regenerated all idiomatic packages (195 files renamed).
    
    Also replace magic constants in examples with exported package constants:
    - looper: use ALOOPER_POLL_WAKE etc. instead of redeclared int32(-1)
    - camera/display: use media.AIMAGE_FORMAT_PRIVATE/YUV_420_888 instead of
      hex literals (old comment was wrong: 0x22 is PRIVATE, not YUV_420_888)
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    7fb3db3 View commit details
    Browse the repository at this point in the history
  7. feat: extract #define macro constants from C headers in specgen

    The spec generation pipeline was losing #define constants because
    clang -E preprocessing expanded them before c2ffi could see them.
    
    Fix: parse original (pre-preprocessed) headers directly with regex
    to extract #define NAME VALUE patterns. Store in spec as Macros map.
    
    In idiomgen:
    - extra_enums values auto-resolve from macros (header is authoritative)
    - Unmatched macros generate as untyped constants in constants.go
    
    This auto-extracts 154 EGL, 1819 GLES2, and 624 GLES3 constants from
    headers. Examples updated to use package constants instead of local
    magic values (EGL_VENDOR, GL_UNSIGNED_SHORT, GL_TIMEOUT_IGNORED, etc).
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    91c6e3d View commit details
    Browse the repository at this point in the history
  8. feat: auto-infer typed enum params from int32 in idiomgen

    C headers declare enum params as bare `int`, so the spec records
    `int32`. This made examples require ugly casts like
    `mgr.DefaultSensor(int32(sensor.Accelerometer))`.
    
    Fix: after collecting value enums, build a set of their Go names.
    When a function param has type int32 and PascalCase(paramName) matches
    a value enum GoName, use the typed enum instead. Also supports
    explicit overlay override via `param_types` field on FuncOverlay.
    
    Affects 9 params across 7 modules (sensor, asset, config, bitmap,
    logging, nativewindow, neuralnetworks). Also fixes capiArg to not
    prefix scalar Go types with `capi.` (e.g. int32 → int32(), not
    capi.int32()).
    
    Examples updated to remove int32() casts.
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    7bedf2c View commit details
    Browse the repository at this point in the history
  9. fix: emit negative macro constants as hex literals

    GL_TIMEOUT_IGNORED (0xFFFFFFFFFFFFFFFF) was emitted as -1, which
    overflows uint64 types like GLuint64. Emit negative values as hex
    to preserve the unsigned bit pattern.
    
    Fixes CI: "constant -1 overflows gles3.GLuint64"
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    4882a56 View commit details
    Browse the repository at this point in the history
  10. fix: remove remaining int32() casts in sensor examples

    Missed two call sites in event-loop and list-sensors that still
    cast sensor.Type to int32 for DefaultSensor (which now takes Type).
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    c7e450e View commit details
    Browse the repository at this point in the history
  11. docs: remove magic constants and int32 casts from README examples

    Replace local hex constants with auto-generated package constants
    (egl.EGL_VENDOR, gles2.GL_VENDOR, etc.) and remove int32() casts
    for DefaultSensor calls that now accept sensor.Type.
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    5f66a73 View commit details
    Browse the repository at this point in the history
  12. fix: update ndkcli for typed enum params and cligen multi-return

    - Regenerate ndkcli commands after enum param type changes
    - Fix sensor_workflow.go to use sensor.Type instead of int32
    - Fix cligen to handle (result, bool) multi-return methods
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    3219736 View commit details
    Browse the repository at this point in the history
  13. go fmt

    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    c7d0ed4 View commit details
    Browse the repository at this point in the history
  14. fix: remove int32() cast for SetPreference in nnapi example

    SetPreference now takes nnapi.Preference, not int32.
    [email protected] authored and [email protected] committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    0b317c5 View commit details
    Browse the repository at this point in the history
Loading