Android :: Wrong Format From String.format
Sep 6, 2010
Passing two int values m =0 & s = 11, to below function String formatted = String.format("%1$02d:%2$02d", m, s); returning the value like .0:11 ,What could be the problem? m=0, s=11 -->.0:11 m=0, s=1 --> .0:.1. The 0 added to format the string always coming as '.' (dot). Can anyone know ,from where the number patterns are getting loaded in Android? I gone thorough the code, Its related the following file, androiddalviklibcoreicusrcmainjavacomibmicu4jniutil Resources.java ->localeData.numberPattern. How the pattern for particular locale is loaded, What could be the problem for the above?
View 3 Replies
Jun 29, 2010
I am trying to convert string to date, and then I ma saving this date in a file , which saves in the following format:Mon Jun 21 16:31:24 Asia/Karachi 2010.and then when later I read this date from file as a String, I again want to save it to a Date,
View 2 Replies
View Related
Mar 8, 2010
I have the following string defined in strings.xml
<string name="InfoLong"><b>%1$s\%</b><br/>Tie:%2$s\%<br/>Win%3$s\%</ string>
and in my code ...
Can I embed a newline in a format string?
View 8 Replies
View Related
Dec 17, 2009
I have a string defined in my String.xml file that uses format arguments, i.e.: <string name="myString">Hello %1$s.</string> Is there a way to assign a value to the format argument in a layout xml file?
View 2 Replies
View Related
Sep 2, 2009
In the android phone, click "settings" and then goto "date & time settings" , user can choose "Use 24-hour format" or not. My question is how to find out this setting through api?
View 6 Replies
View Related
Jan 12, 2010
This maybe be a simple question but how do you format a double into a dollar format? For example I have a value of 4.2. In a textview I would like to see $4.20. Also what are my options for applying the correct currency symbol?
View 2 Replies
View Related
Apr 13, 2009
In my ListView, there's one line of code in my ViewBinder that causes lots of garbage collection as I scroll through the list, about every two seconds...
D/dalvikvm(16312): GC freed 13171 objects / 659576 bytes in 162ms D/dalvikvm(16312): GC freed 13122 objects / 654128 bytes in 129ms D/dalvikvm(16312): GC freed 13134 objects / 655416 bytes in 142ms D/dalvikvm(16312): GC freed 13129 objects / 654840 bytes in 129ms D/dalvikvm(16312): GC freed 13149 objects / 655000 bytes in 110ms D/dalvikvm(16312): GC freed 13150 objects / 655720 bytes in 127ms D/dalvikvm(16312): GC freed 13075 objects / 652256 bytes in 111ms D/dalvikvm(16312): GC freed 13232 objects / 659040 bytes in 136ms D/dalvikvm(16312): GC freed 13106 objects / 653920 bytes in 110ms D/dalvikvm(16312): GC freed 13155 objects / 655152 bytes in 110ms
The offending code is here, which formats a price for each item in the list: String price = cursor.getString(columnIndex); final float pricef = Float.parseFloat(price); price = new StringBuffer("$").append(String.format("%. 2f",pricef)).toString(); ((TextView)view).setText(price);
If I comment out the line with String.format, the garbage collection goes away. So what's the "right" way to do this to avoid allocations? That database field holds an unformatted text string which I'm trying to format into proper currency format (example: format "1.5" to "$1.50")
View 9 Replies
View Related
Jun 3, 2009
What format of picture will I get by using Picture.WriteToStream?
View 8 Replies
View Related
Nov 20, 2010
I have a date that has the format: "yyyy-MM-dd'T'HH:mm:ss'Z'" I'd like to convert it to something similar to:
"3 minutes ago" How can I go about doing this?
View 2 Replies
View Related
Jun 13, 2010
Been looking through all the readers & have yet to find one that supports this format.
View 1 Replies
View Related
Oct 20, 2010
My wifi's broken and I sense it'll be a while before I get it up and running again. Does anyone here know a good website from where I can download applications in the apk format? Coz then I can use the SDK to install them on my phone.
View 14 Replies
View Related
Jul 14, 2009
I am trying to add flash (flv) support to openCORE, i found some hints in this forum but still there are many things that unclear. I would like in the beginning to play local .flv file,from SDCARD, without streaming. As i understand i need to implement Parser within fileformats, "parser node" and "recognizer" and register it with player engine, and of cause add h.263 Sorenson codec. Can someone point me to the information on the data flow from the main Player Engine to the "parser node", what API is used,? How will "parser node" send the data to the Codec Engine? Which parts will i have to add to enable streaming later? I also looked inside the documentation within opencore but did not find relevant information, perhaps i missed something and someone can point me to where should i look.
View 2 Replies
View Related
Apr 10, 2009
Would be more useful than AMR / MP4. Also would be compatible with the very handy source code for RingDroid.
View 2 Replies
View Related
Sep 14, 2010
I it possible to Convert MP3 to EPUB format ?
View 7 Replies
View Related
Jan 22, 2010
Does such a thing exist please folks - want to rip some audio for an mp3 ringtone from a comedy video clip
View 4 Replies
View Related
Dec 27, 2009
Looking the doc with class SurfaceHolder is possible set the kind of surface format. I need to show images YCbCr_420_SP format. If I set YCbCr_420_SP format is not clear after how I can set the data. With Canvas object I can draw only bitmap format and not YCbCr_420_SP. Then my question is : can I draw directly on surface using YCbCr_420_SP data ? how ?
View 2 Replies
View Related
Sep 23, 2010
I am having a date/time value as 2010-07-26T11:37:52Z , now i wants date in 26-July-2010 (dd-mm-yyyy) format, how do i do it?
View 2 Replies
View Related
Nov 26, 2009
I am looking at the source code of a Camera Preview application and learning that the preview buffers coming from the sensor is in YUV422 format. However, this preview frame is showed on the display in RGB. Can someone please let me know where the pixel format conversion happens? Is it inside Surface Flinger? If yes, can you please point me to the code?
View 5 Replies
View Related
Jul 2, 2010
I want to add play gif format to my android app. Could this be done, and how would I do it?
View 2 Replies
View Related
Apr 5, 2010
Has anyone tried the app Wordplayer from the market? It's a pretty decent e-book reader with compatible (and pretty decent) TTS capabilities. Anyways, I was wondering if anyone could help me understand how to convert the ebooks and put them into a format that the TTS software could easily read from. As it is, the TTS starts reading my particular book at page 167 even though the .epub file appears complete if opened with any other software.
View 2 Replies
View Related
May 14, 2010
As you probably know, you can setup date format in the Settings of an Android device. In code how do we make sure that we use that format for date display?
View 1 Replies
View Related
Jun 22, 2010
I have developed a streaming app for Android. My app is streaming AAC audio.The app works fine on 1.5, 1.6, and 2.1. I tested it on Froyo, the android 2.2 and it does not work there.I have try everthing - Streaming directly from server url - Download incrementaly the content, store in a temp file, start reading. - Download incrementaly the content, store in a ContentProvider and start reading.No luck, I always got errors : 06-23 02:47:02.257: ERROR/MediaPlayer(266): Unable to to create media player 06-23 02:47:02.257: INFO/System.out(266): setDataSourceFD failed.: status=0x80000000 Does Froyo support AAC? Anyone happens to stream AAC?
View 4 Replies
View Related
May 2, 2009
Are any one aware of good place to download winhelp format of Android SDK.
The current SDK's docs and search capabilities are too limited.
I am aware of http://www.allimant.org/javadoc/index.php for javadoc format.. but Android sdk does not seem to follow normal javadoc format.. which format do they follow..
View 3 Replies
View Related
Mar 10, 2009
I want to save an animation that I wrote in android in gif format. I know how to take screenshot but is there any possibility to capture an anmation?
View 3 Replies
View Related
Feb 1, 2010
I want to know in which format the contact details are stored in android mobile or emulator.If any body knows the answer please help me.
View 2 Replies
View Related
Sep 27, 2010
In my layout.xml file, is it possible to set text with style?
e.g. this is bold This is default
Can I do that?
View 2 Replies
View Related
Jun 5, 2010
I am writing an app that needs to be able to open (be associated in the browser download window for example) with a certain file type. The file type has .emx extension and is in an xml format (the top of the files have <?xml version='1.0' encoding="UTF-8"?> ). However, I can't for the life of me get my app associated with this filetype.
View 5 Replies
View Related
Apr 6, 2010
Can any one tell me which is the image format used in android phones?
View 1 Replies
View Related
Aug 29, 2010
Call me a newbie, but does Android store any critical data on the SD card? Just did a factory reset on my Sprint Hero in preparation for giving the phone to a family member, & I'd like to give them the phone with a clean slate on the SD card as well as the phone. How Can I safely format SD card?
View 1 Replies
View Related
Aug 14, 2010
Is there a tool/library/class/function for format XML when displaying it in a TextView in Android? I need to present some XML snippets to users and was looking for a convenient way to achieve this, rather than having to parse and format it manually...
View 1 Replies
View Related