mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
new method in API
This commit is contained in:
parent
74ce811475
commit
5cb0f425b7
3 changed files with 12 additions and 1 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.api;
|
||||
|
||||
import org.geometerplus.zlibrary.core.library.ZLibrary;
|
||||
|
||||
import org.geometerplus.zlibrary.text.view.*;
|
||||
|
||||
import org.geometerplus.fbreader.fbreader.FBReaderApp;
|
||||
|
@ -30,6 +32,10 @@ public class ApiImplementation extends ApiInterface.Stub implements ApiMethods {
|
|||
public ApiObject request(int method, ApiObject[] parameters) {
|
||||
try {
|
||||
switch (method) {
|
||||
case GET_FBREADER_VERSION:
|
||||
return ApiObject.envelope(
|
||||
ZLibrary.Instance().getVersionName()
|
||||
);
|
||||
case GET_BOOK_LANGUAGE:
|
||||
return ApiObject.envelope(getBookLanguage());
|
||||
case GET_PARAGRAPHS_NUMBER:
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
package org.geometerplus.android.fbreader.api;
|
||||
|
||||
interface ApiMethods {
|
||||
// program information
|
||||
// fbreader information
|
||||
int GET_FBREADER_VERSION = 1;
|
||||
|
||||
// library information
|
||||
|
||||
|
|
|
@ -105,6 +105,10 @@ public class ApiServiceConnection implements ServiceConnection, ApiMethods {
|
|||
return new ApiObject[] { ApiObject.envelope(value) };
|
||||
}
|
||||
|
||||
public String getFBReaderVersion() throws ApiException {
|
||||
return requestString(GET_FBREADER_VERSION, EMPTY_PARAMETERS);
|
||||
}
|
||||
|
||||
public String getBookLanguage() throws ApiException {
|
||||
return requestString(GET_BOOK_LANGUAGE, EMPTY_PARAMETERS);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue