100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Change console to a simple webview that handle AuthToken
mhallin14f6c83845cb
diff --git a/console/android/build.gradle b/console/android/build.gradleindex 91b293ed1..3a22f12fd 100644--- a/console/android/build.gradle+++ b/console/android/build.gradle@@ -3,7 +3,7 @@ buildscript {jcenter()}dependencies {- classpath "com.android.tools.build:gradle:$androidGradleVersion"+ classpath 'com.android.tools.build:gradle:2.3.0'}}@@ -27,13 +27,17 @@ apply plugin: "com.android.application"version = projectVersiondependencies {- compile "org.jboss.aerogear:aerogear-android-authz:$aerogearVersion"-+ compile 'com.squareup.okhttp3:okhttp:3.6.0'compile "com.android.support:support-compat:$androidSupportVersion"compile "com.android.support:appcompat-v7:$androidSupportVersion"+ compile 'com.android.support.constraint:constraint-layout:1.0.1'+ compile 'com.google.firebase:firebase-messaging:10.2.0'}android {+++compileSdkVersion Integer.valueOf(androidCompileVersion)buildToolsVersion androidBuildToolsVersion@@ -43,6 +47,7 @@ android {targetSdkVersion Integer.valueOf(androidTargetVersion)versionCode Integer.valueOf(projectVersionCode)versionName project.version+}packagingOptions {diff --git a/console/android/gradle.properties b/console/android/gradle.propertiesindex 487245e8f..c40cfab88 100644--- a/console/android/gradle.properties+++ b/console/android/gradle.properties@@ -6,8 +6,8 @@ projectVersion = 3.0-SNAPSHOTprojectVersionCode = 1# Android 5.0-androidMinVersion = 21-androidTargetVersion = 21+androidMinVersion = 19+androidTargetVersion = 25androidGradleVersion = 2.2.3androidBuildToolsVersion = 25.0.2diff --git a/console/android/src/main/AndroidManifest.xml b/console/android/src/main/AndroidManifest.xmlindex 1f9e941ad..ac47c1c1b 100644--- a/console/android/src/main/AndroidManifest.xml+++ b/console/android/src/main/AndroidManifest.xml@@ -7,7 +7,7 @@<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />- <uses-permission android:name="android.permission.WAKE_LOCK" />+<applicationandroid:allowBackup="true"@@ -15,7 +15,16 @@android:label="@string/app_name"android:theme="@style/OpenRemoteTheme">- <service android:name="org.jboss.aerogear.android.authorization.oauth2.OAuth2AuthzService" />+ <!-- Set custom default icon. This is used when no icon is set for incoming notification messages.+ See README(https://goo.gl/l4GJaQ) for more. -->+ <meta-data+ android:name="com.google.firebase.messaging.default_notification_icon"+ android:resource="@drawable/ic_launcher" />+ <!-- Set color used with incoming notification messages. This is used when no color is set for the incoming+ notification message. See README(https://goo.gl/6BKBk7) for more. -->+ <meta-data+ android:name="com.google.firebase.messaging.default_notification_color"+ android:resource="@color/light_green" /><activity android:name=".MainActivity"android:configChanges="orientation|screenSize"@@ -26,6 +35,21 @@</intent-filter></activity>+ <service+ android:name=".ORFirebaseMessagingService">+ <intent-filter>+ <action android:name="com.google.firebase.MESSAGING_EVENT"/>+ </intent-filter>+ </service>++ <service+ android:name=".ORFirebaseInstanceIDService">+ <intent-filter>+ <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>+ </intent-filter>+ </service>++</application></manifest>\ No newline at end of filediff --git a/console/android/src/main/java/org/openremote/android/MainActivity.java b/console/android/src/main/java/org/openremote/android/MainActivity.javaindex 7b336c2fa..d45de3d06 100644--- a/console/android/src/main/java/org/openremote/android/MainActivity.java+++ b/console/android/src/main/java/org/openremote/android/MainActivity.java@@ -1,91 +1,80 @@package org.openremote.android;import android.app.Activity;+import android.content.Context;+import android.content.SharedPreferences;import android.os.Bundle;+import android.os.StrictMode;import android.util.Log;-import android.webkit.JavascriptInterface;+import android.webkit.WebChromeClient;import android.webkit.WebSettings;import android.webkit.WebView;import android.webkit.WebViewClient;-import org.jboss.aerogear.android.core.Callback;-import org.openremote.android.util.KeycloakHelper;-import java.util.HashMap;-import java.util.Map;+public class MainActivity extends Activity {-public class MainActivity extends Activity {+ private WebView webView;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);+ StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();+ StrictMode.setThreadPolicy(policy);setContentView(R.layout.activity_web);-+ webView = (WebView) findViewById(R.id.webview);+ if (savedInstanceState != null) {+ webView.restoreState(savedInstanceState);+ }+ else {+ loadIndex();+ }}@Override- protected void onStart() {- super.onStart();-- Log.d("KEYCLOAK","Try connect");- KeycloakHelper.testWebview(new Callback() {- @Override- public void onSuccess(Object data) {- Log.d("KEYCLOAK","Success:" + data.toString());-- WebView view = (WebView) findViewById(R.id.webview);- WebSettings webSettings = view.getSettings();- webSettings.setJavaScriptEnabled(true);- webSettings.setDomStorageEnabled(true);- //webSettings.setAllowUniversalAccessFromFileURLs(true);-- webSettings.setAllowFileAccessFromFileURLs(true);- webSettings.setAllowContentAccess(true);- view.setWebViewClient(new WebViewClient() {- @Override- public boolean shouldOverrideUrlLoading(WebView view, String url) {- return false;- }-- });-- view.addJavascriptInterface(new WebAppInterface(data.toString()), "mobileClient");-- Map<String,String> addHeader = new HashMap<String, String>();- // TODO This only adds the authorization header to the initial request when webview is loaded- // TODO When we retrieve console resources from the server, all requests must be authorized- // TODO Use interceptors as outlined here and solution for API level 21:- // TODO https://stackoverflow.com/questions/7610790/add-custom-headers-to-webview-resource-requests-android- addHeader.put("Authorization","Bearer "+data.toString());- addHeader.put("Access-Control-Allow-Origin","*");- addHeader.put("Access-Control-Allow-Headers", "origin, content-type, accept, authorization");- addHeader.put("Access-Control-Allow-Credentials", "true");- addHeader.put("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD");- view.loadUrl("file:///android_asset/index.html",addHeader);- }-- @Override- public void onFailure(Exception e) {- Log.d("KEYCLOAK","failled");-- }- }, this);+ protected void onSaveInstanceState(Bundle outState) {+ webView.saveState(outState);}- private class WebAppInterface {- private String mToken;+ private void loadIndex() {++ webView.addJavascriptInterface(new WebAppInterface(this),"MobileInterface");+ WebSettings webSettings = webView.getSettings();+ webSettings.setJavaScriptEnabled(true);+ webSettings.setAppCacheEnabled(true);+ webSettings.setDomStorageEnabled(true);+ webSettings.setDatabaseEnabled(true);++ webView.setWebViewClient(new WebViewClient());+ webView.setWebChromeClient(new WebChromeClient());+ webView.loadUrl(getString(R.string.OR_BASE_SERVER)+getString(R.string.OR_CONSOLE_URL));- public WebAppInterface(String token) {+ }++++ private class WebAppInterface {+ private final SharedPreferences sharedPref;- mToken = token;+ public WebAppInterface(Activity activity) {+ sharedPref = activity.getPreferences(Context.MODE_PRIVATE);}@JavascriptInterface- public String getToken() {- Log.d("WEBVIEW","getToken");- return mToken;+ public String getMobileToken() {+ Log.d("TOKEN", "get Token");+ return sharedPref.getString(getString(R.string.SHARED_PREF_TOKENS), null);+ }++ @JavascriptInterface+ public void setMobileToken(String token, String refreshToken, String idToken) {+ Log.d("TOKEN", "Set Token");+ String mToken = "{ \"token\" :\"" +token +"\", \"refreshToken\": \""+refreshToken+ "\", \"idToken\": \""+idToken+"\"}";+ sharedPref.edit().putString(getString(R.string.SHARED_PREF_TOKENS), mToken).commit();}}}++diff --git a/console/android/src/main/java/org/openremote/android/ORFirebaseInstanceIDService.java b/console/android/src/main/java/org/openremote/android/ORFirebaseInstanceIDService.javanew file mode 100644index 000000000..7d2b32efd--- /dev/null+++ b/console/android/src/main/java/org/openremote/android/ORFirebaseInstanceIDService.java@@ -0,0 +1,58 @@+/**+ * Copyright 2016 Google Inc. All Rights Reserved.+ * <p>+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ * <p>+ * http://www.apache.org/licenses/LICENSE-2.0+ * <p>+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.openremote.android;++import android.util.Log;++import com.google.firebase.iid.FirebaseInstanceId;+import com.google.firebase.iid.FirebaseInstanceIdService;+++public class ORFirebaseInstanceIDService extends FirebaseInstanceIdService {++ private static final String TAG = "ORFirebaseIIDService";++ /**+ * Called if InstanceID token is updated. This may occur if the security of+ * the previous token had been compromised. Note that this is called when the InstanceID token+ * is initially generated so this is where you would retrieve the token.+ */+ // [START refresh_token]+ @Override+ public void onTokenRefresh() {+ // Get updated InstanceID token.+ String refreshedToken = FirebaseInstanceId.getInstance().getToken();+ Log.d(TAG, "Refreshed token: " + refreshedToken);++ // If you want to send messages to this application instance or+ // manage this apps subscriptions on the server side, send the+ // Instance ID token to your app server.+ sendRegistrationToServer(refreshedToken, FirebaseInstanceId.getInstance().getId());+ }+ // [END refresh_token]++ /**+ * Persist token to third-party servers.+ * <p>+ * Modify this method to associate the user's FCM InstanceID token with any server-side account+ * maintained by your application.+ *+ * @param token The new token.+ */+ private void sendRegistrationToServer(String token, String Id) {+ // TODO: IF auth token avaible try to send it or store it to send it once authtoken is received+ }+}\ No newline at end of filediff --git a/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java b/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.javanew file mode 100644index 000000000..6d7bc1120--- /dev/null+++ b/console/android/src/main/java/org/openremote/android/ORFirebaseMessagingService.java@@ -0,0 +1,95 @@+/**+ * Copyright 2016 Google Inc. All Rights Reserved.+ * <p>+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ * <p>+ * http://www.apache.org/licenses/LICENSE-2.0+ * <p>+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package org.openremote.android;++import android.app.NotificationManager;+import android.app.PendingIntent;+import android.content.Context;+import android.content.Intent;+import android.media.RingtoneManager;+import android.net.Uri;+import android.support.v4.app.NotificationCompat;+import android.util.Log;++import com.google.firebase.messaging.RemoteMessage;++public class ORFirebaseMessagingService extends com.google.firebase.messaging.FirebaseMessagingService {++ private static final String TAG = "MyFirebaseMsgService";++ /**+ * Called when message is received.+ *+ * @param remoteMessage Object representing the message received from Firebase Cloud Messaging.+ */+ // [START receive_message]+ @Override+ public void onMessageReceived(RemoteMessage remoteMessage) {+ // [START_EXCLUDE]+ // There are two types of messages data messages and notification messages. Data messages are handled+ // here in onMessageReceived whether the app is in the foreground or background. Data messages are the type+ // traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app+ // is in the foreground. When the app is in the background an automatically generated notification is displayed.+ // When the user taps on the notification they are returned to the app. Messages containing both notification+ // and data payloads are treated as notification messages. The Firebase console always sends notification+ // messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options+ // [END_EXCLUDE]++ // TODO(developer): Handle FCM messages here.+ // Not getting messages here? See why this may be: https://goo.gl/39bRNJ+ Log.d(TAG, "From: " + remoteMessage.getFrom());++ // Check if message contains a data payload.+ if (remoteMessage.getData().size() > 0) {+ Log.d(TAG, "Message data payload: " + remoteMessage.getData());+ }++ // Check if message contains a notification payload.+ if (remoteMessage.getNotification() != null) {+ Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());+ }++ // Also if you intend on generating your own notifications as a result of a received FCM+ // message, here is where that should be initiated. See sendNotification method below.+ }+ // [END receive_message]++ /**+ * Create and show a simple notification containing the received FCM message.+ *+ * @param messageBody FCM message body received.+ */+ private void sendNotification(String messageBody) {+ Intent intent = new Intent(this, MainActivity.class);+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,+ PendingIntent.FLAG_ONE_SHOT);++ Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);+ NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)+ .setContentTitle("OR Notification")+ .setContentText(messageBody)+ .setAutoCancel(true)+ .setSound(defaultSoundUri)+ .setContentIntent(pendingIntent);++ NotificationManager notificationManager =+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);++ notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());+ }+}\ No newline at end of filediff --git a/console/android/src/main/java/org/openremote/android/util/KeycloakHelper.java b/console/android/src/main/java/org/openremote/android/util/KeycloakHelper.javadeleted file mode 100644index 9a41a7445..000000000--- a/console/android/src/main/java/org/openremote/android/util/KeycloakHelper.java+++ /dev/null@@ -1,151 +0,0 @@-/**- * JBoss, Home of Professional Open Source- * Copyright Red Hat, Inc., and individual contributors- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--package org.openremote.android.util;--import android.app.Activity;-import android.util.Log;--import org.jboss.aerogear.android.authorization.AuthorizationManager;-import org.jboss.aerogear.android.authorization.AuthzModule;-import org.jboss.aerogear.android.authorization.oauth2.OAuth2AuthorizationConfiguration;-import org.jboss.aerogear.android.authorization.oauth2.OAuthWebViewDialog;-import org.jboss.aerogear.android.core.Callback;-import org.jboss.aerogear.android.pipe.PipeManager;-import org.jboss.aerogear.android.pipe.rest.RestfulPipeConfiguration;-import org.jboss.aerogear.android.pipe.rest.gson.GsonRequestBuilder;----import java.net.URL;--public class KeycloakHelper {-- private static final String MANAGER_SERVER_URL = "http://192.168.2.119:8080";- private static final String AUTHZ_URL = MANAGER_SERVER_URL +"/auth";- private static final String AUTHZ_ENDPOINT = "/realms/master/protocol/openid-connect/auth";- private static final String ACCESS_TOKEN_ENDPOINT = "/realms/master/protocol/openid-connect/token";- private static final String REFRESH_TOKEN_ENDPOINT = "/realms/master/protocol/openid-connect/token";- private static final String AUTHZ_ACCOOUNT_ID = "keycloak-token";- private static final String AUTHZ_CLIENT_ID = "openremote";- private static final String AUTHZ_REDIRECT_URL = "org.openremote.console://oauth2Callback";- private static final String MODULE_NAME = "KeyCloakAuthz";-- static {- try {- AuthorizationManager.config(MODULE_NAME, OAuth2AuthorizationConfiguration.class)- .setBaseURL(new URL(AUTHZ_URL))- .setAuthzEndpoint(AUTHZ_ENDPOINT)- .setAccessTokenEndpoint(ACCESS_TOKEN_ENDPOINT)- .setRefreshEndpoint(REFRESH_TOKEN_ENDPOINT)- .setAccountId(AUTHZ_ACCOOUNT_ID)- .setClientId(AUTHZ_CLIENT_ID)- .setRedirectURL(AUTHZ_REDIRECT_URL)- .asModule();-- PipeManager.config("kc-upload", RestfulPipeConfiguration.class).module(AuthorizationManager.getModule(MODULE_NAME))- .withUrl(new URL(MANAGER_SERVER_URL + "/master/asset?realm=master"))- .requestBuilder(new GsonRequestBuilder())- .forClass(TestHolder.class);-- } catch (Exception e) {- throw new RuntimeException(e);- }- }-- public static void connect(final Activity activity, final Callback callback) {- try {- final AuthzModule authzModule = AuthorizationManager.getModule(MODULE_NAME);-- authzModule.requestAccess(activity, new Callback<String>() {- @SuppressWarnings("unchecked")- @Override- public void onSuccess(String s) {- callback.onSuccess(s);- }-- @Override- public void onFailure(Exception e) {- if (!e.getMessage().matches(OAuthWebViewDialog.OAuthReceiver.DISMISS_ERROR)) {- authzModule.deleteAccount();- }- callback.onFailure(e);- }- });--- } catch (Exception e) {- e.printStackTrace();- throw new RuntimeException(e);- }- }-- @SuppressWarnings("unchecked")- public static void test(final Callback callback, final Activity activity) {- if (!KeycloakHelper.isConnected()) {-- KeycloakHelper.connect(activity, new Callback() {- @Override- public void onSuccess(Object o) {- Log.d("KEYCLOAK","Token ?? :"+o);- PipeManager.getPipe("kc-upload", activity).read(callback);- }-- @Override- public void onFailure(Exception e) {- Log.d("KEYCLOAK","error",e);- }- }- );-- } else {- PipeManager.getPipe("kc-upload", activity).read(callback);- }----- }-- public static void testWebview(final Callback callback, final Activity activity) {--- KeycloakHelper.connect(activity, new Callback() {- @Override- public void onSuccess(Object o) {- callback.onSuccess(o);- }-- @Override- public void onFailure(Exception e) {- callback.onFailure(e);- }- }- );-- }-- public static void revokeToken() {- AuthorizationManager.getModule(MODULE_NAME).deleteAccount();- AuthorizationManager.getModule(MODULE_NAME).refreshAccess();- }-- public static boolean isConnected() {- return AuthorizationManager.getModule(MODULE_NAME).isAuthorized();- }--}diff --git a/console/android/src/main/java/org/openremote/android/util/TestHolder.java b/console/android/src/main/java/org/openremote/android/util/TestHolder.javadeleted file mode 100644index 73809c507..000000000--- a/console/android/src/main/java/org/openremote/android/util/TestHolder.java+++ /dev/null@@ -1,26 +0,0 @@-package org.openremote.android.util;---import org.jboss.aerogear.android.core.RecordId;--public class TestHolder {- @RecordId- private String id = null;- private String value = "Test";-- public String getValue() {- return value;- }-- public void setValue(String value) {- this.value = value;- }-- public String getId() {- return id;- }-- public void setId(String id) {- this.id = id;- }-}diff --git a/console/android/src/main/res/layout/activity_console_view.xml b/console/android/src/main/res/layout/activity_console_view.xmldeleted file mode 100644index fb4b72a81..000000000--- a/console/android/src/main/res/layout/activity_console_view.xml+++ /dev/null@@ -1,26 +0,0 @@-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:tools="http://schemas.android.com/tools"- android:layout_width="fill_parent"- android:layout_height="fill_parent"- tools:context="org.openremote.android.ConsoleViewActivity">-- <WebView android:id="@+id/consoleView"- android:layout_width="fill_parent"- android:layout_height="fill_parent"- android:visibility="gone"/>-- <RelativeLayout- android:id="@+id/consoleViewLoading"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:gravity="center"- android:visibility="visible">- <ProgressBar- android:id="@+id/consoleViewLoadingProgress"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:indeterminate="true"- android:indeterminateTint="@color/light_green"- android:indeterminateTintMode="multiply"/>- </RelativeLayout>-</RelativeLayout>\ No newline at end of filediff --git a/console/android/src/main/res/layout/activity_shell.xml b/console/android/src/main/res/layout/activity_shell.xmldeleted file mode 100644index fe15d0e4b..000000000--- a/console/android/src/main/res/layout/activity_shell.xml+++ /dev/null@@ -1,89 +0,0 @@-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:tools="http://schemas.android.com/tools"- android:layout_width="match_parent"- android:layout_height="match_parent"- tools:context="org.openremote.android.ShellActivity">-- <LinearLayout- android:id="@+id/controllerSettings"- android:orientation="vertical"- android:layout_width="fill_parent"- android:layout_height="wrap_content"- android:layout_alignParentBottom="true" android:padding="10dp" android:background="@color/dark_grey">-- <LinearLayout- android:orientation="horizontal"- android:layout_width="fill_parent"- android:layout_height="wrap_content">- <EditText- android:layout_width="0dp"- android:layout_height="wrap_content"- android:id="@+id/controllerUrl"- android:layout_weight="0.33"- android:inputType="textUri"- android:hint="@string/controller_url"- android:backgroundTint="@color/light_green" android:textColor="@color/white"- android:textColorHighlight="@color/white" android:textColorHint="@color/light_grey"- android:textColorLink="@color/white"/>- </LinearLayout>-- <LinearLayout- android:orientation="horizontal"- android:layout_width="fill_parent"- android:layout_height="wrap_content" android:paddingTop="10dp">-- <CheckBox- android:id="@+id/autoConnectCheckBox"- android:layout_width="wrap_content"- android:layout_height="fill_parent"- android:text="@string/connect_automatically"- android:checked="false" android:layout_weight="1"- android:buttonTint="@color/light_green" android:textColor="@color/white"/>- <Button- android:id="@+id/connectButton"- android:layout_width="wrap_content"- android:layout_height="fill_parent"- android:text="@string/connect"- android:layout_weight="1"- android:textColor="@color/medium_grey" android:textStyle="bold"- android:textColorHighlight="@color/white"- android:enabled="false" android:backgroundTint="@color/light_green"/>-- </LinearLayout>- </LinearLayout>-- <ListView android:layout_width="fill_parent"- android:layout_height="fill_parent"- android:id="@+id/controllerList"- android:layout_alignParentTop="true"- android:layout_above="@id/controllerSettings" android:choiceMode="singleChoice"/>-- <Button- android:id="@+id/findControllersButton"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="@string/find_controllers"- android:textColor="@color/dark_grey" android:textStyle="bold"- android:textColorHighlight="@color/white" android:backgroundTint="@color/light_green"- android:padding="20dp"- android:layout_marginTop="50dp"- android:layout_centerHorizontal="true" android:visibility="invisible"/>--- <!--- <RelativeLayout- android:id="@+id/controllersLoading"- android:layout_width="match_parent"- android:layout_height="match_parent"- android:gravity="center"- android:visibility="gone"- android:layout_above="@+id/controllerSettings">- <ProgressBar- android:id="@+id/controllersLoadingProgress"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:indeterminate="true"/>- </RelativeLayout>- -->--</RelativeLayout>diff --git a/console/android/src/main/res/layout/activity_web.xml b/console/android/src/main/res/layout/activity_web.xmlindex 55fa479a2..84f010200 100644--- a/console/android/src/main/res/layout/activity_web.xml+++ b/console/android/src/main/res/layout/activity_web.xml@@ -12,6 +12,7 @@android:layout_width="match_parent"android:layout_height="match_parent"android:layout_alignParentStart="true"- android:layout_alignParentEnd="true"- android:layout_alignParentTop="true" />+ android:layout_alignParentEnd="true">++ </WebView></RelativeLayout>diff --git a/console/android/src/main/res/menu/menu_shell.xml b/console/android/src/main/res/menu/menu_shell.xmlindex a3a2eee6f..3e19a383b 100644--- a/console/android/src/main/res/menu/menu_shell.xml+++ b/console/android/src/main/res/menu/menu_shell.xml@@ -2,9 +2,5 @@xmlns:tools="http://schemas.android.com/tools"tools:context="org.openremote.android.ShellActivity">- <item android:id="@+id/action_find_controllers"- android:title="@string/action_find_controllers"- android:orderInCategory="100"- android:showAsAction="never"/></menu>diff --git a/console/android/src/main/res/values/strings.xml b/console/android/src/main/res/values/strings.xmlindex 7aab0abe6..b97a8a37e 100644--- a/console/android/src/main/res/values/strings.xml+++ b/console/android/src/main/res/values/strings.xml@@ -1,11 +1,6 @@<resources><string name="app_name">OpenRemote</string>-- <string name="action_find_controllers">Find controllers</string>-- <string name="controller_url">Controller URL</string>- <string name="connect_automatically">Connect automatically</string>- <string name="connect">Connect</string>- <string name="find_controllers">Find controllers</string>-+ <string name="OR_BASE_SERVER">http://192.168.0.143:8080</string>+ <string name="OR_CONSOLE_URL">/console/blok61/index.html</string>+ <string name="SHARED_PREF_TOKENS">TOKENS</string></resources>diff --git a/console/android/src/main/res/values/styles.xml b/console/android/src/main/res/values/styles.xmlindex 409007057..e4589f3ca 100644--- a/console/android/src/main/res/values/styles.xml+++ b/console/android/src/main/res/values/styles.xml@@ -1,8 +1,7 @@<resources><style name="OpenRemoteTheme"- parent="@android:style/Theme.DeviceDefault.Light.DarkActionBar">- <item name="android:actionBarStyle">@style/OpenRemoteActionBar</item>+ parent="@android:style/Theme.Black.NoTitleBar"><item name="android:actionMenuTextColor">@color/dark_grey</item></style>