Translate

Sonntag, 20. März 2016

Android Java-Wo ist die APK?

Android-Java-AsyncTask Beispiel

package com.sshapp.tim.sshservershutdownandrestart;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ScrollView;
import android.widget.TextView;

import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;

import java.text.DateFormat;
import java.util.Date;
import java.util.Properties;

public class Main extends AppCompatActivity{

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle("MyApp");
        Button mybutton1 = (Button) 
           findViewById(R.id.mybutton1);
        Button mybutton2 = (Button)
           findViewById(R.id.mybutton2);

        //Set click events        mybutton1.setOnClickListener(new View.OnClickListener(){
            @Override            public void onClick(View view) {
                onRestartClick((Button) view);
            }
        });
        mybutton12.setOnClickListener(new View.OnClickListener(){
            @Override            public void onClick(View view) {
                onShutdownClick((Button) view);
            }
        });
    }

    private void onRestartClick(Button view) {
        new AsyncSSHTask().execute("param1");
    }

    private void onShutdownClick(Button view) {
        new AsyncSSHTask().execute("param1");
    }

    private void ScrollViewDown(){
        ScrollView scrollViewLogging = (ScrollView)
           findViewById(R.id.scrollViewScroll);
        scrollViewLogging.post(new Runnable() {
            public void run() {
                ScrollView scrollViewLogging = (ScrollView)
                   findViewById(R.id.scrollViewScroll);
                scrollViewLogging.fullScroll(View.FOCUS_DOWN);
            }
        });
    }

    private void Log(String text){
        TextView textViewLogging = (TextView)
           findViewById(R.id.textViewLogging);
        String currentDateTimeString = DateFormat. 
           getDateTimeInstance().format(new Date());
        textViewLogging.append(currentDateTimeString + ": "  
           + text + "\n");
        ScrollViewDown();
    }

    public void LogPublic(String text) {
        final String str = text;
        Main.this.runOnUiThread(new Runnable() {
            @Override            public void run() {
                Log(str);
            }
        });
    }

    public class MyAsyncTask extends AsyncTask<String, Integer, 
       Long> {
        @Override        protected Long doInBackground(String... params) {
            try            {
                //Your code here
                return new Long(1);
            }
            catch (Exception ex)
            {
                LogPublic(ex.getMessage());
                return new Long(0);
            }
        }
    }

}

Android-Java-ScrollView nach ganz unten scrollen


ScrollView mScrollView= (ScrollView) findViewById(R.id.mScrollView);
mScrollView.post(new Runnable() { public void run() { mScrollView.fullScroll(View.FOCUS_DOWN); } });

Android-Java-Scrollbar (Zoomen)

ScrollView nutzen, um zu zoomen

Android-Java-Aktuelle Zeit ausgeben

Android-Java-SSH-Fehler Error message 'java.net.SocketException: socket failed: EACCES (Permission denied)'

Android-Java-Toolbar ohne Settings

@Overridepublic boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.    //getMenuInflater().inflate(R.menu.menu_main, menu);    return true;
}
 
entfernen --> Settings (3 Punkte sind weg) 

Android-Java-Toolbar-Überschrift ändern

Android-Java-App-Icon ändern

Samstag, 12. März 2016

C# Assembly-Titel und Version als Anwendungstext setzen

private void Main_Load(object sender, EventArgs e)
        {
            Text = Application.ProductName + " " + Application.ProductVersion;
        }

Fußball live streamen kostenlos und legal, Bundesliga, Champions League etc.

Bestes Jagdspiel weltweit: TheHunter Online

DesktopSearch Neu

DesktopSearch
Software to search in a configured folder.
Software, die im in der Konfiguration angegebenen Ordner sucht.

Version 3 (1.0.0.1):
Download (GDrive)
Download (Dropbox)
Download (Sourceforge)
Plattform: Windows mit .Net 4.5.1

Version 2:
Download (GDrive)
Download (Dropbox)
Download (Sourceforge)
Plattform: Windows mit .Net 4.5.1

Version 1:
Plattform: Windows mit .Net 4.5.1

Aliexpress.com shoppen in China

Coole Whatsapp-Bilder








Donnerstag, 3. März 2016

Favoritenleiste seitlich in Firefox anzeigen


C#-Keinen Close-Button in Winforms anzeigen

private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
{
    get
    {
       CreateParams myCp = base.CreateParams;
       myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON ;
       return myCp;
    }
}
https://stackoverflow.com/questions/7301825/windows-forms-how-to-hide-close-x-button

C# in der "linkesten" Zeile die Reihennummer anzeigen

row.HeaderCell.Value = String.Format("{0}", row.Index + 1);

C#-Eigene Exceptionklasse schreiben

C#-Assemblyversion anzeigen/ auslesen

Application.ProductVersion

Synology High Availabilty (SHA)