To develop a mobile application, requests to mobile platform server use Android framework methods of the HyperHive main class.
NOTE. Before executing the methods execute authentication on mobile platform server using the auth or authWithChangePassword authentication method.
Authentication methods are implemented in the AuthAPI unit, which instance is available in the HyperHive (hyperHive.authAPI) class.
Authenticate user by login and password (auth)
The auth method authenticates the user by login and password.
NOTE. Before executing the method make sure that data source credentials are added in the project.
hyperHive.authAPI.auth(login, password, updateResources)
Input parameters:
Parameter | Data type | Description |
login | java.lang.String | User login. |
password | java.lang.String | User password. |
updateResources | boolean | Update resources scheme on successful authentication. The parameter takes the values:
|
Example:
private static final String userName = "user";
private static final String password = "password";
public void authentication() {
boolean status = hyperHive.authAPI.auth(userName, password, true).execute().isOk();
showStatus(status);
}
After executing the example a user token and authentication result are obtained.
User authentication with password change (authWithChangePassword)
The authWithChangePassword method authenticates the user with password change and returns a new user token.
HyperHive.AuthAPI.authWithChangePassword(login, password, new_password, confirm_password, update_resources, headers)
Input parameters:
Parameter | Data type | Description |
login | String | User login. |
password | String | Current user password. |
new_password | String | New user password. |
confirm_password | String | Confirm new user password. |
update_resources | Boolean | Update resources schema by request result. |
headers | Map<String, String> | Additional http parameters. |
Example:
private static final String LOGIN = "name";
private static final String PASSWORD = "123";
private void authWithChangePassword() {
Log.d(TAG, "authWithChangePassword()");
final string new_password = "123123";
BaseStatus status = hyperHive.authAPI.authWithChangePassword(
login,
password,
new_password,
confirm_password,
true,
null
).execute();
}
After executing the example a user token and authentication result are obtained.
Cancel authentication (unAuth)
The unAuth method cancels executed user authentication and returns instance of the Call class.
hyperHive.authAPI.unAuth()
Check user authentication (isAuthorized)
The isAuthorized method checks user authentication execution and returns the value:
True. The user is successfully authenticated.
False. The user is not authenticated.
hyperHive.authAPI.isAuthorized()
The use of methods is given in the Examples of Authentication on Mobile Platform Server examples.
Mobile platform server accessibility check (connectionStatus)
The connectionStatus method checks mobile platform server accessibility.
Available method use options:
Call<BaseStatus> HyperHive.connectionStatus(String url)
The method returns <BaseStatus> with request and response data from mobile platform server.
Call<T extends BaseStatus> HyperHive.connectionStatus(String url, Class<T> gson)
The method returns <T extends BaseStatus> with request and response data from mobile platform server as deserialized gson.
Example of request:
BaseStatus status = HyperHive.connectionStatus("http://<IP address or DNS server name>");
Call<BaseStatus> hh.requestAPI.connectionStatus()
The method returns <BaseStatus> with request and response data from mobile platform server.
Call<T extends BaseStatus> hh.requestAPI.connectionStatus(Class<T> gson)
The method returns <T extends BaseStatus> with request and response data from mobile platform server as deserialized gson.
Example of request:
BaseStatus status = hyperHive.requestApi.connectionStatus().execute();
The method can be used in the RequestAPI unit, which instance is available in the HyperHive (hyperHive.requestAPI) class. A mobile platform server URL is determined on creating the HyperHive object.
The method use is given in the Example of Mobile Platform Server Accessibility Check example.
Methods of this area are implemented in the DatabaseAPI unit, which is available in the HyperHive (hyperHive.databaseAPI) class.
Open default database (openDefaultBase)
The openDefaultBase method opens a default database.
public boolean openDefaultBase(java.lang.String key);
Arguments:
key. Database key.
The method returns True if the default database is successfully opened, otherwise the method returns False.
Example of request:
openDefaultBase("12345");
Change database encryption key (reKeyBase)
The reKeyBase method changes local database encryption key.
Syntax:
fun reKeyBase(db_path: String, new_key: String): Boolean
public boolean reKeyBase(final String db_path, final String new_key)
Input parameters:
Parameter | Data type | Description |
db_path | String | The path to the database in the mobile application directory. |
new_key | String | New database encryption key. |
Example:
val hyperHive = this.getHyperHive()
hyperHive.databaseAPI.reKeyBase("/path/to/database.sqlite", "123")
HyperHive hyperHive = this.getHyperHive();
hyperHive.databaseAPI.reKeyBase("/path/to/database.sqlite", "123");
NOTE. Before changing encryption key open database using the openBase method.
Open or create a database (openBase)
The openBase method opens or creates a database with the specified key.
public boolean openBase(java.lang.String pathBase, java.lang.String key);
Arguments:
pathBase. Path to database.
key. Database key.
If the database has not yet been created, a new database is created and opened for work with the use of the specified encryption key.
Of the database already exists,an attempt to open database with the specified key is executed.
The method returns True if the database is successfully opened or created, otherwise the method returns False.
Example of request:
openBase("my_database", "12345");
Load resources scheme (resources)
The method is used to get a scheme of available resources and automatically create corresponding tables in the database. The method returns an instance of the Call class. The method must be executed after successful authentication.
If the used database must be encrypted, open the database with encryption key before calling this method:
resources(final String database, final Map<String, String> headers)
The "query" method executes SQL query to the specified database.
The method can be used in several ways:
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
query(@NonNull java.lang.String query);
Arguments:
query. SQLite query to the specified database.
The method returns an instance of the Call class with result in the string.
Example of request:
query("SELECT * FROM my_table);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
query(@NonNull java.lang.String query, java.lang.Class<T> tClass);
Arguments:
query. SQLite query to the specified database.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
query("SELECT * FROM my_table, MyClass.class);
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
query(@NonNull java.lang.String databasePath,
@NonNull java.lang.String query);
Arguments:
databasePath. Path to database.
query. SQLite query to the specified database.
The method returns an instance of the Call class with result in the string.
Example of request:
query("my_database", "SELECT * FROM my_table);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
query(@NonNull java.lang.String databasePath,
@NonNull java.lang.String query, java.lang.Class<T> tClass);
Arguments:
databasePath. Path to database.
query. SQLite query to the specified database.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
query("my_database", "SELECT * FROM my_table, MyClass.class);
Get table name (getTablesName)
The getTablesName method returns table name.
The method can be used in several ways:
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
getTablesName(@NonNull java.lang.String resourceName,
@NonNull java.lang.String params);
Arguments:
resourceName. Path to database.
params. Sent parameters.
The method returns an instance of the Call class with result in the string.
Example of request:
getTablesName("postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}");
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
getTablesName(@NonNull java.lang.String resourceName,
@NonNull java.lang.String params, java.lang.Class<T> tClass);
Class type <T>.
Arguments:
resourceName. Path to database.
params. Sent parameters.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
getTablesName("postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}", BaseStatus.class);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
getTablesName(@NonNull java.lang.String databasePath,
@NonNull java.lang.String resourceName,
@NonNull java.lang.String params);
Arguments:
databasePath. Path to database.
resourceName. Resource name.
params. Sent parameters.
The method returns an instance of the Call class with result in the string.
Example of request:
getTablesName("my_database", "postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}");
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
getTablesName(@NonNull java.lang.String databasePath,
@NonNull java.lang.String resourceName,
@NonNull java.lang.String params, java.lang.Class<T> tClass);
Class type <T>.
Arguments:
databasePath. Path to database.
resourceName. Resource name.
params. Sent parameters.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
getTablesName("my_database", "postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}", BaseStatus.class);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Delete tables from database (dropCache)
The dropCache method deletes tables from database.
The method can be used in several ways:
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
dropCache(@NonNull java.lang.String resourceName,
@NonNull java.lang.String params);
Arguments:
resourceName. Resource name.
params. Sent parameters.
The method returns an instance of the Call class with result in the string.
Example of request:
dropCache("postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}");
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
dropCache(@NonNull java.lang.String resourceName,
@NonNull java.lang.String params, java.lang.Class<T> tClass);
Class type <T>.
Arguments:
resourceName. Resource name.
params. Sent parameters.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
dropCache("postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}", BaseStatus.class);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public com.mobrun.plugin.api.Call<java.lang.String>
dropCache(@NonNull java.lang.String databasePath,
@NonNull java.lang.String resourceName,
@NonNull java.lang.String params);
Arguments:
databasePath. Path to database.
resourceName. Resource name.
params. Sent parameters.
The method returns an instance of the Call class with result in the string.
Example of request:
dropCache("my_database", "postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}");
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Query:
public <T extends com.mobrun.plugin.models.BaseStatus>
com.mobrun.plugin.api.Call<T>
dropCache(@NonNull java.lang.String databasePath,
@NonNull java.lang.String resourceName,
@NonNull java.lang.String params, java.lang.Class<T> tClass);
Class type <T>.
Arguments:
databasePath. Path to database.
resourceName. Resource name.
params. Sent parameters.
tClass. Expected class for parsing.
The method returns an instance of the Call class with result in BaseStatus.
Example of request:
dropCache("my_database", "postgres_fruits", "{\"upsert_rows\": [[\"10001\", \"fruits10001\"]], \"delete_ids\": null}", BaseStatus.class);
Response:
BaseStatusV08{status=OK, httpStatus=HttpStatus{status=200, ... }
Close default database (closeDefaultBase)
The closeDefaultBase method closes default database.
public boolean closeDefaultBase();
The method returns True if the default database is successfully closed, otherwise the method returns False.
The closeBase method closes database.
public boolean closeBase(java.lang.String pathBase);
Arguments:
pathBase. Path to database.
The method returns True if the database is successfully closed, otherwise the method returns False.
Example of request:
closeBase("my_database");
The use of methods is given in the Examples of Working with Resources section.
Methods of this area are implemented in the RequestAPI unit, which instance is available in the HyperHive (hyperHive.requestAPI) class.
NOTE. If resource structure is changed in the data source, recreate it in the mobile platform administration panel, and recreate cache in the mobile framework. Otherwise the resource with the old structure is returned.
Add request parameters (setArgs)
The setArgs method adds request parameters.
public void setArgs(java.util.Map<java.lang.String,java.lang.String> args);
Arguments:
args. It accepts Map with key-value parameters.
Example:
Arguments:
HashMap hashMap = new HashMap<>();
hashMap.put("hh_limit", "5");
Request:
http://10.30.300.30/...?...&hh_limit=5&...
Request to resource without loading to database (request)
The method is used to execute an uniform resource request with custom parameters. Available parameters are specified in the RequestCallParams class. The method returns an instance of the Call class.
request(@NonNull final String resourceName, final RequestCallParams requestCallParams, final Class<T> tClass)
The method is used to execute WEB resource request with custom parameters. Available parameters are specified in the WebCallParams class. The method returns an instance of the Call class.
The method must be called if there is a scheme of available resources obtained by the Resources method after successful authentication.
web(@NonNull final String resourceName, WebCallParams webCallParams, final Class<T> tClass)
Load delta to database (deltaStream)
The method is used to refresh and actualize resource using delta-stream in a local database. Available parameters are specified in the DeltaStreamCallParams class. The method returns an instance of the Call class.
The method must be called if there is a scheme of available resources obtained by the Resources method after successful authentication.
deltaStream(String resource, DeltaStreamCallParams deltaStreamCallParams, Class<T> tClass)
Load table data to database (tableStream)
The method is used to refresh and atualize non-cached resource using delta-stream in a local database. Available parameters are specified in the DeltaStreamCallParams class. The method returns an instance of the Call class.
The method must be called if there is a scheme of available resources obtained by the Resources method after successful authentication.
tableStream(String resource, TableStreamCallParams deltaStreamCallParams, Class<T> tClass)
Get resource table data without loading to database (table)
The method is used to get resource table data. Available parameters are specified in the TableCallParams class. The method returns an instance of the Call class.
table(String resource, TableCallParams tableCallParams, Class<T> tClass)
To get data from cached data source, it is available to limit the set of returned data by conditions passed in arguments.
Arguments for sample can be set in tableCallParams using the setArgs(Map<String, String> args) method.
Pagination arguments:
hh_order. It sets name of the column to order rows and sorting order. Examples: {hh_order, name+asc}, {hh_order, name+desc}.
hh_skip. It sets the number of table rows that must be skipped on generating response.
hh_limit. It sets the number of table rows that must be returned in response.
The filtering argument by the col_id=value value, that is, the argument is named col_<column_name>. For example: col_id=123, returns only the data where the id column has the 123 value.
Set global error handler (setRequestErrorListener)
The method sets RequestErrorListener to trap handling or any errors occurring on executing requests in RequestAPI. To unsubscribe, execute the setRequestErrorListener(null) method:
void setRequestErrorListener(RequestErrorListener requestErrorListener)
Resume resource downloading (setUseDownload)
The setUseDownload method determines resuming of resource downloading.
Syntax:
hyperHive.filesApi.setUseDownload(state)
hyperHive.filesApi.setUseDownload(state);
Input parameter:
Parameter | Data type | Description |
state | Boolean | Determine resuming of resource downloading. Available values:
|
The method is used on failed attempt to download resource to resume resource downloading with saving the state at the moment of interruption. If resource downloading has failed or mobile platform server connection is lost, the mobile application keeps requesting resource.
To resume resource downloading, use the retryCount and retryIntervalSec properties of the RequestCallParams, TableCallParams, DeltaStreamCallParams auxiliary classes on executing methods for working with the deltaStream, tableStream, table resources.
Order of using resuming of resource downloading:
Specify the path to the folder with files of the current resource downloading state using the setDownloadPath method after initializing Android framework in the mobile application directory.
Enable resuming of resource downloading. To enable resuming of resource downloading, use the setUseDownload method with the True value.
Execute necessary methods for working with resources.
Disable resuming of resource downloading. To disable resuming of resource downloading, use the setUseDownload method with the False value.
Example:
// Specify the path to store temporary files
hyperHive.requestAPI.setDownloadPath(getCacheDir().getAbsolutePath() + "/tmp");
hyperHive.requestAPI.setUseDownload(true);
// Perform the TableStream request
val params = TableStreamCallParams()
params.dataBasePath = "/path/to/database"
params.retryCount = 10
params.retryIntervalSec = 1
hyperHive.requestAPI.tableStream("resource", params)
// Specify the path to store temporary files
hyperHive.requestAPI.setDownloadPath(getCacheDir().getAbsolutePath() + "/tmp");
hyperHive.requestAPI.setUseDownload(true);
// Perform the TableStream request
final TableStreamCallParams params = new TableStreamCallParams();
params.setDataBasePath("/path/to/database");
params.setRetryCount(10);
params.setRetryIntervalSec(1);
hyperHive.requestAPI.tableStream("resource", params);
Set the path to the folder with files of the current resource downloading state (setDownloadPath)
The setDownloadPath method sets the path to the folder in the mobile application directory, which will store files of the current resource downloading state.
Syntax:
hyperHive.filesApi.setDownloadPath(path)
hyperHive.filesApi.setDownloadPath(path);
Input parameter:
Parameter | Data type | Description |
path | String | The path to the folder in the mobile application directory, which will store file of the current resource downloading state. The path to the Documents folder is set by default. |
The method use is given in the example for the setUseDownload method.
The use of methods is given in the Examples of Working with Resources section.
Methods of this area are implemented in the PushAPI unit, which is available in the HyperHive (hyperHive.pushAPI) class.
Get list of active tokens (getTokens)
The method returns the list of tokens linked to server user.
getTokens()
Send token to server (addToken)
The method is used to send token to server.
addToken(@NonNull final String token)
Remove tokens from server (removeTokens)
The method is used to remove sent tokens from server.
removeTokens(@NonNull final List<String> tokens)
Get message topics list (getTopics)
The method returns the list of message topics with additional information available for the user.
getTopics()
Message subscription (subscribe)
The method is used to subscribe to server messages with corresponding topics. The method returns an instance of the Call class.
subscribe(final List<String> topics)
Unsubscribe from messages (unsubscribe)
The method is used to unsubscribe from server messages with corresponding topics.
unsubscribe(@NonNull final List<String> topics)
The use of methods is given in the Example of Working with Push Notifications section.
Download file from server (fileGet)
The fileGet method downloads a file from mobile platform server.
Syntax:
fun <T : BaseStatus> fileGet(local: String,
remote: String,
mount: String,
gson: Class<T> = BaseStatus::class.java,
key: String = ""): Call<T>
Call<BaseStatus> fileGet(String local, String remote, String mount);
Call<T extends BaseStatus> fileGet(String local, String remote, String mount, Class<T> gson);
Call<BaseStatus> fileGet(String local, String remote, String mount, String key);
Call<T extends BaseStatus> fileGet(String local, String remote, String mount, Class<T> gson, String key);
Input parameters:
Parameter | Data type | Description |
local | String | Absolute path to the file on mobile device. |
remote |
String | Relative path to the file on mobile platform server. |
mount |
String | Mount point on mobile platform server. |
gson |
Class<T> | Class for GSON deserialization. BaseStatus::class.java is used by default. |
key |
String | Local file encryption file. String is empty by default. When encryption key is specified, the downloaded file will be encrypted using this key. |
Example:
val loaded = hyperHive.filesApi.fileGet(
"/path/to/local.txt",
"./path/to/remote.txt",
"nfs4",
BaseStatus::class.java,
"password"
).execute().isOk
final boolean loaded = hyperHive.filesApi.fileGet(
"/path/to/local.txt",
"./path/to/remote.txt",
"nfs4",
BaseStatus.class,
"password"
).execute().isOk();
Upload file to server (filePut)
The filePut method uploads a file to mobile platform server.
Syntax:
fun <T : BaseStatus> filePut(local: String,
remote: String,
mount: String,
gson: Class<T> = BaseStatus::class.java,
key: String = ""): Call<T>
Call<BaseStatus> filePut(String local, String remote, String mount);
Call<T extends BaseStatus> filePut(String local, String remote, String mount, Class<T> gson);
Call<BaseStatus> filePut(String local, String remote, String mount, String key);
Call<T extends BaseStatus> filePut(String local, String remote, String mount, Class<T> gson, String key);
Input parameters:
Parameter | Data type | Description |
local | String | Absolute path to the file on mobile device. |
remote |
String | Relative path to the file on mobile platform server. |
mount |
String | Mount point on mobile platform server. |
gson |
Class<T> | Class for GSON deserialization. BaseStatus::class.java is used by default. |
key |
String | Local file encryption file. String is empty by default. When the key is specified, the file is decrypted using this key and is uploaded to mobile platform server. |
Example:
val uploaded = hyperHive.filesApi.fileGet(
"/path/to/local.txt",
"./path/to/remote.txt",
"nfs4",
BaseStatus::class.java,
"password"
).execute().isOk
final boolean uploaded = hyperHive.filesApi.fileGet(
"/path/to/local.txt",
"./path/to/remote.txt",
"nfs4",
BaseStatus.class,
"password"
).execute().isOk();
Decrypt file to a new file or memory buffer (fileDecrypt)
The fileDecrypt method decrypts the file and places decrypted contents to a new file or mobile platform memory buffer.
Syntax:
fun fileDecrypt(from: String, to: String, key: String): Call<Unit> // decrypt to a new file
fun fileDecrypt(from: String, key: String): Call<ByteArray> // decrypt to memory buffer
Call<Void> fileDecrypt(String from, String to, String key) // decrypt to a new file
Call<ByteArray> fileDecrypt(String from, String key) // decrypt to memory buffer
Input parameters:
Parameter | Data type | Description |
from | String | Absolute path to the file on mobile device that will be decrypted. |
to |
String | Absolute path to a new file on mobile device, to which decrypted file contents will be loaded. |
key |
String | Encryption key that was used on downloading file by means of the fileGet method. |
Example:
hyperHive.filesApi.fileDecrypt(
"/path/to/encrypted.txt",
"/path/to/decrypted.txt",
"password"
).execute()
val data = hyperHive.filesApi.fileDecrypt(
"/path/to/encrypted.txt",
"password"
).execute()
val string = String(data) // text file
val bitmap = BitmapFactory.decodeByteArray(data, 0, data.size) // image
... // PDF file and others
hyperHive.filesApi.fileDecrypt(
"/path/to/encrypted.txt",
"/path/to/decrypted.txt",
"password"
).execute();
final byte[] data = hyperHive.filesApi.fileDecrypt(
"/path/to/encrypted.txt",
"password"
).execute();
final String string = new String(data); // text file.
final Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length) // image
... // PDF file and others
The use of methods is given in the Example of Working with Files article.
Methods of this area are implemented in the LoggingAPI unit, which is available in the HyperHive (hyperHive.loggingAPI) class.
The method is used to initalize automatic sending of logs by the schedule obtained from server. If initialization is successful, the method returns True, otherwise is returns False. Start the method after successful authentication.
Start the method after successful authentication. If database must be encrypted, open the database with encryption key before calling the method.
initLogging()
Set logging level (setLogLevel)
The method is used to set minimum logging level:
setLogLevel(int level)
The "level" argument takes the values:
4. LOG_INFO.
5. LOG_WARNING.
6. LOG_ERROR.
Display framework log in the console (setLogEnabled)
The setLogEnabled method determines whether framework log is displayed in the console.
hyperHive.loggingApi.setLogEnabled(enabled)
Input parameters:
Parameter | Data type | Description |
enabled | Bool | Determine whether framework log is displayed in the console. Available values:
|
Example:
hyperHive.loggingApi.setLogEnabled(true)
Create logs (logTrace, logWarning, logFatal)
Each of the methods saves message in logs with specifying the current time and logging level.
logTrace(@NonNull String message),
logWarning(@NonNull String message),
logFatal(@NonNull String message)
Methods of this area are implemented in the StateAPI unit, which is available in the HyperHive (hyperHive.stateAPI) class.
Save state to database (saveStateToDB())
The method is used to save the current state (authorization data and scheme of resources) to database. The method returns True if saving is successful, and False if it is not.
saveStateToDB(String dbPath)
Restore state from database (restoreStateFromDB())
The method is used to restore state (authorization data and scheme of resources) from database. The method returns True if state is restored successfully, and False if state is not restored.
After the state is restored, all opened databases are closed. If it is required to work with an encrypted database after restoring, it must be opened with encryption key, otherwise all further requests to this database will fail.
restoreStateFromDb(String dbPath)
Core version (getVersionCoreAPI)
The method is used to get information about core version in use:
getVersionCoreAPI(int depth)
The "depth" argument affects the information format:
1. The shortest format.
4. The longest format.
Plugin version (getVersionPlugin)
The method is used to get information about plugin version in use:
getVersionPlugin()
Save custom parameter to database (saveParamToDB())
The method is used to save the "value" value with the "key" key to the hhivePreference table for the specified dbPath database. The method returns True if saving is successful, and False if it is not.
boolean saveParamToDB(String dbPath, String key, String value)
Get parameter value from database (getParamFromDB())
The method is used to get parameter value with the "key" key from the hhivePreference table for the specified dbPath database. The method returns parameter value if it is in the table, and Null if it is not in the table.
String getParamFromDB(String dbPath, String key)
To initialize and set up Android, see the Initializing Android Framework section.
To view examples of Android framework use, see the Examples of Android Framework Use section.
See also:
Android Framework | Initializing Android Framework | Examples of Android Framework Use