BREAKING:

Android – Types of EditText

After updating my ADT to ADT 11.0, i got just a little surprise that Android has tried a lot to make developer’s life easy to design UI. I have found one great things i.e. Android has provided different EditText to enter suitable information like EditText for Phone Number, EditText for Email, EditText for Time, EditText […]

Read More

Android – Vibrate the phone programmatically

Hi, I came across to making phone vibrate when user change the orientation from portrait to landscape or viceversa. So How do we make phone vibrate programatically in android? Code: // vibration for 800 milliseconds ((Vibrator)getSystemService(VIBRATOR_SERVICE)).vibrate(800); Required permission to add inside the AndroidManifest.xml file: <uses-permission android:name="android.permission.VIBRATE" />

Read More

Android – ListView => setEmptyView()

Today I came across this setEmptyView() method of ListView. Many times it happens that we make a call on web service and we receive nothing in response at that time listview is displayed blank. At that time we should display messages like: No Records Found. No Data Found. No Items Found. How do we handle […]

Read More

Android – Enable and Disable Wifi programmatically

Hi, Here i am going to write about “How do we Enable and Disable Wifi programmatically in android application?” To Enable WiFi: To Disable WiFi: Note: To access with WiFi state, we have to add following permissions inside the AndroidManifest.xml file:

Read More

Android – Hide Title bar and Notification bar

Hi, Here i am going to discuss about on making activity full-screen by hiding Title bar and notification bar from the activity.  So question here is: Android – How do we hide Title bar? //write before setContentView() this.requestWindowFeature(Window.FEATURE_NO_TITLE); Android – How do we hide Notification bar? //write before setContentView() this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); OR And yes, we […]

Read More

Android – Get Brand name and Device name

Here I am going to show how to fetch some device values: 1. Brand name of Android device (SDK Says:  The Brand the software is customized, if any) => Build.BRAND 2. Model number of Android device (SDK Says: Device name of Industrial Design) => Build.DEVICE For exaple: TextView txtView = (TextView) findViewById(R.id.textView1); txtView.setText("n Brand => "+Build.BRAND); txtView.append("n […]

Read More

Android – Retrieve phone number

Hi, How do we fetch phone number to use inside our application? By using below code we can retrieve the phone number: TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String mblNumber = mTelephonyMgr.getLine1Number(); Note: Dont forget to add READ_PHONE_STATE permission to be added inside the AndroidManifest.xml file: <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> FYI, i have tested this in my […]

Read More