Native and Android display density
Map ABI1 adds sqsm_map_set_viewport(map, logicalWidth, logicalHeight, pixelRatio). Check SQSM_MAP_DISPLAY_DENSITY (0x80000000) using uint32 runtime flags. Existing create/resize calls retain DPR1; old signatures and output ownership are unchanged.
sqsm_map_t map = 0;
sqsm_map_create(320, 240, &map);
sqsm_map_set_viewport(map, 320, 240, 2.0);
// render_rgba returns640 × 480 × 4bytes; input/query coordinates stay logical.
Density must be finite in0.125–16. Rendering uses native f32 density and rounded physical dimensions. Both logical/physical edges are at most4096 and respect GPU texture/readback limits. Invalid requests reject before visible mutation. Effective logical size is rounded physical size divided by density. State width/height describe physical output; logicalWidth/logicalHeight describe requested logical size; pixelRatio is the actual density. cameraState.viewport gives the effective logical viewport. project/unproject, queries, pointers, padding and style dimensions remain logical.
The Android development source adapter provides an overload:
NativeMapHost.open(320,240,2.0,listener,null).thenAccept(host -> {
host.runScript("import {map} from 'sqsmap';map.jumpTo({center:[0,0],zoom:2});export default {}; ");
// host.resize(320,240,2.0) retains logical input and dense output.
});
onFrame supplies physical width/height and RGBA on the map owner thread; post UI work to the UI thread. Android touches are View pixels: map the actual drawing rectangle to physical framebuffer pixels, then divide by pixelRatio for logical points. Do not submit physical coordinates directly. Integer logical sizes plus rounding can make output differ from the View by one pixel; use actual frame dimensions for touch mapping. Applications supply their own controls/layer UI.
The complete C example covers creation, density, state, rendering, legacy resize, destruction and output release. Use the Android source attachment with matching headers/library; the native manifest gives its version.
Local evidence covers12 actual C frames across geographic/Mercator/pitched/globe × DPR1/1.25/2, coordinates, picking, colours/area and seven invalid cases. Actual DEM coordinate scripts pass at DPR2. Android API24 Java/ARM64 JNI compilation and real Linux JVM/JNI owner checks do not represent Android device acceptance. Automatic touch navigation, iOS, mobile GIS integration and devices remain tasks.