I’m working on a school project which is to create an GPS for an android platform. I’m working in Java.
All the information regarding addresses is saved in text files looking like this
“139284664 Björlandavägen 26493483 57.7278007 11.9353406”.
ID number, name, ref number, latitude, longitude.
The problem I’m having is that I don’t know what to save this into in my program. I started out with array lists but then I get Java heap space problems so I moved on to using HashMaps, but then I got the problem that some of the “names” will be the same AND when searching for an address I want to be able to use some sort of .contain and not .equals. Another requirement we have is that the application has to be offline with only a GPS signal, no internet connection.
Is there any kind of list, map or anything I can use to bypass these problems?
Really, you want to be using a database. It’s a bit more complicated than using a container class, but gives much more flexibility (and it’s stored persistently, so the data is still there next time you start the app).