Generated reference › API — ICoreEssentials/UI/Backends/Android
kind: generated#api#icoreessentials-ui-backends-android

API — ICoreEssentials/UI/Backends/Android

The public contract of 3 header(s) under ICoreEssentials/UI/Backends/Android — 2 class/struct definition(s), 4 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

ICoreAndroidEntry.h#

ICoreEssentials/UI/Backends/Android/ICoreAndroidEntry.h

How an Android program is entered: the Activity calls in, this calls main. (Android port, TB3.2.)

An Android app has no main(). The zygote starts a Java process, the Activity in java/com/icoreblocks/ICoreActivity.java loads the program's shared library, and its nativeRun() lands in ICoreAndroidEntry.cpp, which calls icoreAndroidMain() with an argv and an environment built from the launching intent. So a program that runs on a desktop as main() runs here with the same argv, the same environment and the same exit status. That is the shape the tablet test rig drives, and the shape --console needs.

⚠ $HOME IS THE APP'S PRIVATE FILES DIRECTORY, set before main runs, unless the launch supplied a HOME of its own. ICoreStandardPaths reads every location off $HOME on Android (TB0.8), and an app

Declares no class of its own — see the file.

ICoreAndroidFetchApi.h#

ICoreEssentials/UI/Backends/Android/Network/ICoreAndroidFetchApi.h

The fetch API the Android HTTP transport implements (Android port, TB0.10), under neutral names. UI/Backends/Web/EmscriptenOnAndroid/emscripten/ fetch.h gives the web HTTP seat Emscripten's names for exactly these types and functions, and UI/Backends/Android/Network/ICoreAndroidFetch.cpp defines them -- so the web seat compiles for Android unchanged, and no file outside the web zone names Emscripten (the toolkit-boundary check enforces this). Field for field the shape of Emscripten's emscripten_fetch_attr_t / emscripten_fetch_t, which that header's contract note describes.

icore_fetch_attr_t#

ICoreAndroidFetchApi.h:18 · struct · 4 declaration(s)

struct icore_fetch_attr_t {
public:
    char requestMethod[32];
    void* userData;
    void (*onsuccess)(struct icore_fetch_t* fetch);
    void (*onerror)(struct icore_fetch_t* fetch);
    void (*onprogress)(struct icore_fetch_t* fetch);
    void (*onreadystatechange)(struct icore_fetch_t* fetch);
    std::uint32_t attributes;
    std::uint32_t timeoutMSecs;
    int withCredentials;
    const char* destinationPath;
    const char* userName;
    const char* password;
    const char* const* requestHeaders;   // name, value, name, value, ..., nullptr
    const char* overriddenMimeType;
    const char* requestData;
    std::size_t requestDataSize;
};
};

icore_fetch_t#

ICoreAndroidFetchApi.h:37 · struct · 0 declaration(s)

struct icore_fetch_t {
public:
    unsigned int id;
    void* userData;
    const char* url;
    const char* data;           // this chunk, during onprogress; the body, during onsuccess
    std::uint64_t numBytes;
    std::uint64_t dataOffset;
    std::uint64_t totalBytes;   // 0 when the server sent no Content-Length
    unsigned short readyState;  // 0 unsent, 1 opened, 2 headers received, 3 loading, 4 done
    unsigned short status;
    char statusText[64];
    std::uint32_t __proxyState;
    icore_fetch_attr_t __attributes;
};
};

png.h#

ICoreEssentials/UI/Backends/Android/Values/PngShim/png.h

libpng's "simplified API", the six names UI/Backends/Web/Values/ICoreWebPixmap.cpp uses, answered by Android's own codecs (Android port, TB3.4).

The web pixmap seat decodes and encodes PNG itself through Emscripten's libpng port (WB1.6). The NDK has no libpng, and vendoring one to serve two functions would put a second PNG codec in an app whose platform already ships one. So this header -- first on an android build's include path, ahead of any system <png.h> -- declares exactly that subset, and ICoreAndroidPng.cpp implements it on AImageDecoder (decode) and AndroidBitmap_compress (encode), both API 30. ICoreWebPixmap.cpp then compiles into the Android build unchanged.

⚠ IT IS A SUBSET, NOT libpng. Only RGBA 8-bit with a zero row stride (tightly packed) is supported, which is the one shape the pixmap seat asks for; any other request fails the call rather than returning the wrong bytes.

Declares no class of its own — see the file.