Reading a text file or XML file in Android java -


I am currently working on a group project to create an Android game. I have been assigned a PC-based level editor (everything that has been done).

Whatever I have to do now decides on the file format for the format that is output. At present, it is a standard text file with different numbers representing different tiles; EG 0 = Path 1 = Wall 2 = Enemy

  1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1  

In the actual Android game Takes the file and stores the values ​​in 2D arrays. Although making actual games, who are having difficulty opening a text file, and others have told me that it must be using the XML file. I have now been asked to find a distant to take this input.

Can someone tell me how I will read the text file and the value int array [] [] ? Or if it is easy, then use an XML file and tell me how to format that file and the value int sir [] []

Any help would be appreciated because I did not know how to use Android, so I find it very difficult.

Many thanks /

I will choose between these two options: check first.

Add the file to / race / raw and read it from there.

You have an example code that can be read by

Serialized structure

You can serial all the int array [] [] and it will be / res / Raw.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -