db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

What is the alternative method of Context.getDataDir() ?

Last post 05-29-2008, 12:55 AM by suin. 2 replies.
Sort Posts: Previous Next
  •  05-27-2008, 03:56 PM 49324

    What is the alternative method of Context.getDataDir() ?

    Hi all !

    Context.getDataDir() was removed in android sdk m5-rc15.

    What is the alternative method of Context.getDataDir() for creating or opening db file ?

     

    private String db4oDBFullPath(Context ctx) {

          return ctx.getDataDir() + "/" + "browsemap.db4o";

    }

  •  05-28-2008, 02:24 AM 49332 in reply to 49324

    Re: What is the alternative method of Context.getDataDir() ?

    You can use  "public abstract File getDir(String name, int mode)" to replace getDataDir()

    For example,  ctx.getDir("databases", Context.MODE_PRIVATE)

    For more information about the API changes between m3 and m5, you can have a look at

    http://code.google.com/android/migrating/m3-to-m5/changes.html

  •  05-29-2008, 12:55 AM 49359 in reply to 49332

    Re: What is the alternative method of Context.getDataDir() ?

    Dear Firstfan

    I appreciate your help.

    Your reply helped me a lot.

    Thanks.

View as RSS news feed in XML