On Tue, Dec 13, 2011 at 6:16 PM, Raghav Sood <[email protected]> wrote: > > this.level9 = new int[][] { { 0, 0, 0, 0, 0, 0, 0, 0 }, > { 1, 1, 1, 1, 1, 1, 1, 1 }, > { 0, 0, 1, 0, 0, 1, 0, 0 }, > { 0, 1, 0, 0, 0, 0, 1, 0 }, > { 1, 1, 1, 1, 1, 1, 1, 1 }, > { 0, 0, 1, 0, 0, 1, 0, 0 }, > { 0, 1, 0, 0, 0, 0, 1, 0 }, > { 1, 1, 1, 1, 1, 1, 1, 1 }, > { 0, 0, 0, 0, 0, 0, 0, 0 }, }; > > The first 8 values are always 0. > > 2) How do I store this array?
It doesn't matter where you save it, you have to serialize it (convert to a string/byte array) first. You could use Java (binary) serialization, or a text-based format such as JSON or XML (really?). But, since it's just a bunch of one and zeros, you can just compress it to 9 bytes (one row -> one byte). Then, for example, Base64 encode to save as string. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

