appcelerator

Fetching data from JSON.parse array

一笑奈何 提交于 2019-12-02 05:05:07
I am stuck in this problem, I am calling a webService that returns me a json response. now i want to fetch a particular value from that response but after searching on internet and struggling a lot couldn't fix it. here is my code: var xhr = Titanium.Network.createHTTPClient({ onload : function(e) { Ti.API.info("Received text: " + this.responseText); alert('success'); }, // function called when an error occurs, including a timeout onerror : function(e) { Ti.API.debug(e.error); alert('error'); }, timeout : 5000 }); var data = {"data":"system.connect"}; xhr.open("POST","http://mytesturl.net

iOS App change universal to iPhone only

夙愿已清 提交于 2019-12-02 04:29:26
We have a app that was submitted as a universal app with support for all devices iPad and iPhone but we no longer want it to show in the store as a iPad app we want it to just be a iPhone only app. This app was built with Appcelerator so i have changed the app tiapp.xml details to only support iPhone no longer universal, but it will not submitted to the store. I can't upload the existing app because the family group in the bundle Id. it won't accept removing the iPad. How can we remove the app from being listed as a iPad app really important as the app was not built with iPad in mind it would

Appcelerator and CommonJS modules (caching and circular references)

﹥>﹥吖頭↗ 提交于 2019-12-01 18:59:52
问题 Here's the thing: I'm using the CommonJS way of making my mobile (iPhone/Android) application modular. No surprise there. But there's one thing that I just can't get my head around. CommonJS lets me create STATIC private variables, which lets me create singletons at ease. This, I think at least, is because the contents of a file that gets require() d is read only once and then the exports object (which is initialized only once) is returned every time. But when I create a circular reference as

Appcelerator and CommonJS modules (caching and circular references)

北城以北 提交于 2019-12-01 18:38:50
Here's the thing: I'm using the CommonJS way of making my mobile (iPhone/Android) application modular. No surprise there. But there's one thing that I just can't get my head around. CommonJS lets me create STATIC private variables, which lets me create singletons at ease. This, I think at least, is because the contents of a file that gets require() d is read only once and then the exports object (which is initialized only once) is returned every time. But when I create a circular reference as seen below, the code inside the included module is executed every time. Wait... Funny thing is, while

How to query the child views of a parent view using Titanium?

只谈情不闲聊 提交于 2019-12-01 17:18:44
问题 I am looking to create a general purpose routine that will operate over a view's children. Within the routine I need to be able to iterate over the child views. I don't see anything in the API that would suggest that there is any way to get the child views. There is an "add()" and a "remove()" method but nothing like "get()" nor does there appear to be any properties like "views". What am I missing? 回答1: this is the basic structure for removing child objects from a view if (view.children) {

Facebook module is no longer 64 bit in appcelerator 5.2GA

若如初见. 提交于 2019-12-01 12:56:54
The Facebook module has stopped working. I am working on a tituanium app in appcelerator. When I try to build my app, I get the following error: [INFO] : Invoking xcodebuild [ERROR] : * BUILD FAILED ** [ERROR] : The following build commands failed: [ERROR] : Ld build/Intermediates/Game.build/Debug-iphoneos/Game.build/Objects-normal/armv7/Game normal armv7 [ERROR] : Ld build/Intermediates/Game.build/Debug-iphoneos/Game.build/Objects-normal/arm64/Game normal arm64 [ERROR] : (2 failures) I managed the to isolate the problem with the Facebook module, it is no longer 64 bit. How can I resolve this?

Trouble installing Android SDK for Appcelerator studio on windows 7

喜夏-厌秋 提交于 2019-12-01 09:35:28
I have trouble installing Appcelerator studio on windows 7. I am getting the following error when trying to create a new mobile project (Alloy project) and run the same on an android device. Works fine on mobile web. [ERROR] : No valid Android SDK targets found. [ERROR] : Please download an Android SDK target API level 23 or newer from the Android SDK Manager and try again. The android SDK is already in place and have properly referenced it. Still no luck there. Please find the platform specifics Appcelerator Studio version : 4.5 Titanium SDK : 5.2.0GA OS : Windows 7 (64 bit) Any help will be

Problems with refresh function for page, in Appcelerator

匆匆过客 提交于 2019-12-01 09:14:24
Titanium SDK version: 1.6.1 iPhone SDK version: 4.2 I am using JavaScript. I am developing an app that is fetching information from an API. In this app, on this page, I got two ways of "refreshing" the content. When the window is focused and when I tap the refresh button. The problem is every time I do a fresh of the page there is a "copy" of the content under the new content. It is like the app just keeps layering on new copies of the content on top of the others on each fresh. What am I doing wrong in my code? Is there a way to "clear" the page before each refresh. I can imaging that this

Titanium HTTPClient returns too 'fast'

好久不见. 提交于 2019-12-01 09:07:35
I have the following function: getTasks: function() { var taskRequest = Titanium.Network.createHTTPClient(); var api_url = 'http://myawesomeapi.heroku.com/users/' + Ti.App.Properties.getString("userID") + '/tasks'; var tasks = []; taskRequest.onload = function() { var response = JSON.parse(this.responseText), len = response.length, i = 0, t; for(; i < len; i++) { task = response[i]; var newTask = {}; newTask.rowID = i; newTask.title = task.title; newTask.description = task.description; newTask.id = task.id; newTask.hasChild = true; tasks.push(newTask); } alert(tasks); } taskRequest.open('GET',

What are some of the best ways to optimize a Titanium app?

匆匆过客 提交于 2019-12-01 08:22:22
I have a titanium based iOS app that basically is following my own MVC structure. It has around 30 views and a lot of network connections to do API calls. So, it seems that the application is performing assumably sluggish on an actual device except iPhone4S. Specifically, the app would hang for about 10s after re-launching it from the multi-tasking menu. Any tips? You mostly have to care about memory leaks. You have a VERY important webcast on the subject. In short; be very careful to : avoid big global objects : they have references to the world, so these references won't be cleared eliminate