Changes

Jump to navigation Jump to search
1,792 bytes added ,  12:38, 10 April 2014
no edit summary
As shown in the adjustment above, it is necessary to set the two variables 'Prop.HOME' and Prop.USERHOME' during the constructor call. In the BaseX code those variables are final, which need also be changed in order to set them during the call.<br>
The reason for this change is that the in BaseX used System.getProperty(user.dir) returns an empty string in Android[http://developer.android.com/reference/java/lang/System.html#getProperty(java.lang.String)].
 
----
The next adjustment, which needs to be done, is to remove not supported packages inside the BaseX code.
Therefore the package 'org.basex.query.util.crypto' need to be removed, because it uses external packages which are not supported by Android.
The class which uses these files can be found inside the FNCrypto.java file in the 'query.func' package. This file needs to be deleted as well as its usage inside the Function.java file, which can also be found inside the 'query.func' package.
The following lines need to be removed:
<pre class="brush:java">
/** XQuery function. */
_CRYPTO_HMAC(FNCrypto.class, "hmac(message,key,algorithm[,encoding])",
arg(STR, STR, STR, STR_ZO), STR),
/** XQuery function. */
_CRYPTO_ENCRYPT(FNCrypto.class, "encrypt(input,encryption,key,algorithm)",
arg(STR, STR, STR, STR), STR),
/** XQuery function. */
_CRYPTO_DECRYPT(FNCrypto.class, "decrypt(input,type,key,algorithm)",
arg(STR, STR, STR, STR), STR),
/** XQuery function. */
_CRYPTO_GENERATE_SIGNATURE(FNCrypto.class, "generate-signature" +
"(input,canonicalization,digest,signature,prefix,type[,item1][,item2])",
arg(NOD, STR, STR, STR, STR, STR, ITEM_ZO, ITEM_ZO), NOD),
/** XQuery function. */
_CRYPTO_VALIDATE_SIGNATURE(FNCrypto.class, "validate-signature(node)", arg(NOD), BLN),
 
URIS.put(FNCrypto.class, CRYPTOURI);
</pre>
The result of this adjustment is, that it is now possible to use BaseX as an Android library, with the lack of support of the following XQuery functions:<br>
*hmac(string,string,string[,string])
*encrypt(string,string,string,string)
*decrypt(string,string,string,string)
*generate-signature(node,string,string,string,string,string[,item][,item])
*validate-signature(node)
 
----
 
== Using the BaseX Android Library ==
administrator, editor
10

edits

Navigation menu