titanium-mobile

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

Error 2500 when trying to get Facebook Email in Appcelerator Titanium

女生的网名这么多〃 提交于 2019-12-12 05:07:41
问题 I try to get email address of a user logged in via Facebook Module. But get error every time {"error":"An error code 2500 has occured. An active access token must be used to query information about the current user."} My code is: var viewClick = function() { fb.logout(); fb.initialize(); fb.authorize(); }; var facebookLogged = function(e) { fb.requestWithGraphPath("me?fields=name,email,first_name,last_name", {}, 'GET', function(result) { Ti.API.info(JSON.stringify(result)) // var data = JSON

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

How to parse this XML in Titanium>

爱⌒轻易说出口 提交于 2019-12-12 04:42:58
问题 <?xml version="1.0" ?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns1:getCountriesResponse xmlns:ns1="SoapQrcode"> <return SOAP-ENC:arrayType=":[8]" xsi:type="SOAP-ENC:Array"> <item xsi:type="xsd:string"> China </item>

Titanium mobile / Apple Push notifications What is the most logical place to insert the callback

痴心易碎 提交于 2019-12-12 03:37:58
问题 Question, What I want to achieve is to have a centralised place for the notifications to be received, so no matter on what window or tab a user is the notification will be received and callback functions to be fired. If a project relies heavily on the Apple Push Notifications what would (In Titanium Mobile) be the best place to insert the code for the notification requests and callback. I thought this would happen automatically but it does not, currently I have the

where database store in iphone simulator (for Mac OS)?

最后都变了- 提交于 2019-12-12 02:47:48
问题 i create a application.Whose, Log IN application in this we add a local database (db.sqlite). When new user do registration. than, add the whole data in database. its is run properly in device. But,how i see the data (data was store or not)? Question : where does this database file get stored on the filesystem when you're using an simulator (in Computer)? 回答1: In my case, I got my .sql file at /Users/myName/Library/Application Support/iPhone Simulator/4.2/Applications/B378BED2-C67C-4465-AB8A

$_POST variable doesn't work in php Titanium

北城以北 提交于 2019-12-12 02:33:05
问题 I'm trying to pass data between a JS file and a PHP file, but the variable $_POST in PHP doesn´t work and for that i can´t evolve in the app! JS code: var params = String(input.value); var xhr = Titanium.Network.createHTTPClient(); xhr.open('GET','http://10.0.2.2/jobfinder/teste_demo_grafica/Resources/teste.php'); xhr.send(params); xhr.onload = function(){ var response = this.responseText; alert(response); if (response != null) { alert("voltou ao js e funca"); } else { alert("-.-"); } }; xhr

how to add event in Calendar?

[亡魂溺海] 提交于 2019-12-12 02:29:39
问题 Question is : how to add any event in calender? i want to make a application, in which we can store any event in Calendar. with date and time and it have 3 option Daily, Weekly, and MOnthly, it remembered me whose option is selected. NOte : (iphone or android both) (Titanium). 回答1: this This is for Android and for iphone we can use ti.Com.calendar module this is provide by third party. GitHub this 回答2: Basically this can be done in android using intents, please find the full documentation

Titanium - Android external storage - create new directory and then write files into it

喜欢而已 提交于 2019-12-12 02:19:09
问题 Can we not simply create new directory programmatically on external SD card (not internal memory of device) in Android and can we not write files on SD card? Is Titanium so restricted to always write files on internal memory even after using Ti.Filesystem.externalStorageDirectory ? Can someone who has ever been able to create a new directory programmatically on SD card in Android write the answer here or no one ever needs to write something on external SD card? 回答1: You can use System class