Changes

Jump to navigation Jump to search
72 bytes removed ,  18:39, 1 December 2023
m
Text replacement - "syntaxhighlight" to "pre"
The following source code shows a minimal example for a BaseX class.
<syntaxhighlight pre lang="java">
public class BaseXDatabase {
private Context basexContext = null;
This class can be called in every Android application which uses the BaseX library with the following call, for example:
<syntaxhighlight pre lang="java">
BaseXDatabase baseXDatabase = new BaseXDatabase(getApplicationInfo().dataDir);
</pre>
The following code shows the changes inside the Context.java file:
<syntaxhighlight pre lang="java">
public Context(String data_dir) {
this(true, (Prop.HOME = data_dir + "/"), (Prop.USERHOME = data_dir + "/"));
The following lines need to be removed:
<syntaxhighlight pre lang="java">
/** XQuery function. */
_CRYPTO_HMAC(FNCrypto.class, "hmac(message,key,algorithm[,encoding])",
An example of this can be seen in the following code:
<syntaxhighlight pre lang="java">
public String executeXQuery(String query) throws IOException {
if(basexContext != null)
Using Gradle, the Android build system, it can be done by adding the following line to the gradle build file. This tells the build system that every library, inside the libs folder, is being compiled into the projects file.
<syntaxhighlight pre lang="java">
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
</pre>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu