titanium-mobile

Convert UTC Date to datetime string Titanium

六眼飞鱼酱① 提交于 2019-12-05 20:33:59
I have a date string "2012-11-14T06:57:36+0000" that I want to convert to the following format "Nov 14 2012 12:27" . I have tried a lot of solutions including Convert UTC Date to datetime string Javascript . But nothing could help me. The following code worked for me in android. But for ios it displays as invalid date var date = "2012-11-14T06:57:36+0000"; //Calling the function date = FormatDate(date); //Function to format the date function FormatDate(date) { var newDate = new Date(date); newDate = newDate.toString("MMMM"); return (newDate.substring(4,21)); } Can anyone help me? Thanks in

Titanium Creating Image file: file.write(blob) not creating the correct file

天大地大妈咪最大 提交于 2019-12-05 10:31:17
I am trying to read a .PNG file using Titanium 1.8.1 Here is my code to read file. var f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'KS_nav_views.png'); var blob = f.read(); When I create a new file using the above blob object, the new file thus created is not same as the original file. Here is my code to create the new file. var outputDir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory,'output'); outputDir.createDirectory(); var newFile = Titanium.Filesystem.getFile(outputDir.nativePath,'outFile.png'); var test = newFile.write(blob); if ( test ===

Titanium api.info never shows anything in the console

微笑、不失礼 提交于 2019-12-05 04:17:15
I've just started with titanium and I can't make the Ti.API.info("My log message") to print anything in the console. I tried running the app in my Android device, in the Android Emulator, in the iPhone simulator and as a mobile web project in GoogleChrome, and the console window in Titanium Studio never prints my log message. My last attempt was in the imported sample "Todo List". On the beginning of the file app.js I've added two log messages: if (Ti.version < 1.8 ) { alert('Sorry - this application template requires Titanium Mobile SDK 1.8 or later'); } else { Ti.API.error('my error'); Ti

Best way to upload image from Mobile to Django server [closed]

白昼怎懂夜的黑 提交于 2019-12-04 17:12:27
I am created a Mobile application(in Titanmium).where user take pictures in mobile and i need To upload the image from mobile to django server .I am using tastypie for my Api can any one guide me the best way to upload and save the image in server the methods may be in pure django or using tastypie .Anything will be helpful. and also best technique to acheieve this. Ambroise There are (at least) two ways to handle file upload with Django / Tastypie : 1/ As stated in my comment : you can make use of Tastypie's features regarding the matter. Django-tastypie: Any example on file upload in POST? 2

Titanium Alloy ListView Nested Model Array of Tags

天大地大妈咪最大 提交于 2019-12-04 14:44:20
问题 I am using Titanium Alloy version 3.2. I have a collection of posts in a listview. My data looks like this: [ { username: 'dude', imageUrl: 'url', tags: ['tag1','tag2','tag3'] }, { username: 'wheres', imageUrl: 'url', tags: ['tag1'] }, { username: 'my', imageUrl: 'url', tags: ['tag1','tag2','tag3','tag4'] }, { username: 'car', imageUrl: 'url', tags: ['tag1','tag2'] } ] And here is the xml. This works only for username and image. I can't figure out how to add the tags to each post. <ListView

Exception Occured While Building Android project

落爺英雄遲暮 提交于 2019-12-04 13:47:37
OS: Linux mint 14. Following error occurs when I try to run my project. [TRACE] Writing out AndroidManifest.xml [ERROR] Exception occured while building Android project: [ERROR] Traceback (most recent call last): [ERROR] File "/home/aqeel/.titanium/mobilesdk/linux/3.1.0.GA/android/builder.py", line 2528, in <module> [ERROR] builder.build_and_run(False, avd_id, debugger_host=debugger_host, profiler_host=profiler_host) [ERROR] File "/home/aqeel/.titanium/mobilesdk/linux/3.1.0.GA/android/builder.py", line 2264, in build_and_run [ERROR] self.manifest_changed = self.generate_android_manifest

Building Native View using iOS module and using them in Titanium

夙愿已清 提交于 2019-12-04 13:19:49
问题 I want to build an iOS module in which I have a viewController class with its .xib file. now the problem is how to call that view from my titanium code. I know that there are view proxy available but dont know how to use them due to not so good documentation. Till now I have created a module where non graphical data can be passed but what about getting View controller from my module. I have already checked the appcelerator wiki, but that was not helpful Any tutorial that will guide me will be

I need help understanding Titanium Alloy (MVC) development

一曲冷凌霜 提交于 2019-12-04 03:20:36
I'm used to developing in MVC frameworks such as cake and backbone, but I can't get my head around developing in Alloy. There don't seem to be any good examples online. I would be very grateful if someone could give an example of how you would set up a couple buttons that respond to click events and bring you to new windows. I'm also using Ti's map api to show a google map, but I'm not sure how to correctly initialize that either. Thanks! here are very helpful links for MVC Alloy http://developer.appcelerator.com/question/143969/alloy-mvc-examples Here are my collection of helpful links that I

How do you create a raised tab bar item, like the one found in Instagram, with Titanium?

好久不见. 提交于 2019-12-03 20:23:46
I am trying to create a menu like the one on Instragram, with the central item using a special design, but the Titanium Documentation does not provide information about this kind of feature There's an example with an already answered question in here: How do you create a raised tab bar item, like is found in Instagram? but I need it working on titanium, any clues? I believe Instagram is written in Objective-C. Creating a custom tab bar as they have made involves subclassing the native tab bar, but you don't have the ability to do that with just JS and Titanium. Here's a tutorial for faking a

How to Call a WebService in titanium using javascript

给你一囗甜甜゛ 提交于 2019-12-03 16:41:16
I am new to titanium and and want to call a web service from my titanium app. The webService returns the json response. As I am aware of calling the webService using XMLRPC but very confused regarding json. Until now, I know that we have to create the HTTPClient . var request = Titanium.Network.createHTTPClient(); request.open("POST", "http://test.com/services/json"); request.onload = function() { var content = JSON.parse(this.responseText);//in the content i have the response data }; request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //did not understand this line