diff --git a/android/res/raw/index.html b/android/res/raw/index.html
index ddb98a5..607d662 100644
--- a/android/res/raw/index.html
+++ b/android/res/raw/index.html
@@ -4,38 +4,42 @@
+
pw3270
-
+
+
- COEM7010 SISBB - Sistema de Informacoes Banco do Brasil 06/07/2012
- C1103788 Correio Eletronico 15:29:03
- ----------------------- Indicadores - Ler Matéria ------------------ Pag.: 1
- Período:a (Alteravel) Parte título:
-
- Assunto:(+)
- Nr. Título Data Hora
- ---- ------------------------------------------------------------- -----------
- 1 Rentabilidade fundos BB 06/07 00:00
- 2 Rentabilidade comparada fundos BB 06/07 00:00
- 3 Indices Economicos 06/07 00:00
- 4 ACF - ADIANTAMENTO DE CONTRATO DE FORNECIMENTO - 06-07-2012 06/07 00:00
- 5 CDF - CRÉDITO DIRETO AO FORNECEDOR - 06-07-2012 06/07 00:00
- 6 Depositos a Prazo - Taxas Pos Fixadas 06/07 00:00
- 7 Depositos a Prazo - Entes Publicos - Taxas Negociadas 06/07 00:00
- 8 Depositos a Prazo - Taxas não Negociadas 06/07 00:00
- 9 Depositos a Prazo - Nivel 2 - Taxas Negociadas 06/07 00:00
- 10 Depositos a Prazo - Nivel 1 - Taxas Negociadas 06/07 00:00
- 11 Depositos a Prazo - Taxas não Negociadas - BB CDB DI PARCERIA 06/07 00:00
- 12 Inadimplemento - Comissão de Permanência - 06/07/2012 06/07 00:00
- Informe número (Nr.):
- ------------------------------------------------------------------------------
- F1 Ajuda F9 Origem
- SaiSeleciona(+)EncerraImprimePag.AntProx.Pag
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/res/raw/jsmain.js b/android/res/raw/jsmain.js
index e69de29..f5ab167 100644
--- a/android/res/raw/jsmain.js
+++ b/android/res/raw/jsmain.js
@@ -0,0 +1,28 @@
+
+function initialize()
+{
+ updateScreen();
+}
+
+function updateScreen()
+{
+ document.getElementById("terminal").innerHTML = pw3270.getscreencontents();
+}
+
+function pfkey(id)
+{
+ pw3270.pfkey(id);
+ return false;
+}
+
+function xmit()
+{
+ pw3270.xmit();
+ return false;
+}
+
+function eraseinput()
+{
+ return false;
+}
+
diff --git a/android/res/raw/theme.css b/android/res/raw/theme.css
index f8069f3..57a5aef 100644
--- a/android/res/raw/theme.css
+++ b/android/res/raw/theme.css
@@ -2,6 +2,7 @@
body
{
background-color: black;
+ color: green;
}
body, input
@@ -55,3 +56,30 @@ input[type="text"]
width: 24em;
}
+#pfbar
+{
+ width: 49em;
+ background: black;
+ color: white;
+ text-align: center;
+ border-top: 1px solid #fff;
+}
+
+a
+{
+ text-decoration: none;
+ color: black;
+}
+
+.pfkey
+{
+ margin: 1px;
+ background: gray;
+ color: black;
+ width: 4em;
+ border: 1px solid darkgray;
+ text-decoration: none;
+ font-size: 15px;
+ font-family: arial;
+ display: inline-block;
+}
diff --git a/android/src/br/com/bb/pw3270/PW3270Activity.java b/android/src/br/com/bb/pw3270/PW3270Activity.java
index 51c22fd..ccefb69 100644
--- a/android/src/br/com/bb/pw3270/PW3270Activity.java
+++ b/android/src/br/com/bb/pw3270/PW3270Activity.java
@@ -19,19 +19,18 @@ import java.io.InputStream;
public class PW3270Activity extends Activity
{
+ private static final String TAG = "pw3270";
+
private Resources res;
private WebView view;
private terminal host;
- private static final String TAG = "pw3270";
+ private Activity mainact;
private class terminal extends lib3270
{
- Activity Main;
-
- terminal(Activity Main)
+ terminal()
{
- this.Main = Main;
}
protected void updateProgramMessage(int id)
@@ -46,7 +45,7 @@ public class PW3270Activity extends Activity
protected void popupMessage(int type, String title, String text, String info)
{
- AlertDialog d = new AlertDialog.Builder(Main).create();
+ AlertDialog d = new AlertDialog.Builder(mainact).create();
d.setTitle(title);
d.setMessage(text);
@@ -55,26 +54,25 @@ public class PW3270Activity extends Activity
d.show();
}
- protected void redraw()
+ public String getscreencontents()
{
+ String text;
+
try
{
- String text = new String(getText(),getEncoding());
-// Log.i(TAG,text);
- } catch(Exception e) { }
+ text = new String(getHTML(),getEncoding());
+ } catch(Exception e) { text = ""; }
+
+ return text;
+ }
+
+ protected void redraw()
+ {
+ view.reload();
}
-
};
- /*
- private terminal host;
- private EditText uri;
- private Resources res;
- private String[] message;
- private WebView view;
-
-*/
/** Called when the activity is first created. */
@@ -90,6 +88,11 @@ public class PW3270Activity extends Activity
view = new WebView(this);
view.setWebChromeClient(new WebChromeClient());
+
+ view.getSettings().setBuiltInZoomControls(true);
+ view.getSettings().setSupportZoom(true);
+ view.getSettings().setUseWideViewPort(true);
+ view.getSettings().setLoadWithOverviewMode(true);
view.setWebViewClient(new WebViewClient()
{
@@ -99,14 +102,18 @@ public class PW3270Activity extends Activity
{
int id = R.raw.index;
String mime = "text/html";
+ int pos = url.lastIndexOf("/");
+
+ if(pos >=0 )
+ url = url.substring(pos+1);
Log.i(TAG,"Loading [" + url + "]");
- if(url.equalsIgnoreCase("file://jsmain.js"))
+ if(url.equalsIgnoreCase("jsmain.js"))
{
id = R.raw.jsmain;
}
- else if(url.equalsIgnoreCase("file://theme.css"))
+ else if(url.equalsIgnoreCase("theme.css"))
{
mime = "text/css";
id = R.raw.theme;
@@ -120,44 +127,15 @@ public class PW3270Activity extends Activity
});
view.getSettings().setJavaScriptEnabled(true);
-
- setContentView(view);
- view.loadUrl("file://index.html");
-
- // setContentView(R.layout.main);
-// Log.i("pw3270","Activity started");
-
-
-// view = (WebView) findViewById(R.id.view);
+ setContentView(view);
+ view.loadUrl("file:index.html");
-// String summary = "Welcome to pw3270." ;
-
- // res.getString(R.string.hello);
+ host = new terminal();
+ view.addJavascriptInterface(host, "pw3270");
+ host.connect();
- // ;
- // view.loadData("Welcome to pw3270.", "text/html", null);
-
- /*
- message = res.getStringArray(R.array.program_msg);
- uri = (EditText) findViewById(R.id.hostname);
-
- // Set button
- Button btn = (Button) findViewById(R.id.connect);
- btn.setOnClickListener((View.OnClickListener) this);
-
- host = new terminal((TextView) findViewById(R.id.msgbox),this);
-
- */
- }
- /*
- public void onClick(View v)
- {
- // Perform action on click
- // host.setHost(uri.getText().toString());
- host.connect();
}
- */
}
\ No newline at end of file
diff --git a/android/src/br/com/bb/pw3270/lib3270.java b/android/src/br/com/bb/pw3270/lib3270.java
index 8646332..d6d6105 100644
--- a/android/src/br/com/bb/pw3270/lib3270.java
+++ b/android/src/br/com/bb/pw3270/lib3270.java
@@ -313,6 +313,16 @@ public class lib3270
{
}
+ public void pfkey(int id)
+ {
+ Log.i(TAG,"PF "+id);
+ }
+
+ public void xmit()
+ {
+ Log.i(TAG,"XMIT");
+ }
+
/*---[ External methods ]------------------------------------------------*/
public int connect()
--
libgit2 0.21.2