- Home
- Archives
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 […]
-
Paresh Mayani
- June 9, 2011
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" />
-
Paresh Mayani
- June 8, 2011
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 […]
-
Paresh Mayani
- June 8, 2011
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:
-
Paresh Mayani
- June 8, 2011
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 […]
-
Paresh Mayani
- June 7, 2011
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 […]
-
Paresh Mayani
- June 7, 2011
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 […]
-
Paresh Mayani
- June 7, 2011
Search
Explore Topics
Short Stories
From Payroll to People: The Evolution of
- 7 min read
How to Host a Web App :
- 6 min read
Why Hiring a Flutter Developer is the
- 10 min read