Mark Wyszomierski wrote:
> Yeah that definition is perfect, having a little trouble implementing
> it though.
> 
> I'm just trying to use:
> 
>   File file = getFilesDir();
> 
> this points to:
> 
>   /data/data/com.foo.bar/files
> 
> which is empty though, nothing gets written there during my app's
> lifetime. My app's directory structure looks like this:
> 
>   com/foo.bar
>     /cache
>     /databases
>        webviewstuff.db
>     /files
>     /lib
>     /shared_prefs
>        com.foo.bar_preferences.xml
> 
> should I be seeing databases/preferences? Or am I supposed to be
> looking for the existence of /shared_prefs/
> com.foo.bar_preferences.xml. If so, is there a proper way to resolve
> that path other than kind of hard-coding it into my app?

If you have shared preferences, then you can do this:

Step #1: Get your shared preferences (hopefully
PreferenceManager.getDefaultSharedPreferences())

Step #2: Look for the "hey! I've been run before" preference

Step #2a: If that preference is not found, it's your first run, so set
that preference (and commit() the change) and do your first-run logic

Step #2b: If that preference is found, you've been run before,
so...ummm...carry on, or whatever

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to