Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:48:28+00:00 2026-06-10T05:48:28+00:00

There is a great Android library that I would like to reuse for a

  • 0

There is a great Android library that I would like to reuse for a desktop application.

The only Android-specific part in this library is the use of android.database.sqlite.

What is the best practice in such cases?

  • Replace all calls to use a portable pure-Java SQLite package like SQLJet instead?
  • Wrap some SQLite Java library in a android.database.sqlite and use the library without any modification?
  • Any other clever solution?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:48:29+00:00Added an answer on June 10, 2026 at 5:48 am

    First, This may be an overkill for your application.

    My suggestion is to abstract the database calls to an interface. So for all pieces of your library that requires SQLite, use the new interface, and implement a ‘SQLite Database Provider’ that ‘extends’ the interface, which calls the SQLite methods.

    What I’m suggesting is to use ‘Dependency Injection’ to inject the database parts to your library.

    So when you’re using the library in a desktop app, you can simply inject a different implementation of the interface (MySql Provider ?) and and you’re ready to go.

    This will also allow you to inject any other database providers at any time you like, without changing the core library code again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I use mysql and phpMyAdmin, I was wondering if there is as great
WiX is great in that there is no GUI, you just write the installer
I know a great thing about perl is that there's multiple ways of doing
There's so much power in this little beast it seems a great fit for
Is there any possibility to use old Ada code in Android? I have an
I'm using db4o in a small project that works great on Android 2.2, 2.3,
I am surprised that there is no Android Hidden Features post yet in the
I have an Android application that has a need to perform work in the
I am writing an Android project that needs to use the Apache HttpClient from
I'm developing an app for Android 2.2 and higher. I use the great ActionBarSherlock

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.