Community Questions & Answers

Break in string from xml?

Hey, i am pulling some text stuff from xml (localization) everything works fine - except the breaks :/ In my XML strings there is (for example) <string name="hello_world_text">Hello \n World</string> If i write this stuff...

Parsing JSON string from module event

Hello, I am using Titanium SDK 3.0.2.GA and Android 4.0.3 and am having an issue parsing a JSON string that is being passed from a module. If I test parting within titanium, it works perfectly fine with the example below: ~~~ var sampleJSON =...

String matching in ACS

Hi Community, Is there a way of string pattern matching in ACS, e.g ~~~ SELECT * FROM suppliers WHERE supplier_name like '%bob%'; ~~~ In the example above , the query is looking for all suppliers whose name contains the characters 'bob'.

String replace function

when I call text.replace('a','c'); I saw that the replace function replace subStr ('a') just in the first time... How can I replace all the subStr that founds in the String text ? like : text = 'blabla bla' the result will be : 'blcblc blc' Thanx for...

XML parse string error for iOS

I am working on caching the xml files to make my app accessible offline. On the homepage of my app, I called all the xml files that my app uses. And this is how I am parsing my xml file. But it's giving me error. Here is my code: ~~~ var data =...

String.formatDecimal usage

Hi, I'm trying to determine what I can use for the pattern format string with the String.formatDecimal extension: ~~~ formatDecimal( Number value, [String locale], [String pattern] ) : String ~~~ I've found that '0.000' and '0E00' are valid so far. Can...

HttpClient response mechanics

Total noob to this so that's why i'm asking so stupidly. I also asked a quite similar thing here but nobody answered... I just want to send a string from the server to the app as a response when i upload a file to the server. Is this supposed to work...

How to remove the spaces from both sides of a string

Hi, I have to enter a name in a textField which can contain one blank space only between the words and it can contain any character, if the user enter any spaces at the beginning or end of the string, it should be automatically removed(just like Trim...

Converting a line of String to an Int

Hi all, I want to know if it is possible to convert a line of string to an Int for example I,m reading from a Json file and it returns the Name and Nickname of a specific selected fighter but i want to count the amount of Nicknames the fighter has to use...

URL's in strings possible?

Is it possible to use URL's in strings? At the moment I get "Null" if i try it. Is there any way to fix this? ~~~ if(Ti.Platform.name!='android') { var contentURL = L('android_q1'); win.add(activeMovie); } else { var contentURL =...

javascript

Hi, I am looking for a function which gives the width in pixels of a word ? does anyone know that function ? thanks

string functions titanium mobile

hi, in my android app i need to obtain a char code of the specified letter and to obtain the letter at the specified char code, i tried asc and char like in javascript but with no success, can you help me?thanks

Reading raw data from Blob

Hi, for sending a photo via multipart upload I need the content of an image as string. This I tried: ~~~ var stream = Ti.Stream.createStream({ source : image, // from camera role mode : Ti.Stream.MODE_READ }); var buffer =...

make a call on android

hi, i use this code to call on android : ~~~ var intent = Ti.Android.createIntent({ action: Ti.Android.ACTION_CALL, data: call }); Ti.Android.currentActivity.startActivity(intent); ~~~ 'call' is a string which contains : call = 'tel:' + passerelle...

call on android

hi, i use this code to call on android : ~~~ var intent = Ti.Android.createIntent({ action: Ti.Android.ACTION_CALL, data: call }); Ti.Android.currentActivity.startActivity(intent); ~~~ call is a string which contains : call = 'tel:' + passerelle + ','...

tel on android

hi, i have this code : ~~~ if(codeConfidentiel == null || codeConfidentiel == ''){ Ti.Platform.openURL('tel:' + passerelle + ',' + number + '#'); } else{ Ti.Platform.openURL('tel:' + passerelle + ',' + codeConfidentiel + '#,' + number +...

Parsing an array into a variable

Hello guys, I've got a list of names that are returned from a database, and pushed to a TableView. I would like to grab them again (using the 'babyname' variable) and pop them into a single variable so I can write out my list so it can be emailed. It...

RegExp / String Replace

hello there,,i have a problem about String Replace,,for example i have this code : ~~~ var pattern = new RegExp('&deg;',''); var deskripsiSiangClean = cuaca[0].fcttext.replace(pattern , '\u00B0'); deskripsiSiang = deskripsiSiangClean; ~~~ Text...

How to get Base64Decode as a string?

For our app, we are needing to Base64 encode/decode but as we are not doing it on images we need to keep it as a string. While we can get our own external library to do it, I happily noticed Titanium already had this support. Then we found decoding...

String functions in Android

Hi, I am using SDK 1.4.2 on a Mac, whenever I use any string function in the Android emulator, I get errors like the simple code snippet below: ~~~ var str="Split Into An Array"; str.split(); ~~~ Results in an error dialog in the Android emulator...

Add ' to sql string for replication

I'm adding web-syncing functionality to my iPad app, and what Ive decided is to basically whenever I run a SQL command on the website or app, save that sql (along with a timestamp so I run it in order) and handle it from there. On the app side, I'm having...

Get XML node content as html

This probably such a newbie question but I'm stuck at parsing an RSS feed. I've created an index of stories from an RSS feed whose structure is such that each story's full html content is contained within the description tag. ~~~ ... <item> ...

Showing 1-50 of 64 1 2