[android-developers] Re: Writing files in UTF-8

2012-03-30 Thread Remote Red
Looping? byte[] bom = {(byte)0xEF, (byte)0xBB, (byte)0xBF }; byte[] byteResult = Charset.forName("UTF-8").encode(result.toString()).array(); fos = new FileOutputStream(file); fos.write(bom); fos.write(byteResult); Doesn't this work? -- You received this message because you

[android-developers] Re: Writing files in UTF-8

2012-03-30 Thread Remote Red
> .put(0, (byte) 0xEF) > .put(1, (byte) 0xBB) > .put(2, (byte) 0xBF) > However when the file is created and I open it with either notepad++ or > excel the first characters are  not show, the file always starts with * > artdate"* . > > Any idea how to work around this? You are using put(). Those t

[android-developers] Re: Writing files in UTF-8

2012-03-30 Thread Remote Red
> But the question marks in the in the file i attached are because google > groups did not get it right the document... Locally it works and I can send > it through mail without issues. Sorry but I find it hard to believe that when Google offers us a platform to discuss development and offers the

[android-developers] Re: Writing files in UTF-8

2012-03-29 Thread Remote Red
> I've added "out.write('\ufeff');" to write the Byte Order Mark That is not the bom for utf-8. You wrote the bom for UTF-16. http://en.wikipedia.org/wiki/Byte_order_mark The bom for utf-8 is 0xEF, 0xBB, 0xBF. > ... and you can > see in the attachment the export now works fine! :) Those attach

[android-developers] Re: Writing files in UTF-8

2012-03-29 Thread Remote Red
Just a thougth: does the produced file have a BOM (Byte Order Mark) as the first bytes? If not you have to write them yourself. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googleg

[android-developers] Re: Writing files in UTF-8

2012-03-29 Thread Remote Red
On 29 mrt, 13:03, Dirk Vranckaert wrote: > > Why are you using FileOutputStream AND OutputStreamWriter AND > > BufferedWriter? > > I need the OutputStreamWriter to specify the encoding, Ok. But then why also a BufferedWriter? > The result is a CSV file, Sorry but you did not understand my que

[android-developers] Re: Writing files in UTF-8

2012-03-29 Thread Remote Red
>     out = new BufferedWriter(new OutputStreamWriter( > new FileOutputStream(file), "UTF-8" >     )); Why are you using FileOutputStream AND OutputStreamWriter AND BufferedWriter? >     out.write(result.toString()); What is the type of result? How did you put content in it? You are not chec

[android-developers] Re: Tablet Acer Iconica A100 and Environment.getExternalStorageDirectory();

2012-03-13 Thread Remote Red
On 13 mrt, 12:24, Mark Murphy wrote: > The firmware may have rights that SDK applications do not. As I'm quite new to Android programming I had not even tested this. Fear enclosed my mood. Luckily my app can write to the microSD card. Now I don't have to throw it out the window! ;-). -- You

[android-developers] Re: Tablet Acer Iconica A100 and Environment.getExternalStorageDirectory();

2012-03-13 Thread Remote Red
On 12 mrt, 15:06, Mark Murphy wrote: > Bear in mind that your app may not have rights to write to this mount point. That would be realy silly as it is my tablet and my sdcard. What else would I do with a sdcard like reading and writing? -- You received this message because you are subscribed t

[android-developers] Re: Tablet Acer Iconica A100 and Environment.getExternalStorageDirectory();

2012-03-13 Thread Remote Red
On 12 mrt, 15:06, Mark Murphy wrote: > Correct, but that is the portion of on-board flash that Acer > designated as external storage. Very strange that this is possible. My understanding of external was/ is that that would be the sdCard. But maybe b0b points out how I have to see it. All thanks

[android-developers] Tablet Acer Iconica A100 and Environment.getExternalStorageDirectory();

2012-03-12 Thread Remote Red
The tablet Acer Iconica A100 returns for Environment.getExternalStorageDirectory() /mnt/sdcard Actually that is intern memory as the microSD card is mounted as /mnt/external_sd I would like my app to find the microSD card. What are my options? -- You received this message because you are sub

[android-developers] Re: HOw to extract only number

2012-03-06 Thread Remote Red
str=txt.getText().toString(); int space1=str.indexOf(" "); if ( space1 > 0 ) s=str.substring(0, space1); else s= str; -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-d

[android-developers] Re: How to format a String in an email so Outlook will print the line breaks?

2012-03-06 Thread Remote Red
So if you read that mail with a real mail reader -like Thunderbird- all is ok? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send ema

[android-developers] Re: Android how to send the hex code out?

2012-03-06 Thread Remote Red
0xfa? If you tell me how you send out the f and the a then I tell you how to do that with the 0 and the x. ;-). -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To uns

[android-developers] Re: How to format a String in an email so Outlook will print the line breaks?

2012-03-06 Thread Remote Red
Did you try \r\n already? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com

[android-developers] Re: HTTP POST to Web Server running on Android Device

2012-03-04 Thread Remote Red
> line=POST / HTTP/1.1 > line=Content-Length: 23 No you would see: line=POST / HTTP/1.1 line=Content-Length: 23 line=0 if a null was returned. But a null is never returned. Still your loop ends as instead an exception is trown. You did not see that because the catch does nothing. Add a Log.i

[android-developers] Re: HTTP POST to Web Server running on Android Device

2012-03-04 Thread Remote Red
> line=POST / HTTP/1.1 > line=Content-Length: 23 No, you would see: line=POST / HTTP/1.1 line=Content-Length: 23 line=0 if a null was returned. But a null is never returned. Still your loop ends as instead an exception is trown which you did not see because the catch statement is empty. Add a Lo

[android-developers] Re: HTTP POST to Web Server running on Android Device

2012-03-04 Thread Remote Red
> line=POST / HTTP/1.1 > line=Content-Length: 23 No, you would see: line=POST / HTTP/1.1 line=Content-Length: 23 line=0 if a null was returned. But a null is never returned. Still your loop ends as instead an exception is trown which you did not see because the catch statement is empty. Add a Lo