Skip to content

Commit 6248067

Browse files
committed
info dialog updated
1 parent c8993a8 commit 6248067

4 files changed

Lines changed: 44 additions & 15 deletions

File tree

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "org.twistedappdeveloper.opcclient"
77
minSdkVersion 17
88
targetSdkVersion 29
9-
versionCode 14
10-
versionName "1.0.8.1"
9+
versionCode 15
10+
versionName "1.0.8.2"
1111
multiDexEnabled true
1212
}
1313
buildTypes {

app/src/main/java/org/twistedappdeveloper/opcclient/MainActivity.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
import android.os.Bundle;
99
import android.os.Handler;
1010
import android.os.Message;
11-
import androidx.appcompat.app.AlertDialog;
12-
import androidx.appcompat.app.AppCompatActivity;
11+
import android.text.SpannableString;
12+
import android.text.method.LinkMovementMethod;
13+
import android.text.util.Linkify;
1314
import android.view.Menu;
1415
import android.view.MenuInflater;
1516
import android.view.MenuItem;
@@ -18,8 +19,12 @@
1819
import android.widget.Button;
1920
import android.widget.EditText;
2021
import android.widget.ListView;
22+
import android.widget.TextView;
2123
import android.widget.Toast;
2224

25+
import androidx.appcompat.app.AlertDialog;
26+
import androidx.appcompat.app.AppCompatActivity;
27+
2328
import org.opcfoundation.ua.application.Client;
2429
import org.opcfoundation.ua.builtintypes.StatusCode;
2530
import org.opcfoundation.ua.core.EndpointDescription;
@@ -197,15 +202,22 @@ public boolean onOptionsItemSelected(MenuItem item) {
197202
break;
198203
case R.id.action_info:
199204
AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
200-
alertDialog.setTitle(R.string.info);
201-
alertDialog.setMessage(getString(R.string.infoMessage));
205+
final SpannableString s =
206+
new SpannableString(getString(R.string.infoMessage));
207+
Linkify.addLinks(s, Linkify.WEB_URLS);
208+
alertDialog.setTitle(String.format("%s %s", getString(R.string.info), BuildConfig.VERSION_NAME));
209+
alertDialog.setMessage(s);
202210
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(android.R.string.ok),
203211
new DialogInterface.OnClickListener() {
204212
public void onClick(DialogInterface dialog, int which) {
205213
dialog.dismiss();
206214
}
207215
});
208216
alertDialog.show();
217+
TextView txtDialog = alertDialog.findViewById(android.R.id.message);
218+
if (txtDialog != null) {
219+
txtDialog.setMovementMethod(LinkMovementMethod.getInstance());
220+
}
209221
break;
210222
}
211223
return super.onOptionsItemSelected(item);

app/src/main/res/values-it/strings.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<string name="EndpointsNontrovati">Non sono stati trovati Endpoints</string>
2727
<string name="ServerDown">Richiesta scaduta</string>
2828
<string name="VuoiCollegartiAllEndpoint">Vuoi collegarti a questo Endpoint?</string>
29-
<string name="CreazioneSessione">Creazione sessione in corso...</string>
29+
<string name="CreazioneSessione">Creazione sessione in corso</string>
3030
<string name="SessioneNonCreata">La sessione non può essere creata\n</string>
3131
<string name="Errore">Errore</string>
3232
<string name="RichiestaBrowse">Richiesta di Browse al server</string>
@@ -36,23 +36,23 @@
3636
<string name="AggiornamentoAttivo">Aggiornamento interfaccia utente ON</string>
3737
<string name="AggiornamentoInPausa">Aggiornamento interfaccia utente OFF</string>
3838
<string name="InserisciValoriValidi">Inserisci dei valori validi</string>
39-
<string name="LetturaInCorso">Lettura in corso...</string>
39+
<string name="LetturaInCorso">Lettura in corso</string>
4040
<string name="LetturaFallita">Non è stato possibile eseguire l\'operazione di lettura\n</string>
4141
<string name="CreazioneSottoscrizione">Creazione della sottoscrizione</string>
4242
<string name="SottoscrizioneFallita">La sottoscrizione non può essere creata\n</string>
4343
<string name="DeviRispettareVincolo">Devi rispettare il vincolo:</string>
44-
<string name="WriteInCorso">Scrittura in corso...</string>
44+
<string name="WriteInCorso">Scrittura in corso</string>
4545
<string name="WriteFallita">Scrittura fallita\n</string>
4646
<string name="ValoriInviati">Valori inviati</string>
4747
<string name="EliminandoLaSessione">Cancellando la sessione tutte le sottoscrizioni ad essa legate verrano eliminate. Sei sicuro di voler eliminare questa sessione?</string>
4848
<string name="ErroreLetturaSottoscrizione">Errore lettura sottoscrizione</string>
4949
<string name="ParametriRestituiti">Parametri restituiti dal server</string>
50-
<string name="CreazioneMonItemInCorso">Creazione Monitored Item in corso...</string>
50+
<string name="CreazioneMonItemInCorso">Creazione Monitored Item in corso</string>
5151
<string name="ErroreSconosciuto">Errore sconosciuto\n</string>
5252
<string name="ErroreToast">"Errore: "</string>
5353
<string name="ChiudiSottoscrizione">Chiudi sottoscrizione</string>
5454
<string name="ChiudendoSottoscrizione">Vuoi chiudere questa sottoscrizione?</string>
55-
<string name="CencellazioneSottoscrizioneInCorso">Chiusura sottoscrizione in corso...</string>
55+
<string name="CencellazioneSottoscrizioneInCorso">Chiusura sottoscrizione in corso</string>
5656
<string name="EliminationeSottoscrizioneFallita">Non è stato possibile eliminare la sottoscrizione \n</string>
5757
<string name="Ultime">"Ultime "</string>
5858
<string name="letture">" letture"</string>
@@ -68,7 +68,16 @@
6868
<string name="sottoscrizioniscadute">Alcune sottoscrizioni sono scadute</string>
6969
<string name="sottoscrizionescaduta">La sottoscrizione è scaduta</string>
7070
<string name="protocollononsupportato">L\'unico protocollo di trasporto supportato in questo momento è il TCP.\nScegli degli endpoint opc.tcp</string>
71-
<string name="infoMessage">Questa applicazione in versione demo è stata sviluppata per mostrare le potenzialità dello standard OPC UA. Si tratta di uno standard di rilievo in quanto è stato incluso nei principali modelli di riferimento architetturali industriali come RAMI 4.0 e (IIRA) IIoT.\n\nSviluppato da due studenti dell\'Università degli Studi di Catania (Italy) per il corso di Informatica Industriale.\n\nPer qualsiasi informazioni è possibile contattare gli sviluppatori ai seguenti indirizzi e-mail:\ntwistedfatedeveloper@gmail.com\ntwistedappdeveloper@gmail.com</string>
71+
<string name="infoMessage">
72+
Questa applicazione in versione demo è stata sviluppata per mostrare le potenzialità dello standard OPC UA.
73+
\nEssa fa uso dello stack Java ufficiale fornito dalla OPC Foundation al seguente url:
74+
https://github.com/OPCFoundation/UA-Java-Legacy, tale stack è oggi non più supportato quindi l\'applicazione potrebbe smettere di funzionare nelle future release dello standard. Si segnale che l\'applicazione fa uso di un certificato self-signed e potrebbero quindi presertarsi problemi nella connessione a server che fanno uso di autenticazione Sign o Sign &amp; Encrypt.
75+
\n\nL\'app è stata sviluppata da due studenti dell\'Università degli Studi di Catania (Italy) e il codice sorgente è disponibile sotto licenza GPL-3.0 al seguete url:
76+
\nhttps://github.com/SimoneTinella/Android_OPCUA_Client
77+
\n\nPer qualsiasi informazione è possibile contattare gli sviluppatori ai seguenti indirizzi e-mail:
78+
\ntwistedfatedeveloper@gmail.com
79+
\ntwistedappdeveloper@gmail.com
80+
</string>
7281
<string name="ChiudiSessione">Chiudi sessione</string>
7382
<string name="value_type">Tipo valore:&#160;</string>
7483
<string name="long_press_info">Tieni premuto un elemento della lista per aprire il Menu delle azioni.</string>

app/src/main/res/values/strings.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@
7070
<string name="AggiornamentoAttivo">User interface update on</string>
7171
<string name="AggiornamentoInPausa">User interface update off</string>
7272
<string name="InserisciValoriValidi">Enter valid values</string>
73-
<string name="LetturaInCorso">Reading in progress...</string>
73+
<string name="LetturaInCorso">Reading in progress</string>
7474
<string name="LetturaFallita">Reading not performed\n</string>
7575
<string name="CreazioneSottoscrizione">Subscription creation</string>
7676
<string name="SottoscrizioneFallita">The subscription could not be created\n</string>
7777
<string name="DeviRispettareVincolo">You must respect the constraint:</string>
78-
<string name="WriteInCorso">Write operation in progress...</string>
78+
<string name="WriteInCorso">Write operation in progress</string>
7979
<string name="WriteFallita">Write operation failed\n</string>
8080
<string name="ValoriInviati">Values sent</string>
8181
<string name="ChiudiSessione">Close Session</string>
@@ -99,7 +99,15 @@
9999
<string name="termina_sessione">Close session</string>
100100
<string name="elimina_sottoscrizione">Delete subscription</string>
101101
<string name="info">Information</string>
102-
<string name="infoMessage">This demo version was developed to show the potential of the OPC UA standard. Today, this standard is relevant because it has been included in the main reference models of industrial architecture such as RAMI 4.0 and IIoT.\n\nDeveloped by two students of the University of Catania (Italy) for the course of Industrial Informatics.\n\nFor whatever information it is possible to contact the developers to the followings addresses:\ntwistedfatedeveloper@gmail.com\ntwistedappdeveloper@gmail.com</string>
102+
<string name="infoMessage">
103+
This demo version application was developed to show the potential of the OPC UA standard.
104+
\nThe app makes use of the official Java stack provided by the OPC Foundation at the following url:\nhttps://github.com/OPCFoundation/UA-Java-Legacy, this stack is no longer supported today so the application may stop working in future release of the standard. In addition, the application uses a self-signed certificate, therefore problems may arise in the connection to servers that use Sign or Sign &amp; Encrypt authentication.
105+
\n\nThis mobile application was developed by two students of the University of Catania (Italy) and the source code is available under the GPL-3.0 license at the following url:
106+
\nhttps://github.com/SimoneTinella/Android_OPCUA_Client
107+
\n\nFor any information you can contact the developers at the following e-mail addresses:
108+
\ntwistedfatedeveloper@gmail.com
109+
\ntwistedappdeveloper@gmail.com
110+
</string>
103111
<string name="nonsupportato">Not Supported</string>
104112
<string name="protocollononsupportato">The only transport protocol that can be used at the moment with this application is the tcp protocol.\nChoose a opc.tcp endpoint</string>
105113
<string name="sottoscrizioniscadute">Some subscriptions have expired</string>

0 commit comments

Comments
 (0)