Finish v1_0_31(34)
This commit is contained in:
commit
e797f8dfad
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 33
|
||||
def appVersionName = '1.0.30'
|
||||
def appVersionCode = 34
|
||||
def appVersionName = '1.0.31'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
||||
@ -20,14 +20,19 @@ public class RESTBuilder {
|
||||
}
|
||||
public static <T> T getService(final Class<T> service, int timeout) {
|
||||
// return getService(service, "192.168.2.13", 8080);
|
||||
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true, timeout);
|
||||
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true, true, timeout);
|
||||
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
||||
return getService(service, host, port, addInterceptors, 30);
|
||||
return getService(service, host, port, addInterceptors, true, 30);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, int timeout){
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout){
|
||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||
|
||||
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
||||
@ -38,7 +43,7 @@ public class RESTBuilder {
|
||||
|
||||
OkHttpClient client = clientBuilder.build();
|
||||
|
||||
String endpoint = "http://" + host + ":" + port + "/ems-api/";
|
||||
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.baseUrl(endpoint)
|
||||
|
||||
@ -66,7 +66,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Log.e("ProcessSql", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
UtilityLogger.errorMe(new Exception(t), nativeSql);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -31,16 +31,22 @@ public class UtilityLogger {
|
||||
}
|
||||
|
||||
public static void errorMe(Exception ex) {
|
||||
errorMe(ex, null, null);
|
||||
errorMe(ex, null, null, null);
|
||||
}
|
||||
|
||||
public static void errorMe(Exception ex, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static void errorMe(Exception ex, String additionalText) {
|
||||
errorMe(ex, additionalText, null, null);
|
||||
}
|
||||
|
||||
public static void errorMe(Exception ex, String additionalText, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String message = UtilityResources.readRawTextFile(R.raw.error_mail);
|
||||
|
||||
message = message.replace("#exception_name#", ex.getMessage());
|
||||
|
||||
StringWriter sw = new StringWriter();
|
||||
ex.printStackTrace(new PrintWriter(sw));
|
||||
|
||||
if(additionalText != null) sw.append("\n").append(additionalText);
|
||||
message = message.replace("#stacktrace#", sw.toString());
|
||||
|
||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : SettingsManager.i().userSession.profileDB;
|
||||
|
||||
@ -38,7 +38,7 @@ public class LoginHelper {
|
||||
String host = CommonConst.Login.Azienda.host;
|
||||
int port = CommonConst.Login.Azienda.port;
|
||||
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false);
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false, true);
|
||||
service.loginAzienda(mCodAzienda).enqueue(new Callback<ServiceRESTResponse<LoginAziendaDTO>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user