[OSM-dev] implemented API for J2SE and J2ME

Michael Willigens michael at willigens.de
Mon Apr 20 22:55:59 BST 2009


Well,

Concurrency: yes, it can use the calling thread OR it can instantiate  
new thread that
will return the result when available to an callback interface. So  
anything is thread
save here.

Memory: Havent tested yet, because i think that parsing small XML  
files is also possible
on J2ME. "Could" be improved by implementing a Sax parser in J2ME. I  
have thought about
that but i think its kinda overpowered.

Query Handling: On J2ME it will use the "HTTPConnection" class to get  
an InputStream for
the XML parser. On J2SE it will use default URL.openInputStream().

API itself:
Some static reachable methods like:
NameFinder.searchAsync(String query, int maxResults, NameFinderCallback c)
NameFinder.search(String query, int maxResults)
will return an array of NameFinderResult Object which basically carry  
any data we have on
NameFinder: type, category, name, info, description, nested results...

Michael

Quoting Grant Slater <openstreetmap at firefishy.com>:

> Sounds interesting.
>
> Tell us more. Memory Requirements, Concurrency, Query handling, API? etc.
>
> / Grant
>
> Michael Willigens wrote:
>> Hi osm devlist,
>>
>> I just wanted to tell you that i implemented a NameFinder API in   
>> Java  because i didnt find anything useful. It will run on both,   
>> J2SE and  ME. Anyone intereseted in this? Shall I contribute it in   
>> SVN, and  whats the email address of David-Earl ?
>>
>> regards,
>> Michael Willigens
>>
>> _______________________________________________
>> dev mailing list
>> dev at openstreetmap.org
>> http://lists.openstreetmap.org/listinfo/dev
>>






More information about the dev mailing list