Wednesday, February 29, 2012

Connect to Remote database through SSH using Port Forwarding with Java

Yesterday I need connect connect our remote MySQL database that was setup on SSH enabled server and query database. Since it was on SSH enabled server, we can’t connect it directly using JDBC connection API.To achieve this, we first need to create SSH session and then using Port Forwarding we can forward the request to server and connect to database. I used JSchJSch is a pure Java implementation of SSH2.

Monday, February 27, 2012

Setting the background image of an Android TextView

TextView displays text to the user and optionally allows them to edit it. A TextView is a complete text editor, however the basic class is configured to not allow editing; see for a subclass that configures the text view for editing.
In most cases u want add image as textView background. It's so easy. In layout xml file u must write: