Android compatibility matrix
Picodroid’s goal is that Android code and intuition transfer directly: class
names, method signatures, and semantics track android.*. Embedded constraints
force some divergences, and a few Android subsystems are intentionally absent.
This page is the authoritative list of what’s full, partial, renamed-only, or
unsupported — and the picodroid alternative for every gap.
The SDK is imported as picodroid.* — every class below mirrors its android.*
counterpart’s name, so the API reads the same; you just import picodroid.*
(e.g. import picodroid.view.View;). Apps always use picodroid.* imports.
Status legend
| Status | Meaning |
|---|---|
| Full | API surface and semantics match Android closely enough to port unchanged. |
| Partial | Present, but a subset of methods/overloads or a documented behavior difference. |
| Renamed | Same shape, but only reachable as picodroid.* — not a real Android class. |
| Unsupported | No equivalent; use the listed alternative. |
By package
android.app
| API | Status | Notes / alternative |
|---|---|---|
Activity | Full | Lifecycle (onCreate/onStart/onResume/onPause/onStop/onRestart/onDestroy), onKeyDown/onKeyLongPress/onKeyUp (KeyEvent.Callback; the fallback after the focused view’s OnKeyListener, with Android’s BACK tracking and long-press cancel), onBackPressed, startActivity, startActivityForResult + onActivityResult, setResult, getIntent (null in the manifest’s entry Activity, which Android hands an ACTION_MAIN Intent), finish, recreate with onSaveInstanceState / onRestoreInstanceState, setContentView(View) / setContentView(int), findViewById, getApplication (null when the manifest names no Application class; Android always has one), getSupportFragmentManager (FragmentActivity’s, on Activity itself), getLifecycle / getViewModelStore / getDefaultViewModelProviderFactory (ComponentActivity’s), runOnUiThread, the options menu (onCreateOptionsMenu / onPrepareOptionsMenu / onOptionsItemSelected / onOptionsMenuClosed, openOptionsMenu / closeOptionsMenu / invalidateOptionsMenu; opened by a MENU key, a held SELECT on a four-key board, or the framework’s menu control on a touch board). onKeyMultiple is declared and never called. getTitle / setTitle (from the manifest’s android:label), setActionBar(Toolbar) / getActionBar (no window-decor action bar: null until set, as under a NoActionBar theme), onNavigateUp (default finish(): the stack is the hierarchy, no parentActivityName), getOnBackPressedDispatcher (ComponentActivity’s; onBackPressed goes through it). No dispatchKeyEvent or onContextItemSelected. onTrimMemory / onLowMemory (ComponentCallbacks2, see that row). |
Application | Full | onCreate entry point (<application android:name>); once it returns the framework launches the manifest’s MAIN / LAUNCHER Activity, unless onCreate started one itself, as Android does. An app with no Activity runs headless. onTrimMemory / onLowMemory fan out to what registerComponentCallbacks added, so an override calls super, as on Android. |
ActionBar | Partial | From setActionBar(Toolbar) only: setDisplayHomeAsUpEnabled (the up button reaches onOptionsItemSelected as R.id.home, then onNavigateUp), setDisplayShowTitleEnabled, setDisplayOptions / getDisplayOptions, setTitle / setSubtitle and getters, show / hide / isShowing, getHeight, setHomeAsUpIndicator (a Drawable or a drawable resource; null / 0 is the stock chevron). Concrete, with no public constructor (Android’s is abstract). No tabs, custom views, logos, icons. |
OnBackPressedDispatcher / OnBackPressedCallback (androidx.activity, in picodroid.activity) | Partial | addCallback (plain and with a LifecycleOwner: added on ON_START, out on ON_STOP, dropped at ON_DESTROY), onBackPressed, hasEnabledCallbacks, the fallback constructor; setEnabled / isEnabled, remove, handleOnBackPressed. The fragment back stack is popped after every app callback (androidx orders the fragment manager’s callback by registration). No predictive-back progress. |
Service | Partial | Started + bound services, onRebind, stopSelf / stopSelfResult, getApplication (as on Activity), startForeground / stopForeground (the notification is a top-of-screen banner; nothing kills a background service, so “foreground” is about the banner). No IntentService. onTrimMemory / onLowMemory as for an Activity. |
AlertDialog / AlertDialog.Builder | Partial | Builder(Context) only, as on Android. Positive/negative/neutral buttons, setItems, single- and multi-choice. Titles, messages and labels are String. A dismissed dialog is freed and cannot be shown again (show() throws IllegalStateException). No setView, setCancelable, setOnDismissListener or setIcon. List variants cap at ~12 rows (LVGL renderer limit) and a message set alongside items wins (items are dropped, with a Log.w) — matching Android’s message-vs-items precedence. The rows of setSingleChoiceItems / setMultiChoiceItems are button-matrix cells, not CheckedTextViews: a checked row is a filled accent cell and an unchecked one a dark cell, with no check box or radio mark drawn beside the text. |
Notification / NotificationManager | Partial | Basic post/cancel. Notification.Builder(Context, String channelId) as on Android, the channel id accepted and unused: there are no channels (one notification slot), styles, or actions. A built notification is read back through extras (EXTRA_TITLE, EXTRA_TEXT), as on Android. |
AlarmManager | Partial | setTime(long) and setTimeZone(String) on every board (a fixed-offset id such as GMT+05:30; no region ids, no tz database; SET_TIME / SET_TIME_ZONE are not enforced). Alarms on multi-app boards only: set / setExact (both exact) and cancel, on all four RTC* / ELAPSED_REALTIME* clocks. An alarm outlives the app that set it and starts it again to deliver it; alarms live in RAM and are lost at a reset, so re-register them at startup as an Android app does after BOOT_COMPLETED. No setRepeating, setWindow, setAlarmClock or OnAlarmListener. |
PendingIntent | Partial | Multi-app boards only. getActivity and getBroadcast (an explicit receiver class, delivered to a new instance of it, or an action, delivered to the registered receivers), carrying at most two int extras under keys of at most 15 characters; FLAG_NO_CREATE is honoured, the other flags are accepted and ignored (a set always replaces by identity). No getService. |
Fragment / FragmentManager / FragmentTransaction (androidx.fragment.app, in picodroid.app) | Partial | Android’s lifecycle callbacks in Android’s order, driven by the host Activity; add / replace / remove / hide / show / detach / attach, commit (deferred) and commitNow, addToBackStack / popBackStack (BACK pops before finish()), findFragmentById / ByTag, setArguments, onSaveInstanceState saved with the Activity’s Bundle. Deviations: a view given up in onDestroyView is freed at once (never re-added); lifecycle states are ints (setMaxLifecycle(Fragment, int), no Lifecycle.State); setInitialSavedState(Bundle) in place of SavedState; after a re-creation fragments come back only through a FragmentFactory the app sets (instantiate(String), no ClassLoader, no reflection — without one nothing is restored, with a warning). getViewLifecycleOwner() for LiveData; the fragment itself is not a LifecycleOwner or ViewModelStoreOwner. A skipped super in a lifecycle override is tolerated (no SuperNotCalledException). No child fragment managers, animations, startActivityForResult, setRetainInstance, menus. |
ViewModel / ViewModelProvider (androidx.lifecycle, in picodroid.lifecycle) | Partial | new ViewModelProvider(owner[, factory]).get(X.class) / get(key, X.class), ViewModelProvider.Factory.create(Class), ViewModel.onCleared(), ViewModelStore, ViewModelStoreOwner and HasDefaultViewModelProviderFactory (both implemented by Activity). No reflection, so no default factory: override Activity.getDefaultViewModelProviderFactory() or pass one. A ViewModel lives as long as its Activity instance and is cleared on destroy, recreate() included (there are no configuration changes to keep it across). No SavedStateHandle, AndroidViewModel, viewModelScope; a fragment is not an owner. |
LiveData / MutableLiveData / Observer / Lifecycle / LifecycleOwner (androidx.lifecycle, in picodroid.lifecycle) | Partial | observe(owner, observer) (active from STARTED, removed at DESTROYED), observeForever, removeObserver(s), setValue (synchronous, main thread), postValue (any thread, last value wins), getValue, hasObservers / hasActiveObservers, onActive / onInactive. Owners: Activity, and Fragment.getViewLifecycleOwner(). Lifecycle.State / Lifecycle.Event enums, addObserver with DefaultLifecycleObserver / LifecycleEventObserver; Lifecycle has setCurrentState / handleLifecycleEvent (it is its own LifecycleRegistry). MediatorLiveData (addSource / removeSource), Transformations.map / switchMap. |
Loader | Unsupported | Load on a Thread or ExecutorService and post to the main executor. |
android.view
| API | Status | Notes / alternative |
|---|---|---|
View | Partial | Geometry/visibility/enabled/tag/id, setTranslationX/Y, setRotation, setScaleX/Y + getters (getX() == getLeft() + getTranslationX()), OnClickListener + performClick, OnLongClickListener + performLongClick, OnTouchListener, OnKeyListener, OnFocusChangeListener with setFocusable / requestFocus, setAlpha, setPadding, setLayoutParams (applied at once, as on Android: on a view in a layout it re-applies size, weight, gravity and margins, a field now zero, or params of a plainer class, clearing what earlier params set; on a parentless view it sizes it now; null throws NullPointerException), getParent, setBackground / getBackground, setBackgroundColor, setBackgroundTintList / getBackgroundTintList (the tint replaces the background’s colour and keeps its shape; its alpha is ignored). A setter given the value the view already has (setVisibility, setAlpha, setEnabled, the same Drawable or an equal tint; TextView.setText and setTextColor) does nothing. findViewById (depth first, over setId / android:id). VISIBLE / INVISIBLE / GONE have Android’s values (0, 4, 8). A view is sized and placed only through its layout params (or a custom ViewGroup’s layout), as on Android. Additions with no Android counterpart: close() (frees the widget) and setOnSwipeListener (OnSwipeListener, View.SWIPE_*). onMeasure / setMeasuredDimension / measure / getMeasuredWidth / getMeasuredHeight / resolveSize / getDefaultSize and View.MeasureSpec: asked of a view that draws itself, for a wrap_content dimension. getContext() (the constructor’s), post(Runnable) (the main executor’s queue; no postDelayed), onTouchEvent / dispatchTouchEvent (a view made with View(Context) is hit-tested from construction), layout(l, t, r, b) / requestLayout() / getRight / getBottom. |
ViewGroup | Partial | addView(child), addView(child, LayoutParams), removeView, removeAllViews, getChildCount, getChildAt, onViewAdded, LayoutParams (MATCH_PARENT, WRAP_CONTENT) and MarginLayoutParams (setMargins; applied when the child is added, and again by setLayoutParams). addView(child) applies the LayoutParams the child carries; without any, a ViewGroup child or a self-drawing View(Context) subclass takes generateDefaultLayoutParams(), so its onMeasure runs (Android applies it to every child; a framework leaf without params is content-sized here). removeView frees the child’s widget, so a removed view cannot be added again (IllegalStateException), and addView of a view that has a parent moves it (Android throws). addView(child, index), removeViewAt, indexOfChild. A subclass made with ViewGroup(Context) lays its children out itself: onLayout (after addView / removeView, a size change or requestLayout), View.layout, measureChild / measureChildren / getChildMeasureSpec. No onInterceptTouchEvent. |
ViewPropertyAnimator | Partial | animate() with alpha, x/y, translationX/Y, rotation, scaleX/Y, setDuration, setStartDelay, setInterpolator (the four built-in curves), withEndAction — to-only, as on Android. Rotation/scale render through an off-screen layer of the view’s size; keep transformed views small. |
MotionEvent | Partial | getX/getY are view-relative, getRawX/getRawY are screen-absolute, matching Android. Coordinates are int, not float (no FPU). ACTION_DOWN / ACTION_UP / ACTION_MOVE, plus ACTION_LONG_PRESS (3), which has no Android counterpart. The dispatched event is reused, as Android recycles its events; obtain(MotionEvent) copies one. Single touch: no pointer ids or getPointerCount. |
GestureDetector | Partial | Android’s shape: GestureDetector(Context, OnGestureListener), onTouchEvent(MotionEvent) fed from a touch listener or a custom view’s onTouchEvent, setIsLongpressEnabled, and OnGestureListener / SimpleOnGestureListener with onDown, onShowPress, onSingleTapUp, onScroll, onLongPress, onFling. The press timers run on Executors.mainScheduledExecutor() (no Handler constructor). The tap region (12 px) and the fling travel (24 px) are measured on the dominant axis in raw coordinates; the fling velocity is the slope of the last sample. No OnDoubleTapListener / onSingleTapConfirmed, no OnContextClickListener; single touch. |
KeyEvent | Partial | D-pad codes, KEYCODE_BACK and KEYCODE_HOME, and the KEYCODE_BUTTON_A / _B / _X / _Y constants (no board maps a button to those yet: a board’s buttons arrive as the D-pad / BACK codes its board.toml names); getAction, getKeyCode, getRepeatCount, getFlags, isLongPress, isCanceled, startTracking/isTracking, getDownTime/getEventTime, dispatch with KeyEvent.Callback and KeyEvent.DispatcherState. A held key auto-repeats after ViewConfiguration.getKeyRepeatTimeout() (400 ms) every getKeyRepeatDelay() (50 ms); the first repeat is the long-press. Both special keys are handled by the framework before an app sees them: BACK falls through the soft keyboard, a showing dialog, the focused View, then Activity.onKeyDown/onKeyUp, whose defaults run onBackPressed; HOME goes straight to the launcher and cannot be intercepted, as on Android. No ACTION_MULTIPLE, meta state or characters. Which physical buttons exist is board.toml’s business — ask KeyCharacterMap.deviceHasKey. |
KeyCharacterMap | Partial | deviceHasKey(int) / deviceHasKeys(int[]): the buttons board.toml maps to key codes, plus BACK and HOME where the board synthesises them (the on-screen control on a button-less touch board; HOME from holding BACK). No character map, load, getKeyboardType or key-to-character lookups: no board has text keys. |
Menu | Partial | add (four overloads), removeItem, clear, findItem, size, getItem, hasVisibleItems, NONE, FIRST; items keep insertion order within their order. The Activity’s options menu only (onCreateOptionsMenu), presented as a list. No icons, sub-menus, groups beyond the id, shortcuts, checkable items or MenuInflater. |
MenuItem | Partial | getItemId, getGroupId, getOrder, getTitle / setTitle (text or resource), setEnabled / isEnabled, setVisible / isVisible, setOnMenuItemClickListener. No icon, shortcut, checkable state, action view or sub-menu. |
ViewConfiguration | Partial | getLongPressTimeout, getKeyRepeatTimeout, getKeyRepeatDelay (static, fixed per build). No touch slop, fling velocities or get(Context). |
LayoutInflater | Partial | from, inflate(int, ViewGroup), inflate(int, ViewGroup, boolean), and Activity.setContentView(int) / getLayoutInflater(). Layouts are compiled to binary at build time over a fixed attribute set. <include>, style= and ?attr/ are resolved at build time. A view class of the app’s own is made by a LayoutInflater.Factory (setFactory / getFactory; every Activity is one, through onCreateView(String, Context, AttributeSet)), since there is no reflection; its AttributeSet is always empty. No <merge>, Factory2 or custom attributes. See resources. |
AsyncLayoutInflater (picodroid.view) | Partial | androidx’s inflate(int, ViewGroup, OnInflateFinishedListener). Inflates on the main thread in slices of a few milliseconds per tick (Android: on a worker thread) and calls back on a tick of its own; retries after an OutOfMemoryError. A callback that no longer wants the view should close() it. Needed only for a layout that overruns the 250 ms build budget; a plain inflate is the shape. |
android.widget
| API | Status | Notes / alternative |
|---|---|---|
TextView, Button, LinearLayout, FrameLayout, ScrollView, ImageView, Switch, CheckBox, ToggleButton, RadioButton/RadioGroup, ProgressBar, SeekBar, Toast, Spinner, NumberPicker, DatePicker, TimePicker, EditText, ListView | Partial–Full | Core widgets present, each with Android’s (Context) constructor and no other (no text- or range-taking shortcuts: new Button(ctx) then setText, new SeekBar(ctx) then setMax, new ToggleButton(ctx) then setTextOn / setTextOff). Text setters take String, and TextView.setText(int resid) a string resource, as on Android. See specific divergences below. |
LinearLayout | Partial | setOrientation, setGravity (an axis the gravity does not name keeps centring; FILL places at the start), LayoutParams with weight, per-child gravity (across the row or column) and margins (space kept clear around the child; the gap between children is their margins, as on Android). No setWeightSum, dividers or baseline alignment. |
Toolbar | Partial | A ViewGroup, DEFAULT_HEIGHT (40) px tall unless its params say otherwise: setTitle / setSubtitle (+ getters), setTitleTextColor / setSubtitleTextColor, setNavigationOnClickListener (the button shows while a listener is set), setNavigationIcon(Drawable) / setNavigationIcon(int) / getNavigationIcon (the image replaces the stock back chevron; null / 0 brings the chevron back, where Android hides the button; getNavigationIcon is null for an icon set by resource id), getMenu / setOnMenuItemClickListener (Toolbar.OnMenuItemClickListener) / showOverflowMenu / hideOverflowMenu / isOverflowMenuShowing (the bar’s own menu, a list behind the overflow button); the app bar through Activity.setActionBar, whose options menu is then its overflow instead of the bar’s own items. App children sit at the end, centred. No logo, action icons on the bar, inflateMenu (no MenuInflater), AttributeSet constructor. Its buttons are touch targets, not focus stops: the keys use BACK and the menu key. Not on testbench_rp2040 (framework_class_excludes, with ActionBar; ~8 KB of class files): there setActionBar is out of reach and getActionBar() stays null. |
GridLayout | Partial | setColumnCount / setRowCount / setOrientation (before the first child), LayoutParams(Spec, Spec) with spec(start, size, alignment, weight) and its shorter forms, setGravity; margins space the cells, as on Android. A child’s cell is fixed when it is added; weights keep one decimal and cap at 9.9; at most 16 columns, 16 rows and 6 grids alive at once; BASELINE reads as TOP. |
CompoundButton | Partial | isChecked, setChecked, setOnCheckedChangeListener. toggle() is on Switch and ToggleButton only, not on CheckBox or RadioButton. setChecked does not fire the listener (Android’s does). |
RadioGroup | Partial | check, clearCheck, getCheckedRadioButtonId, OnCheckedChangeListener; buttons without an id are given one. |
NumberPicker | Partial | setMinValue / setMaxValue / setValue and getters, setOnValueChangedListener. Drawn as a focusable box that the keys step, not a scroll wheel. Adds setStep(int), which has no Android counterpart. No setDisplayedValues, setWrapSelectorWheel, setFormatter. |
DatePicker | Partial | A calendar (lv_calendar) with Android’s method names: updateDate(year, month, day) and init(year, month, day, listener) (month 0-based, as Android’s), getYear / getMonth / getDayOfMonth, setOnDateChangedListener. No min/max date, no spinner mode. |
TimePicker | Partial | Rollers. getHour / getMinute (hour always 0..23), setIs24HourView / is24HourView, setOnTimeChangedListener, setHour / setMinute. |
SeekBar | Partial | setMax, setProgress, getProgress, OnSeekBarChangeListener (the two tracking callbacks have default bodies, so a lambda works; fromUser is false for a programmatic change). A class of its own, not a ProgressBar subclass: no setMin, tints or getMax. |
Toast | Partial | makeText(Context, String, int), show, cancel, setDuration / getDuration. No setGravity, setView, or the resource-id makeText. |
Snackbar (Material Components, in picodroid.widget) | Partial | make(View, String, int), setAction(String, View.OnClickListener), show, dismiss, the three LENGTH_* constants. Always at the bottom of the screen; the action’s onClick receives a null view. No callbacks, setActionTextColor, setAnchorView. |
SwipeRefreshLayout (androidx.swiperefreshlayout.widget, in picodroid.widget) | Partial | setOnRefreshListener, setRefreshing. A pull-down anywhere over the child refreshes (no check that the child is scrolled to its top). No isRefreshing, colour schemes or progress offsets. |
TextView.setTextSize / getTextSize / getLineHeight | Partial | Both setTextSize overloads and every TypedValue.COMPLEX_UNIT_*. The faces are bitmaps, so a size snaps to the nearest compiled face (14, 20, 28, 64 px on the RP2350 boards; 14 alone on the RP2040 testbench) — getLineHeight() reports the face in use, getTextSize() the size set. One density: px = dp = sp. No setTypeface, setTextScaleX or autosizing. |
TextView.setGravity / getGravity | Partial | The horizontal field (LEFT/START, CENTER_HORIZONTAL, RIGHT/END) aligns the text inside a view wider than it, as on Android; the vertical field is stored and returned but not drawn — an LVGL label is its text’s height — so centre a label in a taller row through the parent LinearLayout’s gravity. android:gravity on TextView in layouts. |
LinearLayout / FrameLayout / RadioGroup defaults | Full | Flat like Android’s: no background, border, corner radius or padding until set. (Until 2026-09-24 they carried the LVGL theme’s card border, fill and padding.) setBackgroundColor honours the colour’s alpha, so Color.TRANSPARENT clears a background. |
TextView.setSingleLine / setEllipsize / setMaxLines | Partial | Over LVGL’s label long modes: the ellipsis is ASCII ..., START/MIDDLE render like END, MARQUEE scrolls circularly whether or not the view is selected, and a single-line / max-lines view is at most that many lines tall — a taller explicit height shrinks to the limit. |
ProgressBar | Partial | Android’s styles: new ProgressBar(ctx) is the indeterminate spinner, new ProgressBar(ctx, null, R.attr.progressBarStyleHorizontal) / style="?android:attr/progressBarStyleHorizontal" the determinate bar. setMax / setMin, setProgress(int, boolean animate), incrementProgressBy and the progress, progress-background and indeterminate tint lists are present. The mode is the style’s: setIndeterminate(false) leaves the spinner spinning (as Android’s indeterminate-only default style does), but setIndeterminate(true) on a horizontal bar throws UnsupportedOperationException (LVGL’s bar has no indeterminate animation and cannot become a spinner). The small and large styles are the spinner at its layout size. A ColorStateList is one colour (no state sets); setProgressBackgroundTintList and View.setBackgroundColor colour the same LVGL part; no setSecondaryProgress, setProgressDrawable, setInterpolator or tint mode. |
CircularProgressIndicator (Material Components, in picodroid.widget) | Partial | Determinate only (setIndeterminate(true) throws); one indicator colour (getIndicatorColor() returns int); no indicatorInset. Adds setStartAngle / setSweepAngle (Canvas.drawArc convention), which have no Material counterpart. |
ViewPager2 (androidx.viewpager2.widget, in picodroid.widget) | Partial | setAdapter(FragmentStateAdapter), setCurrentItem(item[, smoothScroll]), getCurrentItem, registerOnPageChangeCallback (onPageSelected, onPageScrollStateChanged, onPageScrolled), setUserInputEnabled, setOrientation / getOrientation, getScrollState, <ViewPager2> in XML. One page alive at a time: the outgoing page’s fragment is removed (state kept) and its widgets freed before the incoming page’s are made. No scroller: smoothScroll is a fade of the incoming page, the state goes SETTLING → IDLE (never DRAGGING), onPageScrolled fires once per turn with a zero offset; setOffscreenPageLimit is accepted and logged. A swipe over the page turns it, one that starts on a clickable child included. saveState() / restoreState(Bundle) are explicit (no view-state hierarchy). No page transformers, fake drags, item decorations, RecyclerView.Adapter. |
FragmentStateAdapter (androidx.viewpager2.adapter, in picodroid.widget) | Partial | createFragment, getItemCount, getItemId, containsItem, notifyDataSetChanged; pages tagged "f" + itemId (Android’s spelling, and as there an implementation detail: let a page observe its data rather than look it up by tag). Constructors take the Activity or the FragmentManager (no Lifecycle, no (Fragment) host). Page states are Bundles, saved through ViewPager2.saveState(), not with the Activity’s other fragments. |
AdapterView / Adapter / BaseAdapter / ArrayAdapter | Partial | ListView and Spinner extend AdapterView<Adapter>. Adapter is getCount / getItem / getItemId / getView(int, View, ViewGroup): ListView recycles as Android’s does: only the rows in view plus one beyond each edge exist, a row that scrolls out is handed back to getView as convertView for the position scrolling in, and notifyDataSetChanged() re-binds the live rows in place (setAdapter starts fresh). getChildAt(i) is window slot i, getPositionForView its position; getFirstVisiblePosition / getLastVisiblePosition, setSelection, smoothScrollToPosition. A list of eight rows or fewer is built whole. Rows share one height, the first row’s (Android lets each row choose); setPadding top and bottom on a long list are the list’s own. No RecyclerView, header / footer views, choice modes, dividers or OnScrollListener. Spinner renders toString() and never calls getView. ArrayAdapter has Android’s constructors and only those, (Context, int resource[, int textViewResourceId][, T[] or List<T>]): a picodroid.R.layout row (simple_list_item_1, simple_spinner_item, simple_spinner_dropdown_item, the ids of android.R.layout) draws the built-in single-line label, an app layout is inflated per row; add / addAll / insert / remove / clear notify the bound list themselves unless setNotifyOnChange(false) (Android’s notifyOnChange; notifyDataSetChanged() sets it back); getPosition. |
AdapterView.OnItemClickListener / OnItemSelectedListener | Partial | Full 4-arg onItemClick / onItemSelected(parent, view, position, id); view is the row getView built for a ListView, null for a Spinner or an addItem row (rendered natively, no Java wrapper). onNothingSelected is declared and never called. |
ImageView | Partial | setImageResource(R.drawable.*), setImageDrawable, setScaleType(ImageView.ScaleType) / getScaleType() (FIT_CENTER by default), setImageTintList / getImageTintList, setColorFilter(int) / clearColorFilter(). ScaleType is a final class of constants, not an enum. FIT_START and FIT_END draw as FIT_CENTER (LVGL fits only around the centre); MATRIX draws the identity matrix (no setImageMatrix). The tint and the colour filter share one LVGL recolour, the last one set showing, and a tint’s alpha is the recolour strength (no tint mode). No setImageBitmap, setImageURI or setAdjustViewBounds. |
EditText + TextWatcher | Partial | A TextView (setTextSize, setTextColor, setGravity, setSingleLine reach the field; setEllipsize / setMaxLines do nothing on one). Single-line. getText() returns String. TextWatcher takes String (no CharSequence/Editable); only afterTextChanged fires in v1. setInputType with picodroid.text.InputType: the class picks the keyboard (number and phone open the digit pad), the password variations mask the field, the rest is accepted and ignored. OnEditorActionListener is a top-level picodroid.widget interface taking the EditText; actionId is always EditorInfo.IME_ACTION_DONE and event always null. |
android.util
| API | Status | Notes / alternative |
|---|---|---|
Log (v/d/i/w/e) | Full | Maps to defmt levels on device; the simulator prints every level as [Tag] msg. Filter by tag/level with pdb logcat --stdin. |
TypedValue.COMPLEX_UNIT_* / applyDimension | Partial | The six units and the conversion; nothing else of TypedValue (no TYPE_*, no getDimension). One density, so PX, DIP and SP are identities; PT / IN / MM use the panel’s real pitch (xdpi), so they are ruler measurements. |
DisplayMetrics | Partial | widthPixels, heightPixels, density (1), densityDpi (160), scaledDensity (1), xdpi / ydpi (the panel’s physical pixels per inch, from the board file), setToDefaults(); from Resources.getDisplayMetrics() or Display.getMetrics(DisplayMetrics). |
android.graphics
| API | Status | Notes / alternative |
|---|---|---|
Color | Full | Named constants + ARGB ints. |
drawable.GradientDrawable | Partial | GradientDrawable() (a white rectangle; Android’s starts transparent), GradientDrawable(Orientation, int[]), setColor, setColors / getColors, setOrientation / getOrientation, setCornerRadius(float), setStroke(width, color); the setters return void, as on Android. A gradient draws the first and last of its colours. Orientation has TOP_BOTTOM, BOTTOM_TOP, LEFT_RIGHT and RIGHT_LEFT only, as constants of a final class rather than an enum (no values() or switch; an enum’s tables would cost flash on every board). No diagonal orientations, radial or sweep gradients, shapes other than the rectangle, or per-corner radii. |
drawable.Drawable / drawable.BitmapDrawable | Partial | What View.setBackground and ImageView.setImageDrawable accept (applyTo(View) is framework-internal, @Hide). BitmapDrawable is the icon PackageManager.getApplicationIcon returns; apps do not build one. A res/drawable/*.xml <shape> used as an android:background arrives as a GradientDrawable. No draw(Canvas), bounds, state or Drawable.Callback. |
View.onDraw(Canvas), View.invalidate() / postInvalidate() | Partial | A view made with new View(Context) (or a subclass) draws what its onDraw draws. onDraw runs on the main thread after invalidate(), not every frame; invalidate() on a framework widget does nothing. Every RP2350 board; not the RP2040 testbench (has_canvas = false, flash). |
Canvas | Partial | drawColor, drawRect, drawRoundRect, drawCircle, drawLine, drawArc, drawText, getWidth/getHeight. Recorded, not rasterised: about 60 calls per view. No Path, Bitmap, save/restore, clipping, transforms or Rect/RectF overloads; ovals and arcs are circular. |
Paint | Partial | Colour and alpha, Style, stroke width, Cap (SQUARE draws as BUTT), text size (snaps to a compiled face) and align, ascent, descent, measureText. No shaders, path effects or typefaces; always anti-aliased. |
Bitmap | Unsupported | No pixel buffers: a full-screen bitmap is 150 KB of RAM. |
android.content
| API | Status | Notes / alternative |
|---|---|---|
Intent | Partial | Explicit (class-targeted) intents, broadcast intents (new Intent(String action), setAction / getAction, getParcelableExtra, the ACTION_TIME_TICK / ACTION_TIME_CHANGED / ACTION_TIMEZONE_CHANGED + EXTRA_TIMEZONE / ACTION_SCREEN_ON / ACTION_SCREEN_OFF / ACTION_BOOT_COMPLETED / ACTION_MAIN strings with Android’s values), new Intent(Context, Class) (Android’s form; there is no one-argument Intent(Class)), + extras (int, long, boolean, String, Bundle; putExtras / getExtras), setClassName, getComponent() (a ComponentName with this app’s package and the dot-separated class), and on a multi-app board setPackage, which launches another installed app (extras do not cross over). No implicit intents / IntentFilter resolution, no Parcelable / Serializable extras. |
Context | Partial | getSystemService(String) (SENSOR_SERVICE, NOTIFICATION_SERVICE, ALARM_SERVICE, STORAGE_STATS_SERVICE, CONNECTIVITY_SERVICE, WIFI_SERVICE, POWER_SERVICE), the only way to a system service: each manager’s static getInstance() is framework-internal (@Hide), as are PackageManager.getInstance() (use getPackageManager), Resources.getInstance() (getResources) and Display.getInstance() (getDisplay). getDisplay() answers on any Context (Android’s throws for one with no window: a board has the one panel). getApplicationContext() returns the app’s Application, or the Context it is called on when the manifest names none. getSystemService(Class) and getSystemServiceName(Class) for the same managers. getPackageManager, getPackageName, getResources, getString(int) / getString(int, Object...), getColor(int), getSharedPreferences, the private-file API (getFilesDir, getDataDir, openFileInput / openFileOutput, fileList, deleteFile), startService / stopService, bindService(Intent, ServiceConnection, int) with BIND_AUTO_CREATE / unbindService, getMainExecutor. ServiceConnection has Android’s callbacks (ComponentName, IBinder); os.Binder is the class a LocalBinder extends. startActivity on every Context, registerReceiver(BroadcastReceiver, IntentFilter) / the int flags form (RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED accepted, without effect) / unregisterReceiver / sendBroadcast(Intent) (asynchronous, in-app). registerComponentCallbacks / unregisterComponentCallbacks (see ComponentCallbacks2). |
BroadcastReceiver | Partial | onReceive(Context, Intent) on the main thread for the system actions (Intent.ACTION_TIME_TICK every minute, ACTION_TIME_CHANGED, ACTION_TIMEZONE_CHANGED, ACTION_SCREEN_ON / OFF, WifiManager’s and ConnectivityManager’s actions on a network board), an app’s own sendBroadcast, and PendingIntent.getBroadcast alarms. At most 8 registered per app; a leaked one is unregistered at the Activity’s destroy with Android’s warning. Manifest <receiver> for BOOT_COMPLETED / TIME_SET / TIMEZONE_CHANGED (delivered by a headless run of the app) and for explicit targets. No ordered or sticky broadcasts, goAsync, setResult*, peekService. |
IntentFilter | Partial | Actions only: IntentFilter() / (String) / (IntentFilter), addAction, hasAction, matchAction, countActions, getAction(int); at most 8 actions. No data, type, category or priority matching. |
pm.PackageManager | Partial | hasSystemFeature (FEATURE_WIFI, FEATURE_ETHERNET, FEATURE_TOUCHSCREEN), getInstalledPackages, getPackageInfo, getLaunchIntentForPackage, getApplicationLabel, getApplicationIcon, getPackageInstaller; flags arguments are ignored. No permissions, resolveActivity or queryIntentActivities. |
res.Resources | Partial | getString(int) / getString(int, Object...), getText, getColor, getDimension, getDimensionPixelSize, getDimensionPixelOffset, getInteger, getBoolean, getDisplayMetrics, getConfiguration, Resources.NotFoundException. No getDrawable, arrays, plurals or getIdentifier. See resources. |
res.Configuration | Partial | screenWidthDp / screenHeightDp / smallestScreenWidthDp (the app’s window — its <supports-screens> design size, else the panel — in dp, which is a pixel), densityDpi (always 160), orientation, touchscreen (FINGER / NOTOUCH), navigation (DPAD where the board has the four keys, else NONAV), keyboard (always NOKEYS), isLayoutSizeAtLeast, setTo, setToDefaults, toString. A snapshot from Resources.getConfiguration(): nothing changes while an app runs, so no onConfigurationChanged. No locale, uiMode, fontScale, screenLayout, colorMode or mcc/mnc. |
ComponentCallbacks / ComponentCallbacks2 | Partial | onTrimMemory(int), onLowMemory(), the seven TRIM_MEMORY_* constants, and Context.registerComponentCallbacks / unregisterComponentCallbacks; Activity, Application and Service implement ComponentCallbacks2. What arrives: TRIM_MEMORY_RUNNING_CRITICAL when the LVGL pool is below an eighth free or the native heap below a sixteenth, once per episode from the event loop and, at an Activity launch, before the framework destroys a covered Activity to make room; onLowMemory means that destruction is about to happen anyway. Delivered in Android’s order: the Application (whose default fans out the registered callbacks), every live Activity in creation order, every live Service. The other levels never arrive (one app runs at a time, so its UI is never hidden or in the background), onConfigurationChanged is never called (see res.Configuration), and fragments are not forwarded. Dropping views in onTrimMemory returns their memory to the LVGL pool, which is what saves a covered Activity; dropping Java objects stops the JVM growing but returns nothing to the native heap (the JVM keeps its capacity), and an app that grows its objects past the heap reaches OutOfMemoryError without a trim first, since the JVM’s arenas grow in one copying step rather than gradually. |
res.ColorStateList | Partial | One colour: valueOf, getDefaultColor, withAlpha, isStateful (false), getColorForState. No state sets. |
SharedPreferences / Editor | Partial | Backed by LittleFS. getString/getInt/getLong/getFloat/getBoolean, getAll, contains, and the matching put*, remove, clear, commit, apply. Context.getSharedPreferences returns one instance per file, safe from any thread; apply() updates memory at once and writes the file on a background thread (finished when the Activity stops), commit() writes before returning. A failed write leaves the new values in memory, as on Android. getSharedPreferences is the only way to an instance. No getStringSet/putStringSet, no OnSharedPreferenceChangeListener. |
DialogInterface | Partial | dismiss, cancel, OnClickListener, OnMultiChoiceClickListener, the three button constants. OnDismissListener is declared, but nothing takes one yet; no OnCancelListener or OnShowListener. |
android.net
| API | Status | Notes / alternative |
|---|---|---|
ConnectivityManager | Partial | getSystemService(CONNECTIVITY_SERVICE); registerDefaultNetworkCallback, registerNetworkCallback(NetworkRequest, cb), requestNetwork, unregisterNetworkCallback, getActiveNetwork, getNetworkCapabilities, getLinkProperties (LinkProperties.getLinkAddresses(): the link’s one IPv4 address, whatever the link; no routes, DNS servers, MTU, interface name, and LinkAddress has no prefix length), the TYPE_* constants. No getActiveNetworkInfo, bindProcessToNetwork, isActiveNetworkMetered. |
ConnectivityManager.NetworkCallback | Partial | onAvailable, onCapabilitiesChanged, onLost delivered on the main thread by the Activity event loop; onLosing / onUnavailable declared, never called. No onLinkPropertiesChanged, onBlockedStatusChanged. |
Network | Partial | One per link-up; getNetworkHandle, openConnection(URL), equals/hashCode/toString. No getSocketFactory, bindSocket, getAllByName. |
NetworkCapabilities | Partial | hasTransport, hasCapability; the TRANSPORT_* / NET_CAPABILITY_* constants a board can show. VALIDATED means up with an address (no internet probe). No Builder, getLinkDownstreamBandwidthKbps, getTransportInfo. |
NetworkRequest / Builder | Partial | addTransportType, removeTransportType, addCapability, removeCapability, clearCapabilities, build; hasTransport, hasCapability. No setNetworkSpecifier. |
NetworkInfo | Unsupported | No instances and no app-visible members: its static isConnected(), getIpAddress() and getType() are framework-internal (@Hide). Use ConnectivityManager.getActiveNetwork() != null for a point check, registerDefaultNetworkCallback to react to the link, getLinkProperties(network).getLinkAddresses() for the address and getNetworkCapabilities(network).hasTransport(NetworkCapabilities.TRANSPORT_WIFI) for the link type. |
SntpClient | Full | requestTime(String host, int timeoutMs), getNtpTime, getNtpTimeReference, getRoundTripTime. Public here (hidden API on Android). Apps need not use it: the platform’s time service anchors the clock from pool.ntp.org once the link is up and every six hours after (Settings.Global.AUTO_TIME turns it off). |
wifi.WifiManager | Partial | getSystemService(WIFI_SERVICE); startScan, getScanResults, registerScanResultsCallback / unregisterScanResultsCallback, getConnectionInfo, getConfiguredNetworks, addNetwork / updateNetwork / enableNetwork / removeNetwork, disconnect / reconnect / reassociate, isWifiEnabled, getWifiState, calculateSignalLevel, compareSignalLevel. One saved network (its networkId is 0); setWifiEnabled is accepted and ignored. SUPPLICANT_STATE_CHANGED_ACTION (+ EXTRA_NEW_STATE, EXTRA_SUPPLICANT_ERROR), NETWORK_STATE_CHANGED_ACTION and SCAN_RESULTS_AVAILABLE_ACTION as broadcasts. A failed join’s reason arrives as Android reports it, EXTRA_SUPPLICANT_ERROR (ERROR_AUTHENTICATING, ERROR_NETWORK_NOT_FOUND, ERROR_GENERIC) on the supplicant-state broadcast. No WifiNetworkSuggestion / WifiNetworkSpecifier, no locks. |
wifi.ScanResult / wifi.WifiInfo / wifi.WifiConfiguration / wifi.SupplicantState | Partial | ScanResult’s public fields (SSID, BSSID, level, frequency, capabilities, timestamp always 0); whether a network is secured is read from capabilities as on Android (WPA or WEP in it; an open network reports [ESS]). WifiInfo: getSSID, getBSSID (always 02:00:00:00:00:00), getRssi, getIpAddress, getNetworkId, getSupplicantState. WifiConfiguration: SSID, BSSID, preSharedKey, networkId, status, hiddenSSID; no allowedKeyManagement. SupplicantState has DISCONNECTED, ASSOCIATING, COMPLETED only. |
java.net and javax.net.ssl
The networking classes live in picodroid.net; the exceptions are the real java.net and
javax.net.ssl ones. See Networking.
| API | Status | Notes / alternative |
|---|---|---|
URL (picodroid.net) | Partial | http and https; getProtocol, getHost, getPort (the scheme’s default when omitted), getPath (includes the query string), openConnection. No getQuery, getFile, openStream, URI. |
HttpURLConnection (picodroid.net) | Partial | GET / POST / PUT; setConnectTimeout / setReadTimeout, setRequestProperty / addRequestProperty / getRequestProperty (16 headers at most), setDoOutput, setFixedLengthStreamingMode (required for a body; no chunked upload), getResponseCode, getResponseMessage, getHeaderField / getHeaderFieldKey, getContentLength, getInputStream / getErrorStream / getOutputStream, disconnect, the HTTP_* constants. The streams are HttpInputStream / HttpOutputStream, which extend java.io.InputStream / OutputStream, so new BufferedReader(new InputStreamReader(conn.getInputStream())) works as written. Connection: close always; no redirects followed for you, caching or cookies. Adds AutoCloseable. |
HttpsURLConnection (javax.net.ssl, in picodroid.net.ssl) | Partial | TLS 1.3 against a compiled-in root store, on boards with has_tls = true; getCipherSuite. No setSSLSocketFactory, setHostnameVerifier, getServerCertificates. |
Socket / ServerSocket (picodroid.net) | Renamed | Not java.net’s method surface: connect(int addr, int port) takes a packed IPv4 address, the receive timeout is setTimeout(int), and raw I/O is send(byte[], int, int) / recv(byte[], int, int). getInputStream() / getOutputStream() return java.io streams over them (each call a new wrapper on the same socket; close on either closes the socket), so PrintWriter / BufferedReader over a socket work as on Android. ServerSocket(int port), accept, setSoTimeout, close. |
DatagramSocket / DatagramPacket (picodroid.net) | Partial | send, receive (whole datagrams, up to 65,507 bytes), setSoTimeout, setBroadcast / getBroadcast (recorded, not enforced), close. DatagramPacket has the window API: the offset constructors, getOffset, setData, setLength, setAddress, setPort; getAddress() returns an InetAddress. No connect, multicast or getLocalPort. |
InetAddress (picodroid.net) | Partial | IPv4 only. getByName, getByAddress(byte[]), getAddress(), getHostAddress; also picodroid’s getByAddress(int a, int b, int c, int d), new InetAddress(int) and getRawAddress() for the packed form the sockets take. No getAllByName, getHostName, isReachable. |
java.net / javax.net.ssl exceptions | Full | ConnectException, BindException, NoRouteToHostException, SocketException, SocketTimeoutException, UnknownHostException, ProtocolException, SSLException, SSLHandshakeException, SSLPeerUnverifiedException, with Java’s hierarchy. |
android.os
| API | Status | Notes / alternative |
|---|---|---|
SystemClock | Partial | elapsedRealtime, elapsedRealtimeNanos, sleep(int), setCurrentTimeMillis (always succeeds). No uptimeMillis or currentThreadTimeMillis. |
Handler / Looper / Message | Unsupported | Post to the UI with Context.getMainExecutor().execute(Runnable) or View.post(Runnable) (Activity.runOnUiThread(Runnable) also exists); for delayed or repeating work on the main thread, Executors.mainScheduledExecutor() (schedule, scheduleAtFixedRate). There is no postDelayed. |
PowerManager | Partial | isInteractive() (whether the display is on), from getSystemService(POWER_SERVICE). No wake locks: a dark panel does not stop the CPU, the app keeps running (docs/designs/app-portability-2026-10.md K5). Related: View.setKeepScreenOn / getKeepScreenOn, Activity.setTurnScreenOn, KeyEvent.KEYCODE_POWER / SLEEP / WAKEUP. |
Bundle | Partial | Intent extras, saved instance state and fragment arguments. put / get for boolean, int, long, float, double, String, int[], byte[], String[] and nested Bundle, with the default-taking getters; get, containsKey, remove, clear, size, isEmpty, keySet, putAll, the copy constructor. No Parcelable / Serializable, no short / char / byte scalars or ArrayList values. |
android.provider
| API | Status | Notes / alternative |
|---|---|---|
Settings.System | Partial | getInt / putInt for one setting, SCREEN_OFF_TIMEOUT (milliseconds, 0 never), stored at /system/display and read by the display’s idle timer. Any other name reads as its default and refuses a write. Context.getContentResolver() returns the handle they take; there are no content providers. |
Settings.Global | Partial | getInt / putInt for one setting, AUTO_TIME (1 by default: the platform time service anchors the clock from the network), stored at /system/time with the zone. No AUTO_TIME_ZONE (SNTP carries no zone). |
android.hardware
| API | Status | Notes / alternative |
|---|---|---|
Sensor / SensorManager / SensorEvent / SensorEventListener | Partial | Board-dependent sensors; registration + event callbacks. |
Concurrency
| API | Status | Notes / alternative |
|---|---|---|
Thread (java.lang.Thread) | Full | start() spawns a real FreeRTOS task on device and in the simulator (the sim runs the real kernel). run() override or Runnable target, sleep, join/join(ms), interrupt/isInterrupted/interrupted, isAlive, currentThread, get/setName, getId, yield, UncaughtExceptionHandler (per-thread and default), IllegalThreadStateException on a second start(). synchronized blocks and methods are real kernel mutexes; Object.wait/notify/notifyAll work (timed, interruptible, IllegalMonitorStateException when not owner). Divergences: setPriority and setDaemon are advisory (every Java task runs at one RTOS priority — see the system reference), and a compute-bound thread holds the core until it blocks (no time slicing). |
Executor / Executors (mainExecutor / backgroundExecutor) | Full | The recommended concurrency primitive. To post to the UI thread an app writes Android’s Context.getMainExecutor() or View.post, which reach the same queue as Executors.mainExecutor(). |
ExecutorService / Future / Callable / TimeUnit (picodroid.concurrent) | Partial | Executors.newFixedThreadPool(n) and newSingleThreadExecutor(): execute, submit(Runnable/Callable), Future.get/get(timeout, unit)/cancel/isDone/isCancelled, shutdown/shutdownNow/isShutdown/isTerminated/awaitTermination; ExecutionException (with getCause()), CancellationException, TimeoutException, RejectedExecutionException under their java.util.concurrent names. Pure Java over Thread + wait/notify; each worker costs a 16 KiB task stack. Not built into testbench_rp2040 (framework_class_excludes, flash headroom) — nor are the atomics and CountDownLatch below. No invokeAll/invokeAny, no cached pools, no CompletableFuture; scheduling is Executors.newSingleThreadScheduledExecutor() (its own thread, as in the JDK) or Executors.mainScheduledExecutor() (the main thread; picodroid’s own). |
AtomicInteger / AtomicLong / AtomicBoolean / AtomicReference (picodroid.concurrent) | Partial | get/set/getAndSet/compareAndSet/incrementAndGet/getAndIncrement/decrementAndGet/addAndGet/getAndAdd. synchronized underneath (one core, one JVM priority). No updateAndGet/lambdas, no AtomicIntegerArray. |
CountDownLatch (picodroid.concurrent) | Full | countDown, await, await(timeout, unit), getCount. No Semaphore, CyclicBarrier, ReentrantLock, ConcurrentHashMap, BlockingQueue. |
org.json
| API | Status | Notes / alternative |
|---|---|---|
JSONObject / JSONArray / JSONException (picodroid.json) | Partial | Android’s org.json method surface for the two classes: constructors from text, Map, Collection and arrays; get/opt with Android’s coercions; put/putOpt/accumulate/append/remove; keys/names/keySet; toString/toString(indent); quote/numberToString/wrap; NULL. Documents live in a native node pool (2048 nodes, 16 KiB of strings, 32 levels) reclaimed with the GC; child wrappers share nodes but are not ==. Strict RFC 8259 parser (no lenient JSONTokener extras), no JSONTokener/JSONStringer, keySet() unordered. Only on boards with has_json = true in board.toml — every RP2350 board; not testbench_rp2040, where the API contract rejects the classes at build time. See JSON. |
com.google.protobuf
| API | Status | Notes / alternative |
|---|---|---|
CodedInputStream / CodedOutputStream / MessageLite / WireFormat / InvalidProtocolBufferException (picodroid.protobuf) | Partial | protobuf-javalite’s stream surface: readTag, every readXxx, skipField, pushLimit/popLimit, readString/readBytes (a byte[], no ByteString); every writeXxx/writeXxxNoTag and computeXxxSize. Varints, fixed-width values and skipping are native (micropb); strings, byte arrays, zigzag and limits are Java. Message classes come from protoc-gen-picodroid: mutable, setters instead of Builders, enums as int constants, arrays instead of Lists, proto3 only, no map/oneof/groups/extensions/reflection. Only on boards with has_protobuf = true in board.toml — every RP2350 board; not testbench_rp2040, where the API contract rejects the classes at build time. See Protocol Buffers. |
android.media
| API | Status | Notes / alternative |
|---|---|---|
ToneGenerator (picodroid.media) | Partial | Android’s constant names, values and CEPT cadences for the DTMF, TONE_SUP_* and TONE_PROP_* families (0-28, plus TONE_SUP_CONFIRM and TONE_SUP_PIP); startTone(int), startTone(int, int), stopTone, release. The output is one piezo on a PWM pad, so tones are monophonic square waves: each plays the lowest component of Android’s multi-frequency tone, and DTMF therefore will not decode. No CDMA tone range, no intercept tones, no getAudioSessionId. Adds startToneSequence(int[], int[]), which has no Android counterpart. Segments advance on the UI frame tick. Needs an [audio] section in board.toml; without one the class is still present and every method is a safe no-op. See Audio. |
AudioManager (picodroid.media) | Partial | The STREAM_* constants only, with Android’s values, so a ToneGenerator reads as it does on Android. No mixer, no volume control, no playSoundEffect, no focus API. |
MediaPlayer / AudioTrack / SoundPool / MediaRecorder | None | No hardware path: a piezo buzzer has no DAC, no I2S and no amplifier behind it. There is no alternative for sampled audio; use ToneGenerator for tones. |
java.* standard library
Enforced at build time: every app’s verifyApiContract Gradle task (part of
assemblePapk, so build-apk.sh, sim.sh, build.sh and flash.sh all run
it) rejects a java.* class or member pico-jvm does not serve, naming the
call site and an alternative. sdk/api-contract.tsv, generated from the
runtime’s own tables (scripts/gen-api-contract.sh), is the machine-readable
form of this section. With --board <name> (or -Ppicodroid.board=<name>)
the same task also rejects classes that board drops from its framework
(framework_class_excludes), and it rejects a reference to a framework-internal
@Hide member of the picodroid.* SDK (see
cross-cutting divergences).
-Ppicodroid.apiContract=warn downgrades the failure to a report while
experimenting.
| API | Status | Notes / alternative |
|---|---|---|
Object.clone() / Cloneable | Partial | Shallow copy works, but the Cloneable check is skipped — clone() never throws CloneNotSupportedException. |
Interface default methods | Full | Resolved per JVMS §5.4.3.3 (sub-interface overrides win whatever the implements order; I.super.f() works; defaults are found through abstract and builtin superclasses). A default method called on a lambda object runs the interface’s body, which reaches the lambda through its single abstract method (until 2026-09-13 it ran the lambda body instead). |
StringBuilder.append(Object) / String.valueOf(Object) / "" + obj | Full | The argument’s toString() runs first — a Java override, else the builtin one for boxes/enums, else the identity form pkg.Cls@hhhh; null prints null. |
Object.equals/hashCode/toString defaults | Partial | Identity semantics as in Java, but hashCode() is the object’s heap slot index (stable for the object’s lifetime, reused after GC). HashMap/HashSet/ArrayList.contains/remove(Object) compare keys with your equals(Object) override when the class has one (identity otherwise; hashCode() is never consulted — the buffers are linear), and boxes by class and value (Integer(1) is not Short(1); Double keys follow Double.equals). The builtin collections’ own hashCode()/toString() are the identity forms (list.toString() prints java.util.ArrayList@…, not the elements). |
instanceof / checkcast | Partial | Strings, arrays, builtin collections under List/Collection/Iterable/Set/Map, boxes under Number/Comparable, lambdas under their interface, and transitive superinterfaces all work; a failed cast throws a catchable ClassCastException (with a null message). A reference array’s element class is not recorded, so (String[]) someObjectArray succeeds where Java would throw. |
Boxed wrappers (Integer, Float, …) | Partial | equals/hashCode/compareTo, the compare/hashCode(x) statics and Float.floatToIntBits follow Java 8. The xxxValue() accessors convert as Java does (Float.valueOf(2.5f).intValue() is 2, Integer.valueOf(300).byteValue() is 44), and valueOf shares one box per value across the JLS §5.1.7 range, so Integer a = 127, b = 127; a == b holds as on Android (new Integer(5) is always distinct). Character has isDigit/isLetter/toUpperCase/toLowerCase only, ASCII-only (strings are byte-backed). |
Enum.valueOf(Class, String) | Full | Served by the interpreter, so every enum’s own valueOf(String) works: the constants are the enum class’s static fields of its own type, matched by name; an unknown name throws IllegalArgumentException("No enum constant …"), a null name NullPointerException. Enum.hashCode() is the ordinal. |
Throwable | Partial | addSuppressed/getSuppressed/getCause stored; ExceptionInInitializerError wraps <clinit> throws. A failed <clinit> does not poison the class (no NoClassDefFoundError on re-access). |
Comparator + Collections.sort(List, Comparator) | Full | Lambda comparators supported; list.sort(null) and Collections.sort(list) are natural ordering (compareTo). |
OutOfMemoryError | Full | A failed allocation — new, an array, a growing collection or builder, a box — collects first and throws a catchable OutOfMemoryError only when that frees nothing; one error object is kept in reserve for the moment the heap cannot even hold the exception. clear() on a builtin collection releases its buffer, so it is the way to give memory back from a handler; the arena is small and fragments, so hold no more than a few hundred boxed entries per collection. |
Interface-typed collections (List/Set/Collection/Map/Iterable) | Full | Map<String,String> m = new HashMap<>(); and interface-typed fields, parameters, returns, casts, instanceof and enhanced-for all work — the JVM dispatches on the receiver’s runtime class, so the interfaces need no class file. Caveat: your app compiles against the JDK’s full interfaces, so members picodroid does not implement (map.forEach, list.removeIf, Map.putAll, new TreeMap<>()) compile and then fail at run time. The rows in this table are the served surface. |
HashMap.entrySet() / Map.Entry | Partial | entrySet(), keySet() and values() views answer iterator() and size(); the key and value views also contains() (k in map.keys). Entries answer getKey()/getValue() (no setValue). Iteration order is the map’s internal order. |
HashSet.iterator() | Full | for (x : set) and every iterating idiom on a set; hash order, like the map views. Iterators and map views keep a temporary collection alive for as long as they do (for (String w : text.split(" ")), for (e : makeMap().entrySet())) — the GC pins the iterator’s source. |
Map.putAll / List.listIterator / Arrays.equals | Unsupported | No builtin arm: copy with an entrySet() loop, iterate by index, compare arrays element-wise. Kotlin: map += otherMap, list.last { } / indexOfLast { } / findLast { } (they walk a listIterator) and contentEquals hit these. |
Float.isNaN(f) / Double.isNaN(d) / isInfinite / isFinite, static and instance | Full | Kotlin’s isNaN()/isInfinite()/isFinite() inline to these statics. |
StringBuilder.insert / setLength / delete / deleteCharAt / setCharAt / reverse | Full | insert takes every append kind; indices are byte indices (the string model is bytes), setLength pads with NUL bytes, reverse reverses bytes. |
java.util.function (Function, BiFunction, Consumer, BiConsumer, Supplier, Predicate, BiPredicate, UnaryOperator, BinaryOperator, IntFunction, IntPredicate, IntConsumer, IntSupplier, ToIntFunction, IntUnaryOperator, IntBinaryOperator) | Partial | The one abstract method of each, as a lambda, a method ref or an implementing class; instanceof sees the operator interfaces as their base Function / BiFunction. No default methods (andThen, negate, compose, identity), and no collection method takes one yet (forEach, removeIf, computeIfAbsent). |
String.join | Partial | join(delim, a, b, …) / join(delim, String[]) and join(delim, ArrayList); elements must be String or null (a StringBuilder element throws). Any other Iterable is rejected. |
java.util.Objects | Full | equals, hashCode, hash, toString(o), toString(o, default), requireNonNull (both forms), isNull, nonNull. A real class, so equals/hashCode/toString reach your overrides. |
String(char[]) | Unsupported | Only the byte[] constructors exist; build with StringBuilder.append(char) (Kotlin: chars.concatToString() does this). |
Math.round | Partial | Rounds half away from zero (Math.round(-2.5f) is -3; Java gives -2). Kotlin’s roundToInt()/roundToLong() shim spells out Java’s floor(x + 0.5) and is exact. |
Math.floorDiv / floorMod / addExact / subtractExact / multiplyExact / toIntExact | Full | The int and long forms, as bodied Java in the SDK; the *Exact ones throw ArithmeticException on overflow. |
java.time — LocalDate, LocalTime, LocalDateTime, Instant, Duration, ZoneOffset, ZoneId, Month, DayOfWeek, Year, DateTimeFormatter, ChronoUnit | Partial | An SDK port of the JDK classes with their JDK descriptors, so Instant.now().plus(Duration.ofMinutes(5)), LocalDate.of(…).plusMonths(1), ChronoUnit.DAYS.between(a, b), LocalDateTime.ofInstant(instant, zone), date.format(DateTimeFormatter.ofPattern("EEE d MMM")) and ISO parse/toString all behave as on Android. No tz database: every ZoneId is a fixed offset (ZoneId.of("UTC+05:30"), ZoneOffset.ofHours(-8); a region id throws DateTimeException), ZoneId.systemDefault() is UTC until TimeZone.setDefault(TimeZone.getTimeZone("GMT+05:30")), and there is no ZonedDateTime, OffsetDateTime, Period, TemporalField/ChronoField, TemporalAdjusters or locale-aware formatting (DateTimeFormatter.ofPattern covers y u M L d D E a H h m s S and '…' literals, with English month and day names; parse reads ISO-8601 only). now() reads System.currentTimeMillis(), which counts from boot until SystemClock.setCurrentTimeMillis. Not on testbench_rp2040 (framework_class_excludes; ~67 KB of class files). See java.time. |
java.util.TimeZone | Partial | Fixed-offset zones only: getTimeZone("GMT+05:30"), getTimeZone(ZoneId), getDefault/setDefault (null restores UTC), getID, getRawOffset, getOffset(long), toZoneId, useDaylightTime (false). An unknown id is GMT, as in the JDK. |
String.replace(target, replacement) | Full | An empty target interleaves the replacement between every char and at both ends, as in Java ("ab".replace("", "-") is -a-b-). |
LinkedHashMap / LinkedHashSet | Partial | Aliases of HashMap / HashSet: insertion order is not preserved. instanceof HashMap/Map/Set hold. |
Collection.toArray() / toArray(T[]) | Partial | Always returns a fresh Object[] of exactly the collection’s size — the array argument is neither filled nor returned (list.toArray(new String[0]) is the idiom to use; a cast to String[] succeeds because reference arrays carry no element class). |
java.util.Locale | Partial | Name-only: Locale.ROOT/US/… read as null, and toUpperCase(Locale)/toLowerCase(Locale) ignore the argument (ASCII only). This is what Kotlin’s uppercase()/lowercase() compile to. No Locale instances. |
Class.getName() | Full | Returns dot-form (pkg.Class) per the Java spec. |
javax.inject.Inject / Singleton / Scope | Partial | Compile-time only: an annotation processor generates Foo_Factory / Foo_MembersInjector, and Application / Activity / Service are injected automatically before onCreate. SOURCE retention (JSR-330 says RUNTIME) — no runtime annotations, no reflection. javax.inject.Provider<T> / picodroid.di.Lazy<T> (≙ dagger.Lazy) inject anywhere a T can; picodroid.di.Module / picodroid.di.Provides (≙ dagger.Module / dagger.Provides) bind SDK types and interfaces, every module auto-installed. The framework binds @ApplicationContext Context (picodroid.di.ApplicationContext ≙ Hilt’s dagger.hilt.android.qualifiers.ApplicationContext) and Application, as Hilt does; with no manifest Application they resolve to a bare one made on first use (Android always has one). No @Component, @Binds, @Named/custom qualifiers, custom scopes. Java and Kotlin apps (the Kotlin plugin runs the same processor through kapt; Kotlin shapes: @Inject lateinit var, @Inject constructor, @Module object + @JvmStatic @Provides, @Module class for instance @Provides). See Services & DI. |
String.split | Partial | Literal delimiters only — no regex. |
java.io streams — InputStream, OutputStream, ByteArrayInputStream, ByteArrayOutputStream, Reader, Writer, InputStreamReader, BufferedReader, OutputStreamWriter, PrintWriter, Closeable | Partial | Pure-Java SDK classes with the JDK surface (BufferedReader.readLine, PrintWriter.println, the base-class defaults an app’s own stream inherits). picodroid.io.FileInputStream/FileOutputStream, HttpInputStream/HttpOutputStream and Socket.getInputStream()/getOutputStream() are java.io streams. Strings are UTF-8 bytes: the readers decode UTF-8 and the writers encode it whatever charset name they were given; ByteArrayOutputStream.toString() keeps valid UTF-8 and maps each byte of an invalid sequence to ?. No FileReader/FileWriter (wrap the file streams), DataInputStream, BufferedInputStream, StringReader/StringWriter, java.nio. testbench_rp2040 drops the reader/writer classes (Reader, Writer, InputStreamReader, BufferedReader, OutputStreamWriter, PrintWriter); the byte streams stay. See java.io streams. |
Cross-cutting divergences
- Coordinates and sizes are
intpx. There is nofloatMotionEventcoordinate and one display density:dpandspin a resource file are accepted and mean one logical pixel each, andgetResources().getDisplayMetrics()reportsdensity1 at 160 dpi, withxdpi/ydpithe panel’s real pitch. Every board is at least 240×240 logical pixels; lay out against that floor and letmatch_parent, weights and margins take up the rest (docs/designs/app-portability-2026-10.md). - Resources have no configurations.
res/values,res/layoutandres/drawablecompile into the PAPK with a generatedRclass (see resources), but there is one display, density and locale: qualified directories (values-night/,drawable-hdpi/) are a build error, and plurals and string arrays do not exist. Styles and the theme are resolved at build time: there is one theme per app (the style the manifest’sandroid:themenames, else the one calledAppTheme), applied before the firstonCreatewhen the manifest names it, else byContext.setTheme, which hands its colours to the widgets. - No
Handler/Looper. The main loop is an executor-driven dispatcher; post to it withContext.getMainExecutor()orView.post, and use the scheduled executor (Executors.mainScheduledExecutor()) for delayed work. - Framework-internal members are
@Hide. Java has no visibility between package and public, so a few SDK members staypublicfor the framework’s own cross-package use and carrypicodroid.annotation.Hide, Android’s@hide(each manager’sgetInstance(),NetworkInfo’s statics,WifiManager.getLastError(),Drawable.applyTo). They compile, but an app’sverifyApiContractfails on a reference to one, or to an override of one, and prints the Android spelling to use instead (see troubleshooting). - Custom
Interpolators fall back to linear. Standard interpolators (linear/accelerate/decelerate/accelerate-decelerate) map to native easing; an app-definedInterpolatorcan’t be up-called from the native tick, so it falls back to linear with aLog.w.
Imports
Always import the picodroid.* classes directly — e.g.
import picodroid.view.View;, import picodroid.widget.TextView;. There is no
android.* import compatibility layer: import android.view.View; will not
compile or load. The package names below mirror Android’s only so the API reads
the same and intuition transfers; the namespace you import is picodroid.