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:...

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,...

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);...

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...

Android – Retrieve Device’s SDK version and API level

|

Ques:How do i fetch device’s SDK version and API level number? Ans: Build.VERSION.SDK_INT => To know API Level number i.e. 7,8,9 Build.VERSION.RELEASE => To know version code i.e. 2.1, 2.2, 2.3, 3.0 For your info, // SDK_INT is only available in 1.6 and in newer // REALEASE works on every...