Android NDK allows you to use native (c/c++) code in your Android application. So, you would need to convert your code to c or c++.
The Android database is typically SQLite, so you would need a c/c++ interface for interacting with it. The docs don't talk about giving you that..
From the docs:
Typical good candidates for the NDK
are self-contained, CPU-intensive
operations that don't allocate much
memory, such as signal processing,
physics simulation, and so on. Simply
re-coding a method to run in C usually
does not result in a large performance
increase. The NDK can, however, can be
an effective way to reuse a large
corpus of existing C/C++ code.
If your algorithm is cpu intensive, doesn't allocate much memory, and could be optimized in c/c++ it might be worth a shot..