[android-developers] Finding a Point-Of-Interest

2010-02-03 Thread Shahin
Hi
I have not been able to find a straight-forward mechanism to do this.
I want a way to get a list of places given the description (e.g.
starbucks or gas station). The following code works if the
description is unique such as SFO, but for places where the
description is more general, like gas station the return list is
empty:

Geocoder geo = new Geocoder(getApplicationContext());
ListAddress addrs = geo.getFromLocationName(SFO, 5);

Can you tell me a better way to get this to work?
Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] SharedPreferences can not create the xml file

2010-02-01 Thread Shahin
Hi
I have been trying to fix this problem for 3 days now and still no
luck. I am trying to save some preferences of my app (just a few
integers and strings), but I notice that SharedPreferences never
creates any xml file. So far I have tried the followings:
1) In my AndroidManifest, I set Persistent to true.
2) To be more cautious, my preference file is all lower case, even
though I did not think it was necessary.
3) Interestingly enough edit().commit() returns true, but I do not see
the xml file anywhere in my computer. And when I try to read the
values from the preferences, I get the default values that I have in
my getInt() or getString().
4) I ran my app in the debugger and I saw no errors in the log related
to this.
5) I tried running it in 2 different emulator running Android 1.5 and
2.0, same result.

Here is a gist of my code:
SharePreferences x = this.getSharedPreferences
(Configuration.PREFFILE, Context.MODE_PRIVATE);
int level = x.getInt(LEVEL, 1);
..
x.edit().putInt(LEVEL, level);
if ( !x.edit().commit() )
Log.e(Configuration.TAG, setLevel failed to commit);

I can not think of any reason that causes this. Any help is greatly
appreciated.
Thanks



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en