Android: Best practice for dealing with large arrays

I have over 150 sounds in my raw folder and it has become quite tedious trying deal with them. I have a soundboard that dynamically takes all the sounds in my int file[] array and matches it with the title in the string soundnames[] array. These arrays are then translated to a custom button adapter for a gridview. The arrays are in alphabetical order (done manually) to have some form. The problem is that when I have to go to add new sounds I have to very carefully find where it falls in the current array and match it perfectly so the string names and files match correctly. Since the two arrays have to match up that means I have 300+ items I have to keep track of and has become overwhelming. Is there a way to that I could add new songs to the end of these arrays but have them alphabetically sorted so they would match up still while still having order to the array.

Is there an easier or more efficient way of dealing with large mutually exclusive (not sure if that is the right word) arrays? Also I have some sound files that have a generic name i.e. sound 1.. sound N which I would like to keep at the end of the array would that be possible as well?


Put the data in an sqlite database and use cursors. SQL allows sorting and is very fast at it.

You can use collection classes

you can use

  • List
  • HasMap

As per your requirement you want sorted data.

use SortedMap

Need Your Help

Logon identified — any backend storage of this number?

c# session session-cookies

When you log on to an ASP.NET app you are issued with a logon cookie (I think it's called ASPX_AUTH or similar). What is the structure of this cookie? Does the server actually maintain any logon st...

JavaScript regexp - is there any alpha in string

javascript regex

I just need to check if there any alpha in coming string.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.