Posts

Showing posts from May, 2012

MD5 Encryption in Android

Image
Lets start the tutorial for md5 encryption in android. MD5 is the best practice to handle the secured data like password etc. In android we can able to achieve this using few simple code. Create new android project and copy and paste the below java code. import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class DataEncryptionActivity extends Activity {     String strNormalValue, strEncrytedValue;     EditText edtValue;     Button btnEncrypt;     TextView tvEncrypt;     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);         edtValue = (EditText) this.f

Android Login Email & Password Validation

Image
Here i going to validate the email and password. The complete source code for the LoginValidationProject follow my steps, Create the project with following attributes. Project name          : LoginValidationExample Build Target            : Android 2.1 Application name   : LoginValidationExample Package name         : com.android.dhamu.validation Create Activity       : LoginScreen Step 1:  Rename the main.xml file as login_screen.xml . Copy and paste the below xml coding in it. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >     <TextView         android:id="@+id/textView1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"   

Android TitleBar And CustomTitleBar

This is possible to handle the titlebar and also can able to customize it in android. We can do this via A) Adding xml code in AndroidManifest.xml B) Using java code by programmatically.                                     Working in AndroidManifest.xml Hide the Title Bar Using XML code. If you want to hide the title bar for particular activity, use the below code in AndroidManifest.xml within the <activity> tag.   android:theme = " @android:style/Theme.Black.NoTitleBar " Example:      < activity             android:name = " FirstScreen"             android:label = "@string/app_name"             android:theme = "@android:style/Theme.Black.NoTitleBar " >   Hide the Title Bar and Status Bar Using XML code. If you want to hide the Title Bar and Status Bar for particular activity, use the below code in AndroidManifest.xml within the <activity> tag. android:theme = "@android:style/The