Found 1631 Articles for Android

How to use toLowerCase () in Android textview?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrate about How to use toLowerCase () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.         In the above code, we have taken name as Edit text, when user click on button it will take data and Convert into lower letters.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to use substring () in Android textview?

Smita Kapse
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrate about How to use substring () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and return substring value.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public ... Read More

How to use startsWith () in Android textview?

Anvi Jain
Updated on 30-Jul-2019 22:30:25

227 Views

This example demonstrate about How to use startsWith () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    EditText name;    Button button;    TextView text;    @Override    protected void onCreate(Bundle savedInstanceState) {       ... Read More

How to use split () in Android textview?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrate about How to use split () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and split the data using space regex.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import ... Read More

How to use replaceAll () in Android textview?

Smita Kapse
Updated on 30-Jul-2019 22:30:25

397 Views

This example demonstrate about How to use replaceAll () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and replace space with emptystring.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to use replace () in Android textview?

Anvi Jain
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrate about How to use replace () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and replace all a values withStep 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to use length () in Android textview?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

750 Views

This example demonstrate about How to use length () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken the name as Edit text, when user click on button it will take data and check length of entered value is 0 or more than zero than returns last index of “sai”.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; ... Read More

How to use lastIndexOf () in Android textview?

Anvi Jain
Updated on 30-Jul-2019 22:30:25

254 Views

This example demonstrate about How to use lastIndexOf () in Android textview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.             In the above code, we have taken name as Edit text, when user click on button it will take data and returns last index of “sai”.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; ... Read More

How to parse json string in android?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

1K+ Views

This example demonstrates How to parse JSON string in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken a text view to show the json element name.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.KeyguardManager; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.KeyEvent; import android.widget.TextView; import ... Read More

How to get system data directory information in android?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

510 Views

This example demonstrate about How to get system data directory information in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. In the above code, we have taken text view to show data directory information.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.app.KeyguardManager; import android.content.Context; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class MainActivity extends ... Read More

Advertisements