java
Jsch on Android
May 9th
Jsch works on android. With the only dependency, jzlib, satisfied the java based implementation of ssh is beginning to code relatively straight forward. After many days of trial and error the correct syntax to the commands, and the methods of particular classes are beginning to make sense. Password login is relatively straight forward, and with a little bit of encryption added to the internal storage location the password should be relatively secure on a mobile device. Ultimately the goal is to create an RSA key on the mobile device, connect initially with a password, and add the public key to the authorized keys file. Then the key on the device can bypass password login altogether.
Right now I have several ssh connections, running various commands, operating in background threads. I’m working on displaying progress bars to add a ui to the connection process. Ultimately the final ssh command will generate output to populate several views in a new activity.
Yes it would be nice for Jsch to have more documentation, but compared to the size, and dependencies requirements, of other java based ssh packages I find the Jsch package well consolidated and not dependency heavy.
Android – Java Avoid Deleting Then Recreating
May 1st
If an application has an object that has been created, and displayed to the screen then it is deleted, it cannot be immediately recreated. Recent experience tells me that either the variable has to be re-initialized or use another technique to remove it from the screen. Lets say there are 10 buttons on the screen. Only 2 of them are to be displayed. Each button can have a settings variable that referrs to the buttons active state that can in turn set the objects visibility. For example:
By default all buttons will be off. Then to display a new button toggle the on/off setting and update the view with show/hide methods of the respective class (ie. TableLayout, TableRow). All you really have to do is hide the TableRow and not the object in it. Just remeber when you hide the row reset the settings of the respective option to default.