ti-guides

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Titanium SDK guide expert

Titanium SDK 指南专家

Use this skill to keep Titanium projects aligned with TiDev standards for stability, performance, and cross-platform behavior.
使用此技能可确保Titanium项目符合TiDev的稳定性、性能及跨平台行为标准。

Project detection

项目检测

:::info Auto-detects Titanium projects This skill auto-detects Titanium projects. No manual command is needed.
Titanium project indicator:
  • tiapp.xml
    file (definitive indicator)
Applies to both:
  • Alloy projects (
    app/
    folder)
  • Classic projects (
    Resources/
    folder)
Behavior:
  • If a Titanium project is detected, provide official Titanium SDK guidance, memory management best practices, and app distribution help.
  • If not detected, say this skill is only for Titanium projects. :::
:::info 自动检测Titanium项目 此技能可自动检测Titanium项目,无需手动命令。
Titanium项目标识:
  • tiapp.xml
    文件(明确标识)
同时适用于:
  • Alloy项目(
    app/
    文件夹)
  • Classic项目(
    Resources/
    文件夹)
行为说明:
  • 若检测到Titanium项目,将提供官方Titanium SDK指导、内存管理最佳实践及应用分发相关帮助。
  • 若未检测到,说明此技能仅适用于Titanium项目。 :::

Core workflow

核心工作流程

  1. Validate the project follows a modular pattern (CommonJS or Alloy).
  2. Ensure global listeners are removed and heavy objects are nulled during cleanup.
  3. Cache frequently accessed native properties to reduce bridge crossings.
  4. Use Hyperloop for specialized native functionality and handle casting and threading correctly.
  5. Use transactions for database work and manage image memory footprints.
  1. 验证项目遵循模块化模式(CommonJS或Alloy)。
  2. 确保在清理阶段移除全局监听器并将大型对象置空。
  3. 缓存频繁访问的原生属性以减少桥接调用次数。
  4. 使用Hyperloop实现特殊原生功能,并正确处理类型转换和线程问题。
  5. 数据库操作使用事务,并管理图片内存占用。

Procedural rules

流程规则

  • Always remove
    Ti.App
    and
    Ti.Geolocation
    listeners during controller cleanup.
  • Do not access
    Ti.Platform
    or
    Ti.DisplayCaps
    inside loops. Store values in local variables.
  • Concatenate Hyperloop selectors accurately (for example,
    addAttribute:value:range:
    ->
    addAttributeValueRange
    ).
  • Close resultsets and database handles after every transaction block.
  • 控制器清理阶段务必移除
    Ti.App
    Ti.Geolocation
    监听器。
  • 请勿在循环内访问
    Ti.Platform
    Ti.DisplayCaps
    ,应将值存储在局部变量中。
  • 准确拼接Hyperloop选择器(例如,
    addAttribute:value:range:
    ->
    addAttributeValueRange
    )。
  • 每个事务块结束后关闭结果集和数据库句柄。

Reference guides

参考指南

  • Hello World (references/hello-world.md): project creation, structure, and getting started with Alloy or Classic Titanium.
  • JavaScript Primer (references/javascript-primer.md): JavaScript fundamentals, learning resources, best practices, and ES6+ features.
  • Application Frameworks (references/application-frameworks.md): Alloy vs Classic Titanium, architectural patterns, and framework selection.
  • Coding Best Practices (references/coding-best-practices.md): memory leaks, bridge efficiency, event naming, security, and lazy loading.
  • CommonJS Advanced (references/commonjs-advanced.md): stateful modules, caching, ES6+ support, and antipatterns.
  • Advanced Data & Images (references/advanced-data-and-images.md): SQLite transactions and image memory optimization.
  • Hyperloop Native Access (references/hyperloop-native-access.md): Objective-C/Swift/Java syntax, casting, debugging, XIB/Storyboards.
  • Style & Conventions (references/style-and-conventions.md): naming standards and formatting rules.
  • Reserved Words (references/reserved-words.md): ECMAScript, iOS, and Alloy reserved keywords to avoid.
  • Alloy CLI Reference (references/alloy-cli-advanced.md): extract-i18n, code generation, and build hooks.
  • Alloy Data Mastery (references/alloy-data-mastery.md): sync adapters, data binding, and Backbone collections.
  • Alloy Widgets & Themes (references/alloy-widgets-and-themes.md): widget structure, styling priorities, and theming.
  • Android Manifest (references/android-manifest.md): custom AndroidManifest.xml, permissions, and manifest merge.
  • App Distribution (references/app-distribution.md): Google Play (APK/AAB), App Store (IPA), certificates, provisioning, and deployment.
  • tiapp.xml Configuration (references/tiapp-config.md): complete reference for tiapp.xml and timodule.xml, including all elements, properties, and platform-specific settings.
  • CLI Reference (references/cli-reference.md): Titanium CLI commands, options, tasks, configuration, and build processes.
  • Resources (references/resources.md): community support, modules, sample code, Slack, and learning materials.
  • Hello World(references/hello-world.md):项目创建、结构及Alloy或Classic Titanium入门。
  • JavaScript Primer(references/javascript-primer.md):JavaScript基础、学习资源、最佳实践及ES6+特性。
  • Application Frameworks(references/application-frameworks.md):Alloy与Classic Titanium对比、架构模式及框架选择。
  • Coding Best Practices(references/coding-best-practices.md):内存泄漏、桥接效率、事件命名、安全及懒加载。
  • CommonJS Advanced(references/commonjs-advanced.md):有状态模块、缓存、ES6+支持及反模式。
  • Advanced Data & Images(references/advanced-data-and-images.md):SQLite事务及图片内存优化。
  • Hyperloop Native Access(references/hyperloop-native-access.md):Objective-C/Swift/Java语法、类型转换、调试、XIB/Storyboards。
  • Style & Conventions(references/style-and-conventions.md):命名规范及格式规则。
  • Reserved Words(references/reserved-words.md):需避免使用的ECMAScript、iOS及Alloy保留关键字。
  • Alloy CLI Reference(references/alloy-cli-advanced.md):extract-i18n、代码生成及构建钩子。
  • Alloy Data Mastery(references/alloy-data-mastery.md):同步适配器、数据绑定及Backbone集合。
  • Alloy Widgets & Themes(references/alloy-widgets-and-themes.md):组件结构、样式优先级及主题设置。
  • Android Manifest(references/android-manifest.md):自定义AndroidManifest.xml、权限及清单合并。
  • App Distribution(references/app-distribution.md):Google Play(APK/AAB)、App Store(IPA)、证书、配置文件及部署。
  • tiapp.xml Configuration(references/tiapp-config.md):tiapp.xml及timodule.xml完整参考,包括所有元素、属性及平台特定设置。
  • CLI Reference(references/cli-reference.md):Titanium CLI命令、选项、任务、配置及构建流程。
  • Resources(references/resources.md):社区支持、模块、示例代码、Slack及学习资料。

Related skills

相关技能

For tasks beyond SDK fundamentals, use these complementary skills:
TaskUse this skill
Project architecture, services, patterns
ti-expert
Native features (location, push, media)
ti-howtos
Alloy CLI, configuration, debugging
alloy-howtos
UI layouts, ListViews, gestures
ti-ui
若需处理SDK基础之外的任务,可使用以下补充技能:
任务使用技能
项目架构、服务、模式
ti-expert
原生功能(定位、推送、媒体)
ti-howtos
Alloy CLI、配置、调试
alloy-howtos
UI布局、ListView、手势
ti-ui

Response format

响应格式

  1. Technical recommendation: cite the specific TiDev best practice.
  2. Optimized implementation: provide modern ES6+ code without semicolons.
  3. Rationale: briefly explain the performance or memory impact.
  1. 技术建议:引用TiDev的具体最佳实践。
  2. 优化实现:提供现代ES6+代码(无分号)。
  3. 原理说明:简要解释对性能或内存的影响。