Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Reading static file data into a String

Reading static file data into a String

Quickly share your Android Code Snippets here...

Reading static file data into a String

Postby dkny » Sun Jan 18, 2009 8:51 pm

I read the tutorial thread on this subject but I didn't see reference to the raw folder which seems to be a key. At least for what i was trying to do. Here's what's working at the moment.

//First import the file into a (new) "raw" folder. That will get it into the R.java file
Resources r = this.getResources();
InputStream is = r.openRawResource(R.raw.[resource_identifier]);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String readString = br.readLine();
tv.setText(readString); //tv is TextView

There may be some importing necessary but nothing out of the ordinary.

dkny
dkny
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jan 18, 2009 8:31 pm

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 6 guests