German Und schon wieder ein neuer

t0mt0m

Member
Licensed User
Longtime User
Hallo zusammen,

ich bin der Tom und habe recht wenig Ahnung vom Programieren. Ich habe mir das Programm allerdings direkt gekauft, da ich Eclipse zu kompliziert finde.

Ich habe es allerdings geschafft, durch dieses Forum eine App zu bauen, die meinen internen Browser vom Gerät zu öffnen und eine Rufnummer die ich in die App fest in den Quellcode implementiere anzurufen.

Nun habe ich vor, die Anmeldedaten direkt in den Browser zu übertragen, damit ich die nicht über die Handytastatur eingeben muss.

Hier der Code von der Webseite. Diese soll mit dem Standardbrowser vom Gerät geöffnet werden und in die entsprechenden Felder soll der Benutzername und das Passwort eingetragen werden. wenn dann noch der Automatische Login klappen würde, wäre es perfekt.

Die Seite ist mein Schichtplan.
B4X:
window.onerror=do_nothing;
    function do_nothing()
    {
      return false;
    }
    
    if (parent.LID === "" || isNaN(parent.LID)) parent.LID = "1031";
   var Lang =
   {
      LangIds: new Array(1031, 1033, 3082, 1036, 1040, 1053, 2057, 2070, 1043, 1044, 1049, 1045, 1024, 1055, 1035),

      Get: function()
      {
         for (var Index in this.LangIds)
         {
            var Id = this.LangIds[Index];
            if (top.location.search.indexOf(Id) != -1)
            {
               return Id;
            }
         }
         return 1031;
      }
   }

    logoutLang=0+parseInt("");
    if (isNaN(logoutLang)) logoutLang = Lang.Get();

    function init()
    {
      var ExtLoginPath="";
               
      if (ExtLoginPath != "")
      {
         parent.window.location.href = ExtLoginPath;         
      }
      else
      {
         detectbrowser();
         document.login.bws.value=browser;
         changeLang(parent.LID);
         document.login.uname.focus();
         setLoginBox();         
      }
    }

    function setLoginBox()
    {
        topLoginBox=(document.body.clientHeight/2)-120;
        leftLoginBox=(document.body.clientWidth/2)-160;
        document.getElementById("divLogin").style.top=topLoginBox;
        document.getElementById("divLogin").style.left=leftLoginBox;
    }

    function changeLang(_mLang)
    {
        if (_mLang=="1045")
        {
            document.charset="windows-1250";
            document.charachterSet="windows-1250";
        }
        else if (_mLang=="1049")
        {
            document.charset="windows-1251";
            document.charachterSet="windows-1251";
        }
        else
        {
            document.charset="iso-8859-1";
            document.charachterSet="iso-8859-1";
        }
        document.login.usrlang.value=_mLang;

        document.login.name.title=document.getElementById("_name").innerHTML;
        document.getElementById("_name").innerHTML=_formTooltip[_mLang][0];
        document.login.uname.title=document.getElementById("_name").innerHTML;
        document.getElementById("_name").innerHTML=_formTooltip[_mLang][1];
        document.login.upwd.title=document.getElementById("_name").innerHTML;
        document.getElementById("_name").innerHTML=_formTooltip[_mLang][2];
        document.login.usrlang.title=document.getElementById("_name").innerHTML;

        document.getElementById("_ok").innerHTML=_formTrans[_mLang][3];
        document.getElementById("_name").innerHTML=_formTrans[_mLang][0];
        document.getElementById("_password").innerHTML=_formTrans[_mLang][1];
        document.getElementById("_lang").innerHTML=_formTrans[_mLang][2];
        document.getElementById("_infothek_login").innerHTML=_formTrans[_mLang][4];

        if (browser==1) document.recalc();
    }

   function getIEVersionNumber()
   {
       var ua = navigator.userAgent;
       var MSIEOffset = ua.indexOf("MSIE ");
       if (MSIEOffset == -1) {
           return 0;
       } else {
           return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
       }
   }

    function CheckEnter(e, chkEnter)
    {
      var code = 0;

      if (e.keyCode) code = e.keyCode;
      else if (e.which) code = e.which;

      var ie = getIEVersionNumber();

      if (code==13 || chkEnter == 0)
        {
         if(document.login.uname.value == '' || document.login.upwd.value == '')
         {
            top.window.location="/isps/plugins/shtml/"+document.login.failtarget.value+"?usrlang="+document.login.usrlang.value+"&status="+3;
            return;
         }

         if(ie > 0) {
            document.login.fireEvent('onsubmit');
         }
         parent.uname = document.login.uname.value;
         parent.upwd = document.login.upwd.value;
         parent.LID = document.login.usrlang.value;
         parent.target = document.login.target.value;
         parent.failtarget = document.login.failtarget.value;
         parent.usrsys = 0;
         parent.bws = document.login.bws.value;

         document.login.submit();
        }
      return;
    }

   window.onunload=parent.doLogin;

Hier der Code von meiner App.

Die Rufnummern sind natürlich nicht richtig

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
         'These variables can only be accessed from this module.
   Dim link As String
   link= "http://wfm.xxxxxxxxxxxx.net/isps/infothek/index.html"
   Dim btnInvision As Button
   Dim btnCall1 As Button
   Dim btnCall2 As Button
   Dim btnCall3 As Button
   End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("Tectum")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub btnInvision_Click
   Dim i As Intent
   i.Initialize(i.ACTION_VIEW,link)
   StartActivity(i)
End Sub
Sub btnCall1_Click
    Dim result As Int
        result = Msgbox2("Teamleiter Handy", "Soll der Teamleiter im Erdgeschoß angerufen werden ?", "Ja", "", "Nein", Null)
    If result = DialogResponse.Positive Then 
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:+492311234567")
    StartActivity(i)
    End If
End Sub
Sub btnCall2_Click
    Dim result As Int
        result = Msgbox2("Teamleiter Handy", "Soll der Teamleiter im 1.Obergeschoß angerufen werden ?", "Ja", "", "Nein", Null)
    If result = DialogResponse.Positive Then 
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:+492311234568")
    StartActivity(i)
    End If
End Sub
Sub btnCall3_Click
    Dim result As Int
        result = Msgbox2("Teamleiter Handy", "Soll der Teamleiter im 3.Obergeschoß angerufen werden ?", "Ja", "", "Nein", Null)
    If result = DialogResponse.Positive Then 
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:+492311234569")
    StartActivity(i)
    End If
End Sub


Vielleicht kann mir ja geholfen werden.

LG an alle Tom
 
Last edited:

umsid

Member
Licensed User
Longtime User
Du solltest deinen Source evtl. zum Download als ZIP File bereitstellen.
Ich denke niemand macht sich die Mühe das abzutippen, oder sich einzulesen.

Gesendet von meinem GT-I9300 mit Tapatalk 2
 

t0mt0m

Member
Licensed User
Longtime User
Das verstehe ich nicht, der Source der App ist doch komplett. wenn ich das angebot bekomme, dass mir jemand helfen mag, würde ich sogar reale zugangsdaten zur verfügung stellen. allerdings nicht öffentlich. Die gibt es nur per pn
 

t0mt0m

Member
Licensed User
Longtime User
Das hab ich noch gefunden:

B4X:
<body onLoad="init();" onkeypress="CheckEnter(event, 1);" class="LoginForm DialogueBox">
   <form name="login" action="/isps/plugins/shtml/infothek/login.html" method="POST" onsubmit="return false;">
    <input type="hidden" name="target" value="/infothek/intro_2.html">
    <input type="hidden" name="failtarget" value="loginfailinf1.html">
   <input type="hidden" name="bws" value="0">
    <div id="divLogin">
       <table class="Centerer">
         <tr>
           <td>
            <div class="BoxOnPage">
                <h1><span id="_infothek_login"></span></h1>
              <table>
                <tr>
                    <td class="Text" height=32><span id="_name"></span></td>
                    <td class="Text"><input name=uname type=text size=15 class="Text" help="Enter your user name here."></td>
                </tr>
                <tr>
                    <td class="Text" height=32><span id="_password"></span></td>
                    <td class="Text"><input name=upwd type=password size=15 class="Text" help="Enter your password here."></td>
                </tr>
                   <tr>
                    <td><span id="_lang"></span></td>
                    <td>
                    <select onchange="changeLang(this.value);" onkeyup="this.blur();this.focus();" name="usrlang" size="1" class="Text">
                            <option value="2057" >English UK</option>
                            <option value="1033" >English US</option>
                            <option value="1031" selected>Deutsch</option>
                            <option value="3082" >Español</option>
                            <option value="1036" >Français</option>
                            <option value="1040" >Italiano</option>
                            <option value="1043" >Nederlands</option>
                     <option value="1044" >Norsk</option>
                            <option value="2070" >Portugu&ecirc;s</option>
                            <option value="1053" >Svenska</option>
                            <option value="1045">Polski</option>
                            <option value="1049">Русский</option>
                     <option value="1055">T&uuml;rk&ccedil;e</option>
                     <option value="1035">Suomi</option>
                    </select>
                    </td>
                </tr>
                <tr>
                  <td></td>
                  <td>
                        <!-- "Ok" button -->
                        <a href="#" onclick="CheckEnter(event, 0); return false;" class="FaceButton100" id="_ok" style="margin-left:0;"></a>
                  </td>
                </tr>
              </table>
            </div>
        </td>
    </tr>
</table>
</div>
    </form>
</body>
 
Top