@maccesar/titools 2.2.4 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +23 -23
  2. package/agents/ti-pro.md +17 -17
  3. package/lib/commands/update.js +6 -14
  4. package/lib/downloader.js +17 -2
  5. package/package.json +1 -1
  6. package/skills/alloy-guides/SKILL.md +31 -31
  7. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  8. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/MODELS.md +6 -6
  10. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  11. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  12. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  13. package/skills/alloy-howtos/SKILL.md +27 -27
  14. package/skills/alloy-howtos/references/best_practices.md +9 -9
  15. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  16. package/skills/alloy-howtos/references/config_files.md +16 -16
  17. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  18. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  19. package/skills/alloy-howtos/references/samples.md +19 -19
  20. package/skills/purgetss/SKILL.md +11 -1
  21. package/skills/purgetss/references/animation-system.md +1 -1
  22. package/skills/purgetss/references/cli-commands.md +3 -3
  23. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  24. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  25. package/skills/purgetss/references/icon-fonts.md +4 -0
  26. package/skills/purgetss/references/installation-setup.md +8 -1
  27. package/skills/purgetss/references/migration-guide.md +4 -0
  28. package/skills/purgetss/references/tikit-components.md +193 -204
  29. package/skills/purgetss/references/ui-ux-design.md +1 -1
  30. package/skills/ti-expert/SKILL.md +78 -118
  31. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  32. package/skills/ti-expert/references/alloy-structure.md +21 -21
  33. package/skills/ti-expert/references/anti-patterns.md +15 -15
  34. package/skills/ti-expert/references/cli-expert.md +15 -15
  35. package/skills/ti-expert/references/code-conventions.md +38 -38
  36. package/skills/ti-expert/references/contracts.md +8 -8
  37. package/skills/ti-expert/references/controller-patterns.md +14 -14
  38. package/skills/ti-expert/references/error-handling.md +11 -11
  39. package/skills/ti-expert/references/examples.md +12 -12
  40. package/skills/ti-expert/references/migration-patterns.md +24 -24
  41. package/skills/ti-expert/references/patterns.md +10 -10
  42. package/skills/ti-expert/references/performance-listview.md +16 -16
  43. package/skills/ti-expert/references/performance-optimization.md +41 -41
  44. package/skills/ti-expert/references/security-device.md +22 -22
  45. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  46. package/skills/ti-expert/references/state-management.md +33 -33
  47. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  48. package/skills/ti-expert/references/testing-unit.md +24 -24
  49. package/skills/ti-expert/references/theming.md +15 -15
  50. package/skills/ti-guides/SKILL.md +58 -60
  51. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  52. package/skills/ti-guides/references/android-manifest.md +15 -15
  53. package/skills/ti-guides/references/app-distribution.md +70 -166
  54. package/skills/ti-guides/references/application-frameworks.md +96 -114
  55. package/skills/ti-guides/references/cli-reference.md +294 -294
  56. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  57. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  58. package/skills/ti-guides/references/hello-world.md +36 -36
  59. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  60. package/skills/ti-guides/references/javascript-primer.md +83 -101
  61. package/skills/ti-guides/references/reserved-words.md +9 -9
  62. package/skills/ti-guides/references/resources.md +75 -83
  63. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  64. package/skills/ti-guides/references/tiapp-config.md +110 -74
  65. package/skills/ti-howtos/SKILL.md +88 -92
  66. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  67. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  68. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  69. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  70. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  71. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  72. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  73. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  74. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  75. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  76. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  77. package/skills/ti-howtos/references/media-apis.md +87 -86
  78. package/skills/ti-howtos/references/notification-services.md +250 -260
  79. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  80. package/skills/ti-howtos/references/tutorials.md +226 -216
  81. package/skills/ti-howtos/references/using-modules.md +73 -102
  82. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  83. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  84. package/skills/ti-ui/SKILL.md +85 -85
  85. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  86. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  87. package/skills/ti-ui/references/application-structures.md +96 -99
  88. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  89. package/skills/ti-ui/references/event-handling.md +58 -58
  90. package/skills/ti-ui/references/gestures.md +62 -64
  91. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  92. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  93. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  94. package/skills/ti-ui/references/orientation.md +87 -88
  95. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  96. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  97. package/skills/ti-ui/references/scrolling-views.md +29 -29
  98. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -1,11 +1,11 @@
1
- # Unit Testing Guide for Titanium + Alloy
1
+ # Unit testing guide for Titanium + Alloy
2
2
 
3
3
  > **OPTIONAL - Advanced Topic**
4
4
  > This guide covers automated testing, which is OPTIONAL for Titanium/Alloy projects.
5
5
  > Testing is useful for teams practicing CI/CD, projects with complex business logic, or refactoring confidence.
6
6
  > If you prefer manual testing on device, you can safely skip this guide.
7
7
 
8
- ## What CAN Be Tested (Without Compiling)
8
+ ## What can be tested (Without Compiling)
9
9
 
10
10
  **Pure JavaScript Logic:**
11
11
  - Services (authService, navigationService, etc.)
@@ -13,7 +13,7 @@
13
13
  - Business logic (calculations, data transformations)
14
14
  - Models (with mocked database)
15
15
 
16
- ## What CANNOT Be Easily Tested
16
+ ## What cannot be easily tested
17
17
 
18
18
  **Requires Compiled App:**
19
19
  - Controllers (UI interactions)
@@ -23,11 +23,11 @@
23
23
 
24
24
  ---
25
25
 
26
- ## Testing Philosophy
26
+ ## Testing philosophy
27
27
 
28
28
  **Test behavior, not implementation.** Focus on what the code does from the outside, not how it achieves it internally.
29
29
 
30
- ## Project Structure
30
+ ## Project structure
31
31
 
32
32
  ```
33
33
  app/
@@ -52,9 +52,9 @@ app/
52
52
  │ │ └── setup.js # Test environment setup
53
53
  ```
54
54
 
55
- ## Writing Testable Code
55
+ ## Writing testable code
56
56
 
57
- ### Dependency Injection for Testability
57
+ ### Dependency injection for testability
58
58
 
59
59
  ```javascript
60
60
  // BAD: Hard to test - direct dependency
@@ -86,7 +86,7 @@ describe('getUser', () => {
86
86
  })
87
87
  ```
88
88
 
89
- ## Unit Testing Services
89
+ ## Unit testing services
90
90
 
91
91
  ```javascript
92
92
  // specs/unit/services/authService.spec.js
@@ -147,7 +147,7 @@ describe('AuthService', () => {
147
147
  })
148
148
  ```
149
149
 
150
- ## Unit Testing Helpers
150
+ ## Unit testing helpers
151
151
 
152
152
  ```javascript
153
153
  // specs/unit/helpers/i18n.spec.js
@@ -184,7 +184,7 @@ describe('i18n Helper', () => {
184
184
  })
185
185
  ```
186
186
 
187
- ## Integration Testing Controllers
187
+ ## Integration testing controllers
188
188
 
189
189
  ```javascript
190
190
  // specs/integration/controllers/login.spec.js
@@ -270,7 +270,7 @@ describe('Login Controller', () => {
270
270
  })
271
271
  ```
272
272
 
273
- ## Mock Factory
273
+ ## Mock factory
274
274
 
275
275
  ```javascript
276
276
  // lib/testing/mocks.js
@@ -326,7 +326,7 @@ exports.Mocks = {
326
326
  }
327
327
  ```
328
328
 
329
- ## Test Helper Functions
329
+ ## Test helper functions
330
330
 
331
331
  ```javascript
332
332
  // lib/testing/helpers.js
@@ -373,7 +373,7 @@ exports.TestHelpers = {
373
373
  }
374
374
  ```
375
375
 
376
- ## Test Setup Configuration
376
+ ## Test setup configuration
377
377
 
378
378
  ```javascript
379
379
  // lib/testing/setup.js
@@ -396,7 +396,7 @@ afterAll(() => {
396
396
  })
397
397
  ```
398
398
 
399
- ## Running Tests
399
+ ## Running tests
400
400
 
401
401
  ```bash
402
402
  # Run specific test suite
@@ -409,18 +409,18 @@ titanium test --coverage
409
409
  titanium test --specs app/specs/unit/services/authService.spec.js
410
410
  ```
411
411
 
412
- ## Anti-Patterns to Avoid
412
+ ## Anti-patterns to avoid
413
413
 
414
- | Anti-Pattern | Problem | Solution |
414
+ | Anti-Pattern | Problem | Solution |
415
415
  | -------------------------- | ------------------------------ | ------------------------------- |
416
- | Testing private methods | Breaks on refactoring | Test public interface only |
417
- | Mocking everything | Tests pass, code fails | Mock only external dependencies |
418
- | No cleanup in tests | Memory leaks, interference | Always cleanup in afterEach |
419
- | Testing XML/TSS | Fragile, implementation detail | Test rendered behavior instead |
420
- | Hard dependencies | Untestable code | Use dependency injection |
421
- | Shared state between tests | Flaky tests | Reset state in beforeEach |
422
-
423
- ## Test Checklist
416
+ | Testing private methods | Breaks on refactoring | Test public interface only |
417
+ | Mocking everything | Tests pass, code fails | Mock only external dependencies |
418
+ | No cleanup in tests | Memory leaks, interference | Always cleanup in afterEach |
419
+ | Testing XML/TSS | Fragile, implementation detail | Test rendered behavior instead |
420
+ | Hard dependencies | Untestable code | Use dependency injection |
421
+ | Shared state between tests | Flaky tests | Reset state in beforeEach |
422
+
423
+ ## Test checklist
424
424
 
425
425
  Before committing code, verify:
426
426
 
@@ -1,10 +1,10 @@
1
- # Theming & Dark Mode
1
+ # Theming & dark mode
2
2
 
3
- ## Alloy Theme System
3
+ ## Alloy theme system
4
4
 
5
5
  Alloy has a built-in theme system via the `app/themes/` folder. Themes override views, styles, and assets without modifying originals.
6
6
 
7
- ### Theme Folder Structure
7
+ ### Theme folder structure
8
8
 
9
9
  ```
10
10
  app/
@@ -26,7 +26,7 @@ app/
26
26
  ├── config.json
27
27
  ```
28
28
 
29
- ### Activating a Theme
29
+ ### Activating a theme
30
30
 
31
31
  Set the theme in `config.json`:
32
32
 
@@ -45,7 +45,7 @@ Set the theme in `config.json`:
45
45
  Alloy themes are applied at **build time**. You cannot switch themes at runtime using this system alone. For runtime switching, use the Dynamic Theming approach below.
46
46
  :::
47
47
 
48
- ### Theme Cascade
48
+ ### Theme cascade
49
49
 
50
50
  When a theme is active, Alloy merges files in this order:
51
51
  1. `app/styles/app.tss` (base)
@@ -53,15 +53,15 @@ When a theme is active, Alloy merges files in this order:
53
53
  3. `app/styles/<controller>.tss` (controller-specific)
54
54
  4. `app/themes/<theme>/styles/<controller>.tss` (theme + controller override)
55
55
 
56
- Theme files **merge** with base files you only need to include properties you want to override.
56
+ Theme files **merge** with base files , you only need to include properties you want to override.
57
57
 
58
58
  ---
59
59
 
60
- ## Dynamic Theming with Alloy.Globals
60
+ ## Dynamic theming with Alloy.Globals
61
61
 
62
62
  For runtime theme switching (including Dark Mode), use `Alloy.Globals` as a centralized color palette.
63
63
 
64
- ### Step 1: Define Color Palette
64
+ ### Step 1: define color palette
65
65
 
66
66
  ```javascript
67
67
  // alloy.js
@@ -98,7 +98,7 @@ Alloy.Globals.theme = themes[savedTheme]
98
98
  Alloy.Globals.themeName = savedTheme
99
99
  ```
100
100
 
101
- ### Step 2: Use in TSS with Alloy.Globals
101
+ ### Step 2: use in TSS with Alloy.Globals
102
102
 
103
103
  ```tss
104
104
  /* app.tss - Global base styles using theme colors */
@@ -134,7 +134,7 @@ Alloy.Globals.themeName = savedTheme
134
134
  }
135
135
  ```
136
136
 
137
- ### Step 3: Theme Switching Service
137
+ ### Step 3: theme switching service
138
138
 
139
139
  ```javascript
140
140
  // lib/services/themeService.js
@@ -176,7 +176,7 @@ exports.ThemeService = {
176
176
  }
177
177
  ```
178
178
 
179
- ### Step 4: Respond to Theme Changes in Controllers
179
+ ### Step 4: respond to theme changes in controllers
180
180
 
181
181
  :::warning Theme change requires UI rebuild
182
182
  Since TSS is applied at controller creation time, changing `Alloy.Globals.theme` does NOT retroactively update already-rendered views. You must manually update visible elements or restart the root controller.
@@ -233,7 +233,7 @@ $.cleanup = cleanup
233
233
 
234
234
  ---
235
235
 
236
- ## System Dark Mode Detection
236
+ ## System dark mode detection
237
237
 
238
238
  ### iOS 13+ / Android 10+
239
239
 
@@ -263,7 +263,7 @@ exports.ThemeService = {
263
263
  }
264
264
  ```
265
265
 
266
- ### Semantic Colors (Cross-Platform)
266
+ ### Semantic colors (Cross-Platform)
267
267
 
268
268
  Titanium provides a cross-platform semantic colors API for Dark Mode support. Define colors in a `semantic.colors.json` file:
269
269
 
@@ -329,7 +329,7 @@ $.container.backgroundColor = 'backgroundColor';
329
329
 
330
330
  ---
331
331
 
332
- ## Reusable Style Classes Pattern
332
+ ## Reusable style classes pattern
333
333
 
334
334
  Define a library of reusable TSS classes in `app.tss` for consistency across the app:
335
335
 
@@ -410,7 +410,7 @@ Define a library of reusable TSS classes in `app.tss` for consistency across the
410
410
  ".mx-lg": { left: 24, right: 24 }
411
411
  ```
412
412
 
413
- ### Using Style Classes in Views
413
+ ### Using style classes in views
414
414
 
415
415
  ```xml
416
416
  <Alloy>
@@ -5,77 +5,75 @@ argument-hint: "[topic]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
6
6
  ---
7
7
 
8
- # Titanium SDK Guide Expert
8
+ # Titanium SDK guide expert
9
9
 
10
- This skill ensures Titanium projects follow TiDev standards for stability, performance, and cross-platform reliability.
10
+ Use this skill to keep Titanium projects aligned with TiDev standards for stability, performance, and cross-platform behavior.
11
11
 
12
- ## Project Detection
12
+ ## Project detection
13
13
 
14
- :::info AUTO-DETECTS TITANIUM PROJECTS
15
- This skill automatically detects Titanium projects when invoked and provides SDK-specific guidance.
14
+ :::info Auto-detects Titanium projects
15
+ This skill auto-detects Titanium projects. No manual command is needed.
16
16
 
17
- **Detection occurs automatically** - no manual command needed.
18
-
19
- **Titanium project indicator:**
17
+ Titanium project indicator:
20
18
  - `tiapp.xml` file (definitive indicator)
21
19
 
22
- **Applicable to BOTH:**
23
- - **Alloy projects** (app/ folder)
24
- - **Classic projects** (Resources/ folder)
20
+ Applies to both:
21
+ - Alloy projects (`app/` folder)
22
+ - Classic projects (`Resources/` folder)
25
23
 
26
- **Behavior based on detection:**
27
- - **Titanium detected** Provides official Titanium SDK guidance, memory management best practices, app distribution help
28
- - **Not detected** Indicates this is for Titanium projects only
24
+ Behavior:
25
+ - If a Titanium project is detected, provide official Titanium SDK guidance, memory management best practices, and app distribution help.
26
+ - If not detected, say this skill is only for Titanium projects.
29
27
  :::
30
28
 
31
- ## Core Workflow
32
-
33
- 1. **Architecture Check**: Validate that the project follows a modular pattern (CommonJS or Alloy).
34
- 2. **Memory Review**: Ensure all global listeners are removed and heavy objects are nulled during cleanup.
35
- 3. **Bridge Optimization**: Identify and cache frequently accessed native properties to minimize bridge crossings.
36
- 4. **Native Integration**: Use Hyperloop for specialized native functionality, ensuring proper casting and thread management.
37
- 5. **Asset Management**: Optimize database operations with transactions and manage image memory footprints.
38
-
39
- ## Procedural Rules (Low Freedom)
40
-
41
- - **Memory Hygiene**: Always remove `Ti.App` and `Ti.Geolocation` listeners in the controller cleanup phase.
42
- - **No Bridge Calls in Loops**: Never access `Ti.Platform` or `Ti.DisplayCaps` inside loops; store values in local variables.
43
- - **Hyperloop Naming**: Concatenate selectors accurately (e.g., `addAttribute:value:range:` -> `addAttributeValueRange`).
44
- - **DB Persistence**: Always close resultsets and database handles after every transaction block.
45
-
46
- ## Reference Guides (Progressive Disclosure)
47
-
48
- - **[Hello World](references/hello-world.md)**: Project creation, structure, and getting started with Alloy or Classic Titanium.
49
- - **[JavaScript Primer](references/javascript-primer.md)**: JavaScript fundamentals, learning resources, best practices, and ES6+ features.
50
- - **[Application Frameworks](references/application-frameworks.md)**: Alloy vs Classic Titanium, architectural patterns, and framework selection.
51
- - **[Coding Best Practices](references/coding-best-practices.md)**: Memory leaks, bridge efficiency, event naming, security, and lazy loading.
52
- - **[CommonJS Advanced](references/commonjs-advanced.md)**: Stateful modules, caching, ES6+ support, and antipatterns.
53
- - **[Advanced Data & Images](references/advanced-data-and-images.md)**: SQLite transactions and image memory optimization.
54
- - **[Hyperloop Native Access](references/hyperloop-native-access.md)**: Objective-C/Swift/Java syntax, casting, debugging, XIB/Storyboards.
55
- - **[Style & Conventions](references/style-and-conventions.md)**: Naming standards and formatting rules.
56
- - **[Reserved Words](references/reserved-words.md)**: ECMAScript, iOS, and Alloy reserved keywords to avoid.
57
- - **[Alloy CLI Reference](references/alloy-cli-advanced.md)**: extract-i18n, code generation, and build hooks.
58
- - **[Alloy Data Mastery](references/alloy-data-mastery.md)**: Sync adapters, data binding, and Backbone collections.
59
- - **[Alloy Widgets & Themes](references/alloy-widgets-and-themes.md)**: Widget structure, styling priorities, and theming.
60
- - **[Android Manifest](references/android-manifest.md)**: Custom AndroidManifest.xml, permissions, and manifest merge.
61
- - **[App Distribution](references/app-distribution.md)**: Google Play (APK/AAB), App Store (IPA), certificates, provisioning, and deployment.
62
- - **[tiapp.xml Configuration](references/tiapp-config.md)**: Complete reference for tiapp.xml and timodule.xml, including all elements, properties, and platform-specific settings.
63
- - **[CLI Reference](references/cli-reference.md)**: Titanium CLI commands, options, tasks, configuration, and build processes.
64
- - **[Resources](references/resources.md)**: Community support, modules, sample code, Slack, and learning materials.
65
-
66
- ## Related Skills
29
+ ## Core workflow
30
+
31
+ 1. Validate the project follows a modular pattern (CommonJS or Alloy).
32
+ 2. Ensure global listeners are removed and heavy objects are nulled during cleanup.
33
+ 3. Cache frequently accessed native properties to reduce bridge crossings.
34
+ 4. Use Hyperloop for specialized native functionality and handle casting and threading correctly.
35
+ 5. Use transactions for database work and manage image memory footprints.
36
+
37
+ ## Procedural rules
38
+
39
+ - Always remove `Ti.App` and `Ti.Geolocation` listeners during controller cleanup.
40
+ - Do not access `Ti.Platform` or `Ti.DisplayCaps` inside loops. Store values in local variables.
41
+ - Concatenate Hyperloop selectors accurately (for example, `addAttribute:value:range:` -> `addAttributeValueRange`).
42
+ - Close resultsets and database handles after every transaction block.
43
+
44
+ ## Reference guides
45
+
46
+ - Hello World (references/hello-world.md): project creation, structure, and getting started with Alloy or Classic Titanium.
47
+ - JavaScript Primer (references/javascript-primer.md): JavaScript fundamentals, learning resources, best practices, and ES6+ features.
48
+ - Application Frameworks (references/application-frameworks.md): Alloy vs Classic Titanium, architectural patterns, and framework selection.
49
+ - Coding Best Practices (references/coding-best-practices.md): memory leaks, bridge efficiency, event naming, security, and lazy loading.
50
+ - CommonJS Advanced (references/commonjs-advanced.md): stateful modules, caching, ES6+ support, and antipatterns.
51
+ - Advanced Data & Images (references/advanced-data-and-images.md): SQLite transactions and image memory optimization.
52
+ - Hyperloop Native Access (references/hyperloop-native-access.md): Objective-C/Swift/Java syntax, casting, debugging, XIB/Storyboards.
53
+ - Style & Conventions (references/style-and-conventions.md): naming standards and formatting rules.
54
+ - Reserved Words (references/reserved-words.md): ECMAScript, iOS, and Alloy reserved keywords to avoid.
55
+ - Alloy CLI Reference (references/alloy-cli-advanced.md): extract-i18n, code generation, and build hooks.
56
+ - Alloy Data Mastery (references/alloy-data-mastery.md): sync adapters, data binding, and Backbone collections.
57
+ - Alloy Widgets & Themes (references/alloy-widgets-and-themes.md): widget structure, styling priorities, and theming.
58
+ - Android Manifest (references/android-manifest.md): custom AndroidManifest.xml, permissions, and manifest merge.
59
+ - App Distribution (references/app-distribution.md): Google Play (APK/AAB), App Store (IPA), certificates, provisioning, and deployment.
60
+ - tiapp.xml Configuration (references/tiapp-config.md): complete reference for tiapp.xml and timodule.xml, including all elements, properties, and platform-specific settings.
61
+ - CLI Reference (references/cli-reference.md): Titanium CLI commands, options, tasks, configuration, and build processes.
62
+ - Resources (references/resources.md): community support, modules, sample code, Slack, and learning materials.
63
+
64
+ ## Related skills
67
65
 
68
66
  For tasks beyond SDK fundamentals, use these complementary skills:
69
67
 
70
- | Task | Use This Skill |
71
- | ---------------------------------------- | -------------- |
72
- | Project architecture, services, patterns | `ti-expert` |
73
- | Native features (location, push, media) | `ti-howtos` |
74
- | Alloy CLI, configuration, debugging | `alloy-howtos` |
75
- | UI layouts, ListViews, gestures | `ti-ui` |
68
+ | Task | Use this skill |
69
+ | --- | --- |
70
+ | Project architecture, services, patterns | `ti-expert` |
71
+ | Native features (location, push, media) | `ti-howtos` |
72
+ | Alloy CLI, configuration, debugging | `alloy-howtos` |
73
+ | UI layouts, ListViews, gestures | `ti-ui` |
76
74
 
77
- ## Response Format
75
+ ## Response format
78
76
 
79
- 1. **Technical Recommendation**: Cite the specific TiDev best practice.
80
- 2. **Optimized Implementation**: Provide modern ES6+ code without semicolons.
81
- 3. **Rationale**: Briefly explain the performance or memory impact.
77
+ 1. Technical recommendation: cite the specific TiDev best practice.
78
+ 2. Optimized implementation: provide modern ES6+ code without semicolons.
79
+ 3. Rationale: briefly explain the performance or memory impact.
@@ -1,9 +1,9 @@
1
- # Advanced Database and Image Best Practices
1
+ # Advanced database and image best practices
2
2
 
3
- ## 1. SQLite Optimization
3
+ ## 1. SQLite optimization
4
4
 
5
- - **Close Everything**: Always `resultSet.close()` and `db.close()` after each operation to avoid locks and memory bloat. SQLite enforces sequential write-access if you don't close after `INSERT` or `UPDATE`, you may receive **DatabaseObjectNotClosed** exceptions on the next write attempt.
6
- - **Transactions**: Use `BEGIN` and `COMMIT` for batch inserts. It is significantly faster. Note: if any update within the transaction fails, the **entire batch is rolled back** (atomicity).
5
+ - Close result sets and the database after each operation to avoid locks and memory growth. SQLite allows one writer at a time, and leaving a connection open after `INSERT` or `UPDATE` can trigger `DatabaseObjectNotClosed` on the next write.
6
+ - Use transactions for batch inserts. If any statement fails, SQLite rolls back the entire batch.
7
7
  ```javascript
8
8
  const db = Ti.Database.open('myDatabase');
9
9
  db.execute('BEGIN');
@@ -13,12 +13,12 @@
13
13
  db.execute('COMMIT');
14
14
  db.close();
15
15
  ```
16
- - **Database Skeleton**: Do not ship large pre-populated databases. Ship a "skeleton" and download data on first boot to reduce IPA/APK size. The `Resources` directory is read-only, so installing a database copies it to `applicationDataDirectory`, resulting in two copies on the device.
17
- - **Android note**: In Android 2.2 and earlier, the installer could not uncompress assets over 1 MB. Workaround: rename the file with a `.mp3` extension to prevent `aapt` compression.
16
+ - Do not ship large pre-populated databases. Ship a small skeleton and download data on first boot to reduce IPA/APK size. The `Resources` directory is read-only, so installing a database copies it to `applicationDataDirectory`, which creates two copies on the device.
17
+ - Android note: in Android 2.2 and earlier, the installer could not uncompress assets over 1 MB. One workaround was to rename the file with a `.mp3` extension to prevent `aapt` compression.
18
18
 
19
- ### Database Version Management
19
+ ### Database version management
20
20
 
21
- Store a version number in your database to detect which version is installed and take action (create tables, alter columns) on upgrades. If you lack a version table, use `PRAGMA TABLE_INFO` to detect column presence:
21
+ Store a version number in your database so you can detect upgrades and run migrations. If you do not have a version table, use `PRAGMA TABLE_INFO` to detect column presence:
22
22
 
23
23
  ```javascript
24
24
  const addColumn = (dbname, tblName, newFieldName, colSpec) => {
@@ -41,30 +41,30 @@ const addColumn = (dbname, tblName, newFieldName, colSpec) => {
41
41
 
42
42
  ---
43
43
 
44
- ## 2. Image Format Selection
44
+ ## 2. Image format selection
45
45
 
46
46
  Choose the right format for each use case:
47
47
 
48
- | Format | Compression | Best For | Avoid For |
49
- | ------ | ----------- | -------- | --------- |
50
- | **PNG** | Lossless | Icons, text, line-art, buttons | Photos (file size) |
51
- | **JPG** | Lossy | Photographs | Text, icons, line drawings (artifacts) |
52
- | **GIF** | Lossless (256 colors) | Rarely appropriate | Almost everything limited colors, proprietary, animated GIF not supported on all platforms |
48
+ | Format | Compression | Best for | Avoid for |
49
+ | --- | --- | --- | --- |
50
+ | PNG | Lossless | Icons, text, line art, buttons | Photos (large files) |
51
+ | JPG | Lossy | Photographs | Text, icons, line drawings (artifacts) |
52
+ | GIF | Lossless (256 colors) | Rare cases | Most cases (limited colors, animated GIF not supported everywhere) |
53
53
 
54
- **For flip-book animations**: Use `ImageView.images` property with an array of PNG or optimized JPG files instead of animated GIFs.
54
+ For flip-book animations, use `ImageView.images` with an array of PNG or optimized JPG files instead of animated GIFs.
55
55
 
56
56
  ---
57
57
 
58
- ## 3. Image Memory Management
58
+ ## 3. Image memory management
59
59
 
60
- - **Memory Footprint**: A JPG is small on disk but consumes `width * height * 3 bytes` in RAM when decompressed. Each pixel uses 24 bits (8 bits per R/G/B channel).
60
+ - A JPG is small on disk but expands to `width * height * 3 bytes` in RAM. Each pixel uses 24 bits (8 bits per R/G/B channel).
61
61
  - Example: `(640 × 480 × 3) / 1024 = 900 KB` in memory for a single image
62
62
  - Device RAM available to your app can be as low as 12 MB, shared with your code and the Titanium framework
63
- - **Unloading**:
64
- - `view.remove(imageView)` removes from view hierarchy, helps OS free memory
65
- - `imageView = null` releases the native proxy object
66
- - **Resizing**: Always resize images to their display dimensions via `imageAsResized` or `imageAsCropped` (both on `Ti.Blob`) before setting the `image` property. Don't display a 1024×768 image on a 640×480 screen.
67
- - **Placeholder**: Set the `defaultImage` property on ImageView to show a local placeholder while a remote image downloads:
63
+ - Unloading:
64
+ - `view.remove(imageView)` removes it from the view hierarchy and lets the OS free memory
65
+ - `imageView = null` releases the native proxy object
66
+ - Resizing: resize images to their display dimensions using `imageAsResized` or `imageAsCropped` (both on `Ti.Blob`) before setting the `image` property. Do not display a 1024×768 image on a 640×480 screen.
67
+ - Placeholder: set `defaultImage` on ImageView to show a local placeholder while a remote image downloads:
68
68
  ```javascript
69
69
  const imageView = Ti.UI.createImageView({
70
70
  image: 'https://example.com/photo.jpg',
@@ -76,12 +76,12 @@ Choose the right format for each use case:
76
76
 
77
77
  ---
78
78
 
79
- ## 4. Image Optimization Tools
79
+ ## 4. Image optimization tools
80
80
 
81
- Resize and compress images before including them in your app to minimize IPA/APK size and network usage.
81
+ Resize and compress images before including them in your app to reduce IPA/APK size and network usage.
82
82
 
83
- | Platform | File Types | Tool |
84
- | -------- | ---------- | ---- |
83
+ | Platform | File types | Tool |
84
+ | --- | --- | --- |
85
85
  | Mac | PNG, JPG, GIF | ImageOptim |
86
86
  | Mac, Windows, Linux | PNG, JPG, GIF | ImageMagick |
87
87
  | Windows/DOS | PNG | PNGCrush |
@@ -89,21 +89,21 @@ Resize and compress images before including them in your app to minimize IPA/APK
89
89
 
90
90
  ---
91
91
 
92
- ## 5. Caching Remote Images
92
+ ## 5. Caching remote images
93
93
 
94
94
  Remote images are cached automatically on iOS, Android, and Windows.
95
95
 
96
- **Platform differences:**
97
- - **Android**: Cache limited to **25 MB**, persists for the lifetime of the app (while installed)
98
- - **iOS**: Cache size not predetermined (no guaranteed size), cleared by iOS when device needs storage
96
+ Platform differences:
97
+ - Android: cache limited to 25 MB, persists for the lifetime of the app (while installed)
98
+ - iOS: cache size not fixed, cleared by iOS when the device needs storage
99
99
 
100
100
  To manually clean the cache, delete files in `applicationCacheDirectory`.
101
101
 
102
- **Android 6+ requirement**: Call `Ti.Filesystem.requestStoragePermissions()` before loading remote images (runtime permissions).
102
+ Android 6+ requirement: call `Ti.Filesystem.requestStoragePermissions()` before loading remote images.
103
103
 
104
- ### Manual Caching Utility
104
+ ### Manual caching utility
105
105
 
106
- For critical assets, cache manually in `applicationDataDirectory` for predictability:
106
+ For critical assets, cache manually in `applicationDataDirectory` for more predictable behavior:
107
107
 
108
108
  ```javascript
109
109
  const CacheUtils = {
@@ -1,8 +1,8 @@
1
1
  # Custom AndroidManifest.xml
2
2
 
3
- For most Android manifest settings, use `tiapp.xml`. Only create a custom manifest when absolutely necessary.
3
+ For most Android manifest settings, use `tiapp.xml`. Only create a custom manifest when you really need it.
4
4
 
5
- ## Preferred Method: tiapp.xml
5
+ ## Preferred method: tiapp.xml
6
6
 
7
7
  Add manifest entries in `tiapp.xml` inside the `<android>` section:
8
8
 
@@ -30,13 +30,13 @@ Add manifest entries in `tiapp.xml` inside the `<android>` section:
30
30
  </android>
31
31
  ```
32
32
 
33
- ## How Merging Works
33
+ ## How merging works
34
34
 
35
- - **Most elements**: Replaced by your entry
36
- - **`<application>` element**: Attributes are merged additively
37
- - **Activities/Services**: Added to existing ones
35
+ - Most elements are replaced by your entry.
36
+ - The `<application>` element is merged additively by attribute.
37
+ - Activities and services are added to existing ones.
38
38
 
39
- ## Custom Manifest (Rare Cases)
39
+ ## Custom manifest (rare cases)
40
40
 
41
41
  If you need full control, create `platform/android/AndroidManifest.xml`:
42
42
 
@@ -49,26 +49,26 @@ MyApp/
49
49
  └── tiapp.xml
50
50
  ```
51
51
 
52
- **Warning**: You must maintain this file manually through SDK updates.
52
+ Warning: you must maintain this file manually through SDK updates.
53
53
 
54
- ## Common Use Cases
54
+ ## Common use cases
55
55
 
56
- ### Camera Permission
56
+ ### Camera permission
57
57
  ```xml
58
58
  <uses-permission android:name="android.permission.CAMERA" />
59
59
  ```
60
60
 
61
- ### Hardware Requirements
61
+ ### Hardware requirements
62
62
  ```xml
63
63
  <uses-feature android:name="android.hardware.camera" android:required="false" />
64
64
  ```
65
65
 
66
- ### Launch Mode
66
+ ### Launch mode
67
67
  ```xml
68
68
  <application android:launchMode="singleTask" />
69
69
  ```
70
70
 
71
- ### Deep Links
71
+ ### Deep links
72
72
  ```xml
73
73
  <intent-filter>
74
74
  <action android:name="android.intent.action.VIEW" />
@@ -86,9 +86,9 @@ ti build -p android
86
86
  # Check: build/android/AndroidManifest.xml.gen
87
87
  ```
88
88
 
89
- ## Enable Manifest Merge (CLI 7.0+)
89
+ ## Enable manifest merge (CLI 7.0+)
90
90
 
91
- If using custom manifest, enable merge in `tiapp.xml`:
91
+ If you use a custom manifest, enable merge in `tiapp.xml`:
92
92
 
93
93
  ```bash
94
94
  ti config android.mergeCustomAndroidManifest true