4

How do I create an in-memory sqlite db in Java (Android)? The sqlite docs only show how to do it in C.

I am using the android.database.sqlite package for my db code so I'd prefer to do it with that package, if possible.

Thanks in advance...

2 Answers 2

4

you can do it in the same way you'd create any database but instead of passing in a name pass in NULL

for example, in your OpenHelper you'd do something like:

OpenHelper(Context context) 
{
    super(context, null, null, DATABASE_VERSION);
}

more info on SQLiteOpenHelper here

Sign up to request clarification or add additional context in comments.

1 Comment

D'oh! I should have seen that. Thanks!
2

This is the offical reference, Good Luck!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.