Skip to content

Commit

Permalink
Merge branch 'master' into TIMOB-24527
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokesh Choudhary committed Apr 27, 2017
2 parents 4a89818 + f671292 commit f3c5cf0
Show file tree
Hide file tree
Showing 59 changed files with 526 additions and 5,643 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ script:
- "export VERSION=`sed -n 's/^ *\"version\": *\"//p' package.json | tr -d '\"' | tr -d ','`"
- export TIMESTAMP=`date +'%Y%m%d%H%M%S'`
- export VTAG=$VERSION.v$TIMESTAMP
- cd build
- npm install .
- cd build
- node scons.js build
- node scons.js package --version-tag $VTAG
- cd ..
- npm install
- ls dist
- npm test
28 changes: 18 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,23 @@ timestamps {
echo "VTAG: ${vtag}"
basename = "dist/mobilesdk-${vtag}"
echo "BASENAME: ${basename}"
// TODO parallelize the iOS/Android/Mobileweb/Windows portions!
dir('build') {
nodejs(nodeJSInstallationName: "node ${nodeVersion}") {
timeout(5) {
sh 'npm install .'
}

nodejs(nodeJSInstallationName: "node ${nodeVersion}") {
// Install dev dependencies
timeout(5) {
// We already check in our production dependencies, so only install devDependencies
sh(returnStatus: true, script: 'npm install --only=dev') // ignore PEERINVALID grunt issue for now
}
sh 'npm test' // Run linting first
// Then validate docs
dir('apidoc') {
sh 'node validate.js'
}
// TODO parallelize the iOS/Android/Mobileweb/Windows portions!
dir('build') {
timeout(15) {
sh 'node scons.js build --android-ndk /opt/android-ndk-r11c --android-sdk /opt/android-sdk'
}
} // timeout
ansiColor('xterm') {
if (isPR) {
// For PR builds, just package android and iOS for osx
Expand All @@ -132,11 +140,11 @@ timestamps {
// For non-PR builds, do all platforms for all OSes
timeout(15) {
sh "node scons.js package --version-tag ${vtag} --all"
}
} // timeout
}
} // ansiColor
} // nodeJs
}
} // dir
} // nodeJs
archiveArtifacts artifacts: "${basename}-*.zip"
stash includes: 'dist/parity.html', name: 'parity'
stash includes: 'tests/', name: 'override-tests'
Expand Down
204 changes: 137 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,141 @@
Appcelerator Titanium Mobile
============================
# Appcelerator Titanium [![Build Status](https://jenkins.appcelerator.org/buildStatus/icon?job=titanium-sdk/titanium_mobile/master)](https://jenkins.appcelerator.org/job/titanium-sdk/job/titanium_mobile/job/master/)

[![Build Status](https://jenkins.appcelerator.org/buildStatus/icon?job=titanium-sdk/titanium_mobile/master)](https://jenkins.appcelerator.org/job/titanium-sdk/job/titanium_mobile/job/master/)
Welcome to the Titanium open source project. Titanium provides a mature platform for developers to build
completely native cross-platform mobile applications using JavaScript.

Welcome to the Titanium open source project. Titanium provides
a platform for web developers to build cross-platform, native mobile applications
using JavaScript.

Currently, Titanium supports mobile smartphone operating systems such as Apple iPhone, Google's Android, and Mobile Web. Other platforms, such as Windows Phone, are currently in development.
Currently supported native platforms are iOS, Android and Windows Phone / Windows Desktop.

Titanium is licensed under the OSI approved Apache Public License (version 2). Please
see the LICENSE file for specific details.

*[Download Pre-built Titanium](http://builds.appcelerator.com/#master)*

## Features

Features
--------------------

With Titanium, you use JavaScript to code your application. Titanium's compiler will compile
With Titanium, you use JavaScript to code your application. Titanium's compiler will compile
your application code into an efficient native executable for each target mobile platform.
Titanium writes native code so you don't have to. :)

- Native apps built using JavaScript
- Apps are compiled and run locally with full offline support
- Support for native platform UI controls
- Third-party JavaScript support such as jQuery, Dojo, etc.
- Support for Web views incorporating HTML5, CSS etc.
- Support for in-application SQL database
- Support for Geolocation (compass, geolocation, forward/reverse lookup)
- Support for Camera (taking Photos, playing and recording Video)
- Support for Photo Album (reading and writing)
- Support for Contacts Database / Address Book
- Support for Streaming Audio and Recording Audio, Audio Input Levels, Mic etc
- Support for Vibration
- Support for Social APIs such as Facebook Connect, Twitter, etc
- Support for Yahoo YQL
- Support for Web Services via REST, SOAP
- Support for native Maps
- Support for Push Notifications
- Support for in-application Email
- Support for in-application SMS, Telephone
- Support for Filesystem (reading, writing, etc)
- Support for Gestures (such as Shake)
- Support for Platform and Device capabilities
- Support for complex native views such as Coverflow, Image viewers, Table views, Grouped Views, Composites, etc.
- Completely extensible via Module API for building your own controls or extending capabilities at compile-time

And much, much more.

Alloy
-----

[Alloy](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Quick_Start) is the MVC application framework built on top of Titanium. It is optional. It rocks. Check it out if you're considering using Titanium. It is also a separate [open source project](https://github.com/appcelerator/alloy) available under Apache Public License.



Getting Help
------------

- [x] Native apps built using JavaScript (no hybrid, no embedded WebView)
- [x] Apps are compiled and run locally with full offline support
- [x] Support for native platform UI controls (TabGroup (iOS), ActionBar (Android), AppBar (Windows), ...)
- [x] Support for watchOS targets
- [x] Support for in-application SQL database
- [x] Support for Geolocation (compass, geolocation, forward/reverse lookup)
- [x] Support for Camera (taking Photos, playing and recording Video)
- [x] Support for Calendar (creating & fetching Events)
- [x] Support for 3D-Touch (Peek and Pop, Application Shortcuts, ...)
- [x] Support for Photo Album (reading and writing)
- [x] Support for Contacts Database / Address Book
- [x] Support for Streaming Audio and Recording Audio, Audio Input Levels, Mic etc
- [x] Support for Vibration
- [x] Support for Social APIs such as Facebook, Twitter, etc.
- [x] Support for Yahoo YQL
- [x] Support for Web Services via REST, SOAP
- [x] Support for native Maps
- [x] Support for Push Notifications
- [x] Support for In-Application Email
- [x] Support for In-Application SMS, Telephone
- [x] Support for Filesystem (create, read, write, etc.)
- [x] Support for Gestures (such as Shake and Pinch)
- [x] Support for Platform and Device capabilities
- [x] Support for complex native views such as Coverflow, Image Views, Table Views, Grouped Views, Composites, etc.
- [x] Support for Web Views incorporating HTML5, CSS etc.
- [x] Completely extensible via Module API and Hyperloop for building your own controls or extending capabilities

And much, much more (see our [Documentation](http://docs.appcelerator.com/platform/latest/#!/api/Titanium) for more infos).

## Hyperloop

Use Hyperloop, our latest addition to the Appcelerator Platform, to extend your Titanium apps by native API's using
JavaScript. Prior to Hyperloop, you would use [native modules](http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_Module_Concepts) to extend the Titanium API. With
Hyperloop, you are no able to implement native classes, 3rd-Party libraries (Cocoapods, local frameworks, .aar files)
and more directly into your apps. Hyperloop is available for iOS, Android and Windows Phone (Tech Preview).

### Features

#### Cross-Platform Reuse

Build and maintain apps in a fraction of the time with up to 95% code reuse.

#### Direct API Access

Access 100% of platform APIs directly, with instant support for each new OS release.

#### JavaScript Everywhere

Create mobile apps using the world’s most popular programming language.

#### 3rd-Party Libraries

Incorporate 3rd-party native libraries using JavaScript, with no changes required.

#### Custom Animations

Easily create complex custom effects like dynamic animations using JavaScript.

#### Run Native

Mobile app development for every major mobile OS – with no hybrid compromises.

### Example

Create a native view in iOS, Android and Windows Phone:

```js
// iOS
var view = new UIView();

// Android
var view = new View(activity);

// Windows Phone
var view = new Canvas();
```

### Getting Started

Check out our [Hyperloop Sample App](https://github.com/appcelerator/hyperloop-examples) and [Hyperloop Programming Guide](http://docs.appcelerator.com/platform/latest/#!/guide/Hyperloop) to get started with Hyperloop today!

## Alloy

[Alloy](http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Quick_Start) is the MVC application framework built
on top of Titanium. It is optional. It rocks. Check it out if you're considering using Titanium.
It is also a separate [open source project](https://github.com/appcelerator/alloy) available under Apache Public License.

### Example

Manage your application scope by separating your code into different models, views, controllers and more:

**index.xml** (View)
```xml
<Alloy>
<Window title="Titanium and Alloy">
<Button onClick="handleClick" id="myButton">Click me!</Button>
</Window>
</Alloy>
```

**index.js** (Controller)
```js
function handleClick() {
alert('Hello from the Controller!');
}
```

**index.tss** (Style)
```js
Window: {
backgroundColor: 'white'
}

"#myButton": {
width: 200,
height: 30,
backgroundColor: 'green'
}
```

## Getting Help

There are a number of ways to get help with Titanium.

Expand Down Expand Up @@ -94,10 +172,7 @@ need special licensing or want additional levels of capabilities. Please visit t
[Appcelerator Website](http://www.appcelerator.com) for more information about Appcelerator or
email [info@appcelerator.com](mailto:info@appcelerator.com).



Contributing
------------
## Contributing

Titanium is an open source project. Titanium wouldn't be where it is now without contributions by the community. Please consider forking Titanium to improve, enhance or fix issues. If you feel like the community will benefit from your fork, please open a pull request.

Expand All @@ -106,33 +181,28 @@ To protect the interests of the Titanium contributors, Appcelerator, customers a
[You can digitally sign the CLA](http://cla.appcelerator.com) online. Please indicate your email address in your first pull request so that we can make sure that will locate your CLA. Once you've submitted it, you no longer need to send one for subsequent submissions.


Building Locally
----------------
## Building Locally

Previously Titanium used scons and python scripts to build the SDK.
If you'd like to build the SDK locally, we've replaced scons with some Node.JS scripts. Typical usage would be:

cd build
npm install
node scons.js build --android-ndk /opt/android-ndk --android-sdk /opt/android-sdk
node scons.js package
node scons.js install
cd build
node scons.js cleanbuild --android-ndk /opt/android-ndk --android-sdk /opt/android-sdk

The build and package commands will default to all target platforms on your host OS unless explicitly specified. (i.e. Android, iOS, and Mobileweb on OS X; Windows, Android and MobileWeb on Windows)
The build and package commands will default to all target platforms on your host OS unless explicitly specified. (i.e. Android, iOS on macOS; Windows and Android on Windows). It will compile, package and install the locally-built SDK for you
as well, so you can test it in your own applications without any further procedures.

The build command will look for Android NDK and SDK using $ANDROID_NDK and $ANDROID_SDK env variables if not explicitly passed using command line arguments.

You can use the `-h` flag to display the full list of comands and options.

cd build
npm install
node scons.js build [platform1] [platform2] --android-ndk /opt/android-ndk --android-sdk /opt/android-sdk /Users/build/android-sdk-macosx
node scons.js package [platform1] [platform2]
node scons.js install
cd build
node scons.js cleanbuild [platform1] [platform2] --android-ndk /opt/android-ndk --android-sdk /opt/android-sdk /Users/build/android-sdk-macosx


Legal Stuff
-----------
## Legal Stuff

Appcelerator is a registered trademark of Appcelerator, Inc. Titanium is
a registered trademark of Appcelerator, Inc. Please see the LEGAL information about using our trademarks,
Expand Down
18 changes: 9 additions & 9 deletions android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@
* Please see the LICENSE included with this distribution for details.
*/

var ADB = require('titanium-sdk/lib/adb'),
var ADB = require('node-titanium-sdk/lib/adb'),
AdmZip = require('adm-zip'),
android = require('titanium-sdk/lib/android'),
android = require('node-titanium-sdk/lib/android'),
androidDetect = require('../lib/detect').detect,
AndroidManifest = require('../lib/AndroidManifest'),
appc = require('node-appc'),
archiver = require('archiver'),
async = require('async'),
Builder = require('titanium-sdk/lib/builder'),
Builder = require('node-titanium-sdk/lib/builder'),
CleanCSS = require('clean-css'),
DOMParser = require('xmldom').DOMParser,
ejs = require('ejs'),
EmulatorManager = require('titanium-sdk/lib/emulator'),
EmulatorManager = require('node-titanium-sdk/lib/emulator'),
fields = require('fields'),
fs = require('fs'),
i18n = require('titanium-sdk/lib/i18n'),
jsanalyze = require('titanium-sdk/lib/jsanalyze'),
i18n = require('node-titanium-sdk/lib/i18n'),
jsanalyze = require('node-titanium-sdk/lib/jsanalyze'),
path = require('path'),
temp = require('temp'),
ti = require('titanium-sdk'),
tiappxml = require('titanium-sdk/lib/tiappxml'),
ti = require('node-titanium-sdk'),
tiappxml = require('node-titanium-sdk/lib/tiappxml'),
util = require('util'),
wrench = require('wrench'),

Expand Down Expand Up @@ -403,7 +403,7 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
},
'device-id': {
abbr: 'C',
desc: __('the name of the Android emulator or the device id to install the application to'),
desc: __('the id of the Android emulator or the device id to install the application to'),
hint: __('name'),
order: 130,
prompt: function (callback) {
Expand Down
4 changes: 2 additions & 2 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ var AdmZip = require('adm-zip'),
appc = require('node-appc'),
archiver = require('archiver'),
async = require('async'),
Builder = require('titanium-sdk/lib/builder'),
Builder = require('node-titanium-sdk/lib/builder'),
crypto = require('crypto'),
ejs = require('ejs'),
fs = require('fs'),
jsanalyze = require('titanium-sdk/lib/jsanalyze'),
jsanalyze = require('node-titanium-sdk/lib/jsanalyze'),
markdown = require('markdown').markdown,
path = require('path'),
temp = require('temp'),
Expand Down
4 changes: 2 additions & 2 deletions android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* See the LICENSE file for more information.
*/

var ADB = require('titanium-sdk/lib/adb'),
var ADB = require('node-titanium-sdk/lib/adb'),
appc = require('node-appc'),
async = require('async'),
EmulatorManager = require('titanium-sdk/lib/emulator'),
EmulatorManager = require('node-titanium-sdk/lib/emulator'),
fs = require('fs'),
path = require('path'),
__ = appc.i18n(__dirname).__;
Expand Down
6 changes: 3 additions & 3 deletions android/cli/lib/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* Please see the LICENSE included with this distribution for details.
*/

var android = require('titanium-sdk/lib/android'),
ADB = require('titanium-sdk/lib/adb'),
EmulatorManager = require('titanium-sdk/lib/emulator'),
var android = require('node-titanium-sdk/lib/android'),
ADB = require('node-titanium-sdk/lib/adb'),
EmulatorManager = require('node-titanium-sdk/lib/emulator'),
appc = require('node-appc'),
__ = appc.i18n(__dirname).__;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ public void handleKeyboard(KrollDict d)
tv.setTransformationMethod(null);
}
}
tv.setKeyListener(null);
} else if (d.containsKey(TiC.PROPERTY_SOFT_KEYBOARD_ON_FOCUS)
&& TiConvert.toInt(d, TiC.PROPERTY_SOFT_KEYBOARD_ON_FOCUS) == TiUIView.SOFT_KEYBOARD_HIDE_ON_FOCUS) {
tv.setInputType(InputType.TYPE_NULL);
Expand Down

0 comments on commit f3c5cf0

Please sign in to comment.