Community Questions & Answers
Resources Directory in IOS6?
Hey developers, I am checking if a file exists in my resources directory, if it does exist I include it. In my simulator this always worked fine and it still does. But since a few days (ios6) it doesn't work on my iPad anymore. When I alert...
How to best include date formatting library in Alloy project?
I'd like to include one of these two date formatting libraries in my Alloy mobile project to help me format dates. What's the best way for me to do that? I tried putting the code in alloy.js to no avail. -...
Titanium.include not working?
Hello, A year ago i used titanium, since then never again. But now i wanted to start developing with Titanium again. But i encounterd my first problem. Ti.include() is not working. It always says can't find file. I searched for several options but none...
Ti.include on Android
Hey, just found 2 years old threats... Isn't it possible to use Ti.include with android? it seems just not to include the files correctly.... if i am testing on device or emu... Help would be great! SDK 3.0
Using Helper Javascript Libraries in Alloy
Hi there- I have a basic Alloy newbie question....I have several helper Javascript libraries I am porting over from a previous Titanium project. These libraries are self executing: ~~~ (function() { Namespace.obj = {} Namespace.obj.fnName =...
Build Efficiency and other time save tips
Hello everyone, My question here, is about tips and other methods to test an iPhone app as fast as possible. I've been using Titanium for a year now. I am currently using Navigation Group system on my App and to save and test changes , I have to build the...
Ti.include in Alloy
Is there a way to use Ti.include in Alloy inside a controller .js file to call code written in other files anywhere inside the app tree?? If there is please explain how can I do it since i tried ~~~ Ti.include('/src/myFolder/myFile.js') ~~~ and it did...
javascript include in webview not working
I'm trying to include a js file (jquery-1.3.2.js copied from KitchenSink webview example) in an html page hosted in a webview: ~~~ var webview = Ti.UI.createWebView(); webview.url = 'test.html'; win1.add(webview); ~~~ and the html page...
"Too deep recursion while parsing" when including files on Android
We've separated our project into modules, which works fine on iPhone but seems to cause a stack overflow on Android. You can see my console here: https://skitch.com/arood/r196x/titanium-developer-1.2.2 How do I work around this problem?
How to (automatically) include all files in a directory?
Is it possible to include an entire directory of js files, or loop over and include every JS file in that directory? I am working with SDK version 2.1.3 on Windows 7, and developing for Android. Thank you in advance! ~Nick
Write and read a variable in an includes js-file
Is it possible to write and read an variable in an includes js-file? I want to save some values in an global central file, for example the username, password, server-url, etc. which i want to use in different other files. I have this js-file to save my...
What is the recommended way to include a js file moving forward?
I have an Android app that works great using the current release SDK (2.1.3 GA) with the exception of [a known ICS calendar bug](http://jira.appcelerator.org/browse/TIMOB-8053?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab) that...
Parse error while using .jss file
I need to run the IBS office app on all platforms (iPhone, iPad and android). I found two ways to create platform specific app, one using .jss files and other using if else condition. I created two jss files (app_iphone.jss and app_ipad.jss). The file...
Errore including html file in a webview
This is the window file ~~~ function InfoContent() { var webview = Titanium.UI.createWebView({ url: Titanium.Filesystem.resourcesDirectory + "/info.html" }); var win5 = Ti.UI.createWindow({ backgroundColor:...
Can not use Variables when I use Ti.include on a Eventlistener and onload-Function
Hello, i can not use a Var in a Eventlistener and onload-function. I get an Application Error: ### Can`t find variable: eintrag at parse-json-suchen.js Here is my Code ~~~ search_leutesuchen.addEventListener('change', function(e){ var url =...
include JavaScript file in view of scrollableView
Hi, I've got an scrollableView with some views in it (about 10 - 15). Those views are scrollViews. Now I want for each view an seperate JavaScript file. I tried some things but no luck at all. How can I use other JavaScrip files for the views in...
How to use include? using their funcitons and change variables
~~~ var winAlert = Ti.UI.createWindow({}) var viewOpacity = Ti.UI.createView({ backgroundColor: "black", opacity: 0.7 }) winAlert.add( viewOpacity ) var viewAlert = Ti.UI.createImageView({ backgroundImage:...
Workaround for missing Titanium.include in Desktop (all versions up to 1.2.0 RCx)
While Titanium.include has been implemented for PHP, Ruby, and Python files, attempting to use it inside Javascript files gives an error message. Here's a workaround I've found that works much better than using eval(). The problem with eval() is that...
Weird can't find variable afte Ti.include
Hi, I have a.js and some global variables (lat,lon). Then I write Ti.include(b.js) and in the b.js I write Ti.include(c.js). The lat and lon are accessible but I get this error: [WARN] Exception in event callback. { line = 102; message =...
Include File In All Windows
In simplest form, I need to include the `Global.js` file in every other class. without having to place it in each class individually. So, the equivalent of doing this in every class in the entire application: `Ti.include('Global.js');`
Exact use of require() method.
Hi all, Can anybody tell me what is the exact use of the require() method and it's advantages when compared with the include() method. Thanks in advance.
Include Once or Import
Hello! Is there an import (C style) or include_once (PHP style) statement for mobile? I tend to use include files that appear to get 'included' more than once which presumably takes a performance hit. There doesn't appear to be one documented but I'd...
Include js file using absolute path
Pretty basic question, but it's been giving me issues for a while - how do you include a javascript file using an absolute path? The following doesn't seem to work: ~~~ Ti.include("/folder/file.js"); ~~~ If I use a relative path from the...
Trying to Understand Context in CommonJS (include vs. require)
I want to execute a bunch of code I store in another file using the CommonJS structure, sort of like a PHP include would do. Check out the following code example: ~~~ //==================================================== //Current context var button =...
Anyone developed an include_once for Titanium?
Hi there, Has anyone written a function that will include an external js file only once like PHP's include_once function?
Is there a way to detect if file inclusion is ongoing or done?
titanium mobile sdk 2.0 iphone sdk 5.1 Hi, I am including files using `require` and `Ti.include`, is there a way to know whether the current call is on-going or completed? thanks for your help.
Desktop, PHP, Including class.php files and the "Kroll" namespace error
I have run into several issues thus far with Titanium Developer, but glad to say I have pushed through all my issues, and have come a little ways in the program I am developing. Ofcourse, I have run into another issue, and would like to share it / curious...
Ti.include variable scope into a require js
Hi, I have a problem with the Ti.include() function, each time i try to make an include i'm running into this error : [ERROR] Script Error = Can't find variable:.. Basically my app is : app.js ~~~ var Window1 =...
Ti.include() into a require() run into Error
Hi, I have a problem with the Ti.include() function, each time i try to make an include i'm running into this error : [ERROR] Script Error = Can't find variable:.. Basically my app is : app.js ~~~ var Window1 =...
Ti.include failing on Android
Hi.. I have a JS file, say 'a.js', in my Resources folder. I have included the file using Ti.include('a.js') This works for iOS, but fails for Android. Can somebody please help me out here ? Thank u..
Choices on startup
Hopefully someone here can tell me what I'm doing wrong. I am trying to create a tabbed app that asks the user to choose the closest city to them on the first start up. I am using the default tab JS that appcelerator creates and including a file that...
include from worker
I'm creating a worker: ~~~ var worker = Titanium.Worker.createWorker("worker.js"); worker.start(); ~~~ And from worker.js I would like to include("ruby.rb") in order to run some ruby scripts. But all I get is: Error executing worker:...
Simulating Titanium.include() during testing
Hi, I'm using Jasmine as my js testing framework for mobile developement with Titanium mobile 1.5.1. It's working fine (with a little bit of hand mocking of the Titanium classes), but I wondered if there's a way I can simulate Titanium.include() to pull...
Require a file out from the app directory
Hi, I would like to create a library with all the js files that I use in projects usually with titanium. I would like to save the library out of the directory of my application, so I can use it in all projects and change it once. How can I include it...
does not exist error when attempting to include a module when developing on Ubuntu for Android
I have been trying unsuccessfully for some time to import a custom android module into an application in Titanium Studio running on Ubuntu Linux. Thinking there must be doing something wrong I decided to try compiling a sample application from an...
When to use Require Vs. Include ?
Hi All, I'm a newbie to appcelerator to JavaScript Design Patterns in general and I've been studying all the excellent docs & videos on using **Ti.Include()** and **CommonJS Modules**. My understanding is that **Ti.Include()** is the same...
Ti.include could not find the file
Hello guys, I'am using Titanium Studio 1.0.7 and want to develop a Mobile Project. I've tried to cut out some code from the Hello World Project to a external .js file called win1.js (so this file is not empty). I wrote the `Ti.include('win1.js');` where...
Titanium.include() very slow on Android
Hi I'm writing a "cross-platform" app for iOS & Android. During development I have always noticed a huge performance reduction on Android.. on the emulator obviously, but also on my test devices (a "powerful" Acer A100 & an...
Include and compile a java-library
Is it possible to include and compile a java library to my desktop/(mobile) application? When it's possible, then what I have to care about? Which library do I mean: [LINK](http://jasperforge.org/projects/jasperreports)
Can't find files on iOS device
This function works fine on the iPad and ALL simulators. However, on iPhone it is unable to find the corresponding file. The OS is being returned as 'iphone', I've checked all spelling and file paths, I've cleaned the project more times than my own house,...
Missing files when running on iOS device
My project is running perfectly on iPad. But when I run on iPhone, it cannot find any of the files I specified. I have a function that checks the OS name. If it's an iPad, it imports a set of files. If it's an iPhone, it loads a different set of files. I...
Ti.include SDK 1.7.x
Did something change on the include function? With SDK 1.6.2 I could successfully include a file xyz.js located in Resources/android and Resource/iphone by the following statement: ~~~ Ti.include('xyz.js'); ~~~ Then, based on the used OS it was...
Problem with include and iPhone Simulator
I have the default app with two tabs. If I just copy all the code from this file to another js file and just add as an include in app.js, it will fail with this code ~~~ [ERROR] error loading path: file://localhost/.../TestTit.app/tab1.js, Error...
What's different with url and include
Hellow , I need to know what the different between using include and createWindow with url. 1. in app.js to using Ti.include('ui/HotNews.js') 2. in app.js to createWindow using url ~~~ var WinHotNews = Titanium.UI.createWindow({ title:'????', ...
Including all the modules. OK or bad tactic?
Hi, I'm thinking to do the following in order to shorten a little bit my code. Let's say I have 10 module js files: ~~~ var m1 = require('js/m1'); var m2 = require('js/m2'); var m3 = require('js/m3'); var m4 = require('js/m4'); var m5 =...
Why debugger always start an old version
Hi! Here's my annoying problem. I modify the code but each time the iPhone simulator launch an old version of an include. Why? I'm having the latest version 1.0.7. I'm working for customer here and I'm tired of this and I consider getting back to xCode. So...
Many levels of "Titanium.include()" function and variable scope
Hello, i am currently trying to include a file within an included file and am trying to access the variables, but I get an undefined exception. Take the following example: file 1: ~~~ var level1 = {}; Titanium.include("file2.js"); ~~~ file...
Ti.include on Android after main load does not have global scope
I found out the hard way that files "lazy" loaded with Ti.include after the main app loads, do not have access to the global namespace and therefore is pretty much useless for that purpose. So I am using this tasty little treat...
Namespaces - 'Separating Concerns' - How?
Below is a link to a pastie of some dummy code. The main goal for me is to figure out how to split files and have them reference one another. I've never programmed with JS (which may be painfully obvious) and have little experience coding at all (also...
Creating a Reusable Factory (and Reusing it)
I'm creating a factory that will generate a header for several windows in a client application, but something isn't right. The header shows up fine on my home screen, but on that screen I have a button that loads a new window. My `ui.js` file (the custom...
Showing 1-50 of 99 1 2