titanium

Get Phone Number(android) in Titanium

自古美人都是妖i 提交于 2019-12-12 05:56:33
问题 How can I get phone number in android? Sample Code: var contacts = Titanium.Contacts.getAllPeople(); Titanium.API.log(contacts[0].phone['mobile'][0]); //in iOS, returns "01012345678" fine :) Titanium.API.log(contacts[0].phone['mobile'][0]); //in Android, returns "" :( Titanium.API.log(contacts[0].fullName); //in Android & iOS, returns "test Name" fine :) Titanium.API.log(contacts[0].phone); //in Android, returns "" :( 回答1: Try the following code, It worked with me //Getting all the contacts

how to change layout on orientation change for titanium ipad

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 05:47:39
问题 I'm trying to make a spec on the ipad for an image gallery that has a 3x3 portrait layout but changes to a 3x2 layout on landscape. I'm trying to get the landscape or portrait grid on application load and then change also on orientation change but every time I do change my orientation the thumbnails flicker and the grid is all out of wack. http://pastebin.com/sLppSpS9 I'm thinking 'clear out or reset' the view, is there way to do that? 回答1: I've done similar with Windows, rather than views -

Add a Native Calendar with Titanium

℡╲_俬逩灬. 提交于 2019-12-12 05:39:53
问题 For an app developed in Titanium, it is required to be possible to add Events into the Native Android Calendar. While the docs specify plenty of methods to add Events to the native calendar (selectable ones), it does not provide the methods to create a new Calendar (conceptually a layer that holds events) Has anyone been able to create a new Calendar on Android and how, specifically on Titanium, can one do that? 回答1: Creating a new calendar for Android is not currently supported in Titanium.

SQLite Titanium Syntax Error

蹲街弑〆低调 提交于 2019-12-12 05:32:16
问题 The following SQL code works fine in SQLite Manager and in other SQLite systems, however when I use it in Titanium I get an "Uncaught SyntaxError: Unexpected String." If my syntax is wrong, how should it be coded for Titanium? SELECT Date, Content FROM MYDATABASE WHERE strftime('%m%d', Date) = strftime('%m%d', date('now')) 回答1: Did you call your table MYDATABASE? Are you stepping through the debugger and confirming that var rs = db.execute("SELECT Date, Content FROM MYDATABASE WHERE strftime(

iOS Simulator failed to install the application in Titanium

佐手、 提交于 2019-12-12 05:27:35
问题 I have created a Titanium ios 3.1.0 app, But now when I am trying to run it is giving me the following error. [ERROR] : An error occurred running the iOS Simulator [ERROR] : [DEBUG] Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=1 "SpringBoard failed to launch application with error: -3" UserInfo=0x7fe2b84837c0 {NSLocalizedDescription=SpringBoard failed to launch application with error: -3, DTiPhoneSimulatorUnderlyingErrorCodeKey=-3} [ERROR] : [ERROR] : Project

Cannot write to file in Titanium

大憨熊 提交于 2019-12-12 05:08:44
问题 I am having trouble writing to a file in Titanium Studio. specifically .json file. Code is compiled through and no exception was thrown. Here is my relevant section of code, I parse the file to var first before adding element and stringify it to be written back. Reading works perfectly, so is adding element, it's the writing process that has issues var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'data.json'); var jsontext = file.read().toString(); var jsondoc = JSON.parse

TableViewRow height in Titanium

我的未来我决定 提交于 2019-12-12 05:04:14
问题 I don't know why the TableView hides the end of a long string automatically for me. Is there a way that I can avoid that? Here are screenshot and code: var data = []; var row = Ti.UI.createTableViewRow(); var label = Ti.UI.createLabel({ text: 'ALongLongLongLongLongLongLongLongLongStringFromDatabaseOrSomewhere~', }); row.add(label); data[0] = row; var table = Titanium.UI.createTableView({ data: data, style: Titanium.UI.iPhone.TableViewStyle.GROUPED, }); Ti.UI.currentWindow.add(table); Thanks a

“Register Device” fails in Preferences -> Studio -> Platforms -> iOS #appcelerator

自作多情 提交于 2019-12-12 05:01:21
问题 I tried to register a device in appcelerator per the path in the title. When I click "Register Device" it takes me to page that errors out: "The requested application was not found on this server." The URL, without the API key is https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?&appIdKey=&path=%2F%2Faccount%2Findex.action So if this is not the way to Register a Device in Appcelerator, how do I do it? 回答1: You can register a device at: https://developer.apple.com/account/ios

Titanium: Saving file locally from Android's Camera/Gallery image

我怕爱的太早我们不能终老 提交于 2019-12-12 04:56:09
问题 I am having issues saving image to local application files in Titanium. Specifically creating file from event.media; function handleImageEvent(event) { imgpreview.image = event.media; var imaget = event.media; var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,imagename); f.write(imaget); } //imagename : I am using in the format of 'photo0.png' Here's the code I have so far that I have tried to put together and test through my own search, they do not work. exception

How to access global value from commonJS module in Appcelerator?

陌路散爱 提交于 2019-12-12 04:47:17
问题 For long time I was creating apps by making global variable which was accessible via modules I load. var myApp = { windows: {} } myApp.windows.mainWindow = require('libs/pages/mainWindow').create(); myApp.windows.mainWindow.open(); By calling myApp.windows[windowName][functionName] I could manipulate other windows (for example update lists) from within the commonJS module. I could also close, open other windows I found that calling global variables from within commonJS module is not good