- 浏览: 3546019 次
- 性别:
- 来自: 大连
博客专栏
-
使用Titanium Mo...
浏览量:38098
-
Cordova 3.x入门...
浏览量:607098
-
常用Java开源Libra...
浏览量:682039
-
搭建 CentOS 6 服...
浏览量:89205
-
Spring Boot 入...
浏览量:401676
-
基于Spring Secu...
浏览量:69652
-
MQTT入门
浏览量:91647
文章分类
最新评论
-
afateg:
阿里云的图是怎么画出来的?用什么工具?
各云服务平台的架构图 -
cbn_1992:
博主,采用jdbctoken也就是数据库形式之后,反复点击获取 ...
Spring Security OAuth2 Provider 之 数据库存储 -
ipodao:
写的很是清楚了,我找到一份中文协议:https://mcxia ...
MQTT入门(6)- 主题Topics -
Cavani_cc:
还行
MQTT入门(6)- 主题Topics -
fexiong:
博主,能否提供完整源码用于学习?邮箱:2199611997@q ...
TensorFlow 之 构建人物识别系统
【官方Guide】https://wiki.appcelerator.org/display/guides/tiapp.xml+and+timodule.xml+Reference
The tiapp.xml and it's close cousin the timodule.xml are XML configuration files that Titanium Mobile uses to generate native resources and code. Many of the configuration that lives in tiapp.xml is cross-platform, but some is platform-specific as well. The timodule.xml file is meant for custom Titanium Mobile Modules, and generally only contains platform-specific configuration.
Top Level Elements
These configuration elements live under the root <ti:app> tag of the tiapp.xml. Unless otherwise noted, the configuration value goes inside the tag's content, i.e. <element>VALUE</element>
Application properties
tiapp.xml also supports ad-hoc properties that can be used by the application with Titanium.App.Properties. Properties generally follow the form:
Properties are also used in specific cases by each platform, which is further explained in each platform section.
iPhone / iOS specific section
Under the top <ti:app> element, you may optionally have an <iphone> element that contains iPhone and iOS specific configuration.
Android specific section
Under the top <ti:app> element, you may optionally have an <android> element that contains Android specific configuration. If the application requires any ad-hoc XML from AndroidManifest.xml, make sure to also add the android XML namespace, like so:
Android specific application properties
Android also supports a number of application properties for various internal settings. (See Application properties above on how to define an application property)
The official Android Developers website describes all the other elements that are supported, such as <service>, <uses-permission> and {{<activity> for instance, and these will be added using the same logic.
Common Requirements
Configuring screen densities
To indicate that your application supports any screen densities, which was a common use-case, add the <supports-screens> element set to true like this:
Enabling the debugger by default
To make the app debuggable by default, set the <application> attribute to `true` (it's false in our default manifest template):
Setting install location preferences.
Your Android apps are installed by default to the device's internal storage, but Titanium apps can be installed to the SD card using the following configuration:
For the <code>android:installLocation</code> property, choose one of these values:
Properties for configuring the workaround for Google Android issues 2373 and 5277
See TIMOB-4941 and TIMOB-1559 for information about the Titanium workaround to Google issues 2373 and 5277
Modules
See the Module Developer Guides for Android and iOS.
timodule.xml
A timodule.xml follows the same structure as a tiapp.xml, but most of the metadata for a module project lives in the module's manifest file. Right now, the timodule.xml is only used in Android, and it supports all of the tags listed in the Android section above. Any custom metadata your Android module defines in it's timodule.xml <android> section will automatically be merged with a Titanium Mobile application that installs your module.
Sample tiapp.xml
Here is a sample tiapp.xml, taken from a generated Titanium Mobile project:
The tiapp.xml and it's close cousin the timodule.xml are XML configuration files that Titanium Mobile uses to generate native resources and code. Many of the configuration that lives in tiapp.xml is cross-platform, but some is platform-specific as well. The timodule.xml file is meant for custom Titanium Mobile Modules, and generally only contains platform-specific configuration.
Top Level Elements
These configuration elements live under the root <ti:app> tag of the tiapp.xml. Unless otherwise noted, the configuration value goes inside the tag's content, i.e. <element>VALUE</element>
- <id>: The application ID. In Android, this ID is used to generate the package ID of the application, which must follow Java Package Naming Standards
- <name>: The application name. This is generally what is shown under the application icon on the end-user's mobile device.
- <version>: The application version.
- <publisher>: The publisher of this application.
- <url>: The url of this application.
- <description>: The description of this application.
- <copyright>: The copyright of this application.
- <icon>: The application icon's filename. This file should be relative to the application's Resources directory, or alternatively, can also live under a platform-specific folder, i.e. Resources/iphone or Resources/android.
- <persistent-wifi>: iOS only.
- <prerendered-icon>: iOS only.
- <statusbar-style>: iOS only, style for the status bar
- <statusbar-hidden>: iOS only, Whether or not the status bar is hidden when the application starts.
- <fullscreen>: Whether or not the application will start by taking up the entire screen.
- <navbar-hidden>: Whether or not the navigation bar is hidden for this application
- <analytics>: Whether or not to automatically collect analytics for this application.
- <guid>: A unique ID that associates this application for use in analytics
Application properties
tiapp.xml also supports ad-hoc properties that can be used by the application with Titanium.App.Properties. Properties generally follow the form:
<property name="name" type="type">value</property>
- name is the property name
- type is the property value's type, valid values are: string, bool, int, double
- value is the property's value
Properties are also used in specific cases by each platform, which is further explained in each platform section.
iPhone / iOS specific section
Under the top <ti:app> element, you may optionally have an <iphone> element that contains iPhone and iOS specific configuration.
- <orientations device="device">: Restricts the device to these orientations when the application is running. The value of "device" can be "iphone", or "ipad"
- <orientation>: An orientation for this <orientations> list, valid values are: Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT
- <backgroundModes>: A list of background modes this app supports <mode>: A background mode, valid values are: audio, location, and voip.
- <requires>: A list of features this app requires
- <feature>: A feature that this app requires, valid values are: telephony, wifi, sms, still-camera, auto-focus-camera, front-facing-camera, camera-flash, video-camera, accelerometer, gyroscope, location-services, gps, magnetometer, gamekit, microphone, opengles-1, opengles-2, armv6, armv7, peer-peer
Android specific section
Under the top <ti:app> element, you may optionally have an <android> element that contains Android specific configuration. If the application requires any ad-hoc XML from AndroidManifest.xml, make sure to also add the android XML namespace, like so:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <!-- .. --> </android>
- <activities>: Defines a list of custom Javascript based Android activities
- <activity url="activity.js"/>: Creates an activity with a URL that points to the Javascript file (under Resources) that defines it. Ad-hoc elements: Under the <activity> tag, any ad-hoc element from an AndroidManifest.xml is supported. See the documentation for the activity element in AndroidManifest.xml
- <services>: Defines a list of custom Javascript based Android services (long running background processes)
- <service url="service.js" type="standard"/>: Creates a service with a URL that points to the Javascript file (under Resources) that defines it. type is optional. Ad-hoc elements: Under the <service> tag, any ad-hoc element from an AndroidManifest.xml is supported. See the documentation for the service element in AndroidManifest.xml
- <manifest>: Ad-hoc XML from AndroidManifest.xml
- <tool-api-level>: The version of the Android API that Titanium builds against. In Titanium Mobile 1.7.0, we default to Android API level 7.
Android specific application properties
Android also supports a number of application properties for various internal settings. (See Application properties above on how to define an application property)
Property Name | Type | Default Value | Description |
ti.android.shake.factor | double | 1.3 | shake factor used for the "shake" event in the Titanium.Gesture module |
ti.android.shake.quiet.milliseconds | int | 500 | number of "quiet" milliseconds before the "shake" event is fired |
ti.android.shake.active.milliseconds | int | 1000 | number of "active" milliseconds before the "shake" event is fired |
ti.android.google.map.api.key.development | string | N/A | A Google Maps API Key for use in development |
ti.android.google.map.api.key.production | string | N/A | A Google Maps API Key for use in production |
ti.android.httpclient.maxbuffersize | int | 524288 | The maximum buffer size (in bytes) before an HTTP response is written to a temporary file instead of memory (default is 512KB) |
ti.android.threadstacksize | int | 16384 | The stack size (in bytes) to use when creating a Javascript thread (default: 16KB). Bump larger when encountering StackOverflow errors in very large Javascript files |
ti.android.compilejs | bool | N/A | Turns on or off JS compilation. By default, JS compilation is only on when distributing an application, but manually setting this to "true" will enable it for development as well. |
ti.android.fastdev | bool | N/A | Enables or disables Fastdev. By default, Fastdev is enabled in development mode, and disabled in device and production mode. |
ti.android.debug | bool | false | turn on detailed logging in the SDK |
ti.android.runtime | string | v8 | v8/rhino (since 1.8.0) |
The official Android Developers website describes all the other elements that are supported, such as <service>, <uses-permission> and {{<activity> for instance, and these will be added using the same logic.
Common Requirements
Configuring screen densities
To indicate that your application supports any screen densities, which was a common use-case, add the <supports-screens> element set to true like this:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <supports-screens android:smallScreens="false" android:normalScreens="true" android:largeScreens="true" android:anyDensity="false" /> </manifest> </android>
Enabling the debugger by default
To make the app debuggable by default, set the <application> attribute to `true` (it's false in our default manifest template):
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application android:debuggable="true" /> </manifest> </android>
Setting install location preferences.
Your Android apps are installed by default to the device's internal storage, but Titanium apps can be installed to the SD card using the following configuration:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <tool-api-level>8</tool-api-level> <manifest android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="7" /> </manifest> </android>
For the <code>android:installLocation</code> property, choose one of these values:
- android:installLocation="preferExternal" -- specifies that you prefer your app to install to the SD card, but if one isn't present the app can be installed to internal storage.
- android:installLocation="auto" – specifies that the phone's configuration will determine the installation location. Generally, your app will be installed to internal storage if sufficient space is available. In that case, users could still move your app by opening Settings > Applications > Manage applications, tapping your app, and tapping Move to SD card.
- android:installLocation="internalOnly" – which specifies that your app cannot be installed to the SD card. See the Android docs for the various reasons why you might choose this option. Finally, you need to add the <uses-sdk> tag within the <manifest> node. This tag specifies that your app requires Google's version 7 or newer APIs — in other words, the phone must be running Android 2.1 Update 1 or newer. That pretty much covers all the newer phones, but will exclude some older devices. On those phones, your app will install to the internal storage.
Properties for configuring the workaround for Google Android issues 2373 and 5277
See TIMOB-4941 and TIMOB-1559 for information about the Titanium workaround to Google issues 2373 and 5277
Property Name | Type | Default Value | Description |
ti.android.bug2373.disableDetection | bool | false | setting to true will completely disable the workaround |
ti.android.bug2373.title | String | Restart Required | title of dialog |
ti.android.bug2373.message | String | An application restart is required | message used in dialog. if skipAlert is true the message is shown in a Toast if message length is > 0 |
ti.android.bug2373.buttonText | String | Continue | button text on alert dialog |
ti.android.bug2373.restartDelay | int | 500 | number of milliseconds to wait before starting the new copy of the app with the correct Intent settings. |
ti.android.bug2373.finishDelay | int | 0 | number of milliseconds to wait before finishing (exiting) the current application. |
ti.android.bug2373.skipAlert | bool | false | if true, the dialog box will not be shown, but the workaround will still be applied if disableDetection is false. |
Modules
See the Module Developer Guides for Android and iOS.
timodule.xml
A timodule.xml follows the same structure as a tiapp.xml, but most of the metadata for a module project lives in the module's manifest file. Right now, the timodule.xml is only used in Android, and it supports all of the tags listed in the Android section above. Any custom metadata your Android module defines in it's timodule.xml <android> section will automatically be merged with a Titanium Mobile application that installs your module.
Sample tiapp.xml
Here is a sample tiapp.xml, taken from a generated Titanium Mobile project:
<?xml version="1.0" encoding="UTF-8"?> <ti:app xmlns:ti="http://ti.appcelerator.org"> <id>com.appcelerator.helloWorld</id> <name>helloWorld</name> <version>1.0</version> <publisher>not specified</publisher> <url>not specified</url> <description>not specified</description> <copyright>not specified</copyright> <icon>appicon.png</icon> <persistent-wifi>false</persistent-wifi> <prerendered-icon>false</prerendered-icon> <statusbar-style>default</statusbar-style> <statusbar-hidden>false</statusbar-hidden> <fullscreen>false</fullscreen> <navbar-hidden>false</navbar-hidden> <analytics>true</analytics> <guid></guid> <iphone> <orientations device="iphone"> <orientation>Ti.UI.PORTRAIT</orientation> </orientations> <orientations device="ipad"> <orientation>Ti.UI.PORTRAIT</orientation> <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation> <orientation>Ti.UI.LANDSCAPE_LEFT</orientation> <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation> </orientations> </iphone> <android xmlns:android="http://schemas.android.com/apk/res/android"> </android> <modules> </modules> </ti:app>
发表评论
-
VisualUI for Titanium Studio
2014-01-13 09:02 1542VisualUI for Titanium Studio is ... -
Google Auth (OAuth 2.0) for Titanium
2013-03-19 11:49 2049Google OAuth 2.0 for Titanium i ... -
Appcelerator Titanium: Up and Running
2013-03-19 08:40 46Appcelerator Titanium: Up and R ... -
Titanium SDK/Studio 3.0.0 Beta版发布
2012-11-07 09:36 463Titanium SDK/Studio 3.0.0 Beta版 ... -
Titanium SDK 3.0.0 Developer Preview
2012-10-29 16:15 303Titanium SDK 3.0.0 Developer Pr ... -
Appcelerator Partners With Largest Chinese Software Developer Network
2012-10-29 12:01 225(Marketwire - Oct 19, 2012) -Ap ... -
Titanium 3.0 预定10月份发布
2012-09-27 09:12 733Appcelerator CEO Jeff Haynie和 C ... -
Titanium SDK 2.1.3 RC is released – Support for iOS 6
2012-09-21 13:51 241---以下官方原文--- We understand the ... -
国内Ti开发者Winson的CBMVC框架
2012-08-06 15:55 1206目前关注Titanium的开发 ... -
Titanium的MVC框架"Alloy"的介绍
2012-07-18 14:37 4250Alloy(合金)是Appcelerator公司为Titani ... -
TCAD免费考试延长至7月末
2012-07-17 16:09 327Appcelerator延长这次TCAD免费考试的时间到7月末 ... -
TCAD认证考试
2012-07-13 11:31 2556Appcelerator从7/7开始免费开放TCAD(Tita ... -
【转】Appcelerator Cloud Push Notification in iPhone
2012-07-12 08:49 2760Push Notification in iOS Using ... -
【转】Appcelerator Cloud Push Notification in Android
2012-07-12 08:38 2483What is Push Notification? Push ... -
Appcelerator Titanium: Patterns and Best Practices
2012-07-10 10:58 373Appcelerator Titanium: Patterns ... -
Appceleator Cloud Services使用指南(3) - API Reference V1 (chm版本)
2012-05-28 15:22 1863Appceleator Cloud Services API ... -
Appceleator Cloud Services使用指南(2) - 创建第一个应用
2012-05-24 21:57 1780一步一步的创建一个最简单的,使用了ACS服务的应用。 1、新 ... -
Appceleator Cloud Services使用指南(1) - ACS介绍
2012-05-24 10:19 3259Appceleator Cloud Services( ... -
Titanium Mobile基础教程视频
2012-05-23 10:38 639dotinstall.com提供的一套在线Titanium M ... -
Jeff Haynie在GMIC2012表示应用开发者应注意本土化问题
2012-05-22 16:56 3355月10日-11日,2012全球移 ...
相关推荐
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
"full.xml.gz"是与Xposed框架相关的配置文件,通常用于在模拟器环境中配置和管理框架的模块。 在Xposed框架中,`full.xml`文件起着至关重要的作用。它是框架的核心配置文件,包含了所有可用模块的信息,包括模块的...
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun....
如`..//..//..//`进入第四级目录,`..//..//..//xml//test.xml`表示在第四级目录的`dir`文件夹内的`gs.mdb`。 5. **特定文件的相对路径**:`..//Draw//xml//test.xml`这种路径表示当前在`xml`文件夹中,要访问上两...
官网链接地址:http://repo1.maven.org/maven2/archetype-catalog.xml 百度云链接:https://pan.baidu.com/s/1dF8Qa9V 密码:37me
** Maven的`settings.xml`文件详解 ** 在Java开发领域,Maven是一个广泛使用的构建工具,它通过XML配置管理项目的依赖、构建过程以及部署策略。`settings.xml`是Maven的核心配置文件之一,它位于用户的Maven配置...
{http://xml.apache.org/axis/}stackTrace: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.reflect.InvocationTarget...
Xposed框架用到的full.xml.gz,适用于模拟器
jdk升级jdk10后,原本jdk自带的 webservice一些包确实,引起的一系列错误解决方案
在Maven的世界里,`pom.xml`和`settings.xml`是两个至关重要的配置文件,它们共同决定了Maven项目的构建过程和环境配置。`pom.xml`(Project Object Model)文件是每个Maven项目的核心,它包含了项目的基本信息、...
- `http://news.chinabyte.com/index.xml`:提供最新的科技新闻更新。 - `http://e.chinabyte.com/index.xml`:专注于电子领域的新闻动态。 - `http://telecom.chinabyte.com/index.xml`:电信行业的新闻资讯。 ...
ENTITY test SYSTEM "./classes/test.xml"> ]> ``` 2. **使用实体引用**:在`web.xml`中需要使用该配置的地方,通过实体名称来引用外部文件内容。例如,在`filter`定义中使用`&test;`来插入`test.xml`的内容。 ...
说到开发天气预报,就需要找一个开放接口了,接口有很多,不过个人觉得,中国天气网的数据比较准确,而且也有权威性。...有大神解析了中央气象台返回来的数据,并保存为XML格式,数据具体到县、区级别,供大家参考,
3. **直接替换**:根据题目描述,你可以直接将下载的名为"阿里云镜像的mavensettings.xml配置文件直接替换使用"的文件替换现有的`$USER_HOME/.m2/settings.xml`。请注意,替换前请备份原有的`settings.xml`,...
application.xml配置文件详解 application.xml配置文件详解 application.xml配置文件详解
### web.xml详解 #### 一、引言 `web.xml`是Java Web应用程序中的核心配置文件,用于定义和管理Web应用的各种配置信息。通过深入理解`web.xml`,开发人员可以更好地控制Web应用的行为和特性,提高编程效率与质量。...
http://flash.weather.com.cn/wmaps/xml/china.xml 能够获取国内各省及省会城市的天气,可以通过pyName载入各省内城市的天气 如:河北省 pyName="hebei" http://flash.weather.com.cn/wmaps/xml/hebei.xml 就可以...
赠送jar包:jakarta.xml.bind-api-2.3.2.jar; 赠送原API文档:jakarta.xml.bind-api-2.3.2-javadoc.jar; 赠送源代码:jakarta.xml.bind-api-2.3.2-sources.jar; 赠送Maven依赖信息文件:jakarta.xml.bind-api-...
而`javax.xml.rpc`是Java平台标准版(Java SE)的一部分,它提供了一组API来支持Web服务的开发。这个API集允许开发者创建、部署和调用基于J2EE(Java 2 Platform, Enterprise Edition)的Web服务。 标题中的“javax...
Web.xml 配置详解 Web.xml 是一个部署描述符文件,用于描述 Web 应用程序的配置信息。该文件是基于 XML 语法的,所有的元素都是大小写敏感的。下面是 web.xml 配置文件的详细解释: 定义头和根元素 在 web.xml ...