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 - Raw files and reading them

Raw files and reading them

Put your problem here if it does not fit any of the other categories.

Raw files and reading them

Postby Scooby » Wed Feb 23, 2011 7:22 pm

Hi
I'm working on a simple puzzle game which stores the puzzle tiles into a text file. I have the file set up as a raw resource and can read it with inputStream, and I can output it in the log to check. However, it's storing the contents as there ascii code, so if I read "2", it outputs "50".
If I were using standard java, I could use readint, but a look on the official android developer site suggests nothing like this exists for android. I'm sure I must be missing something, as reading from a text file and converting to ints seems a fairly simple simple task.

Does anyone have any ideas please?

Thanks.

Code: Select all
//create list for tile types
         InputStream inputStream = getResources().openRawResource(R.raw.tiles);
         int i;
         try{
            i = inputStream.read();
            while(i != -1){
               i = inputStream.read();
               Log.i(TAG, "" + i);
            }
         }
         catch(IOException e){
               e.printStackTrace();
         }
Scooby
Freshman
Freshman
 
Posts: 2
Joined: Sun Feb 13, 2011 1:33 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 11 guests