# Common mistakes and checklist

Each item maps to an official page; see `sources.md`.

## Common mistakes

- Calling SDK methods before `await waitForEvenAppBridge()` -> blank screen.
- No container with `isEventCapture: 1`, or more than one -> no input or validation error.
- Listening for DOM clicks instead of `onEvenHubEvent`; forgetting that click can be `undefined`.
- `textContainerUpgrade` with a different `containerID`/`containerName` -> silent no-op.
- Rebuilding a page without `menuObject` -> custom menu items disappear.
- Mixing pages where only some containers set `zOrderIndex`.
- Sending image data during page creation or two `updateImageRawData` calls at once.
- Using `shutDownPageContainer(0)` or a custom exit screen on the root page.
- Treating the network whitelist as a CORS bypass.
- Writing `permissions` as an object map; declaring permissions the code never uses.
- Bundling API keys into the app.
- Calling `createStartUpPageContainer` again after a HMR reload instead of rebuilding.
- Relying on browser `localStorage` for settings; use `bridge.setLocalStorage`.
- Bridge calls without a timeout, or several at once.
- Shipping the template `app.json` (name contains "Even", old `min_sdk_version`).
- `new Function` or `eval` anywhere in the bundle, including dependencies.
- Packing without `--sdk-ver` and getting a different `min_app_version` floor than expected.
- Trusting the simulator for timing, fonts or lock-screen behaviour.
- Keeping state only in memory; Android may suspend the WebView.

## Before you submit

0. Confirm the app category is publishable under the Even Hub developer terms (finance, health, education, messaging and child-directed apps are currently excluded).
1. `npm run build`, then `evenhub pack app.json dist -o app.ehpk -c --sdk-ver <installed>`.
2. Upload, promote to Beta, accept the tester invite (status Active), install from Me -> Beta tester.
3. Lock the phone for 5 minutes; app state survives.
4. Root double press shows the system exit dialog; WebView closes. After cancelling it, check whether images and the microphone still work (known issue, see `knowhow.md`).
5. Deny each permission once; app explains and keeps working.
6. Launch a first-party app after exiting; it starts without restarting the glasses.
7. Console is clean at boot; no secrets in logs.
8. Privacy policy, icon, screenshots, release notes ready in the portal.
