Found 2041 Articles for Mobile Development

Subscript and SuperScript a string in Android?

Azhar
Updated on 03-Jul-2020 13:24:32

895 Views

This example demonstrates how do I Subscript and SuperScript a 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.     Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.style.RelativeSizeSpan; import android.text.style.SubscriptSpan; import android.text.style.SuperscriptSpan; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    TextView textView;    String strText;    SpannableStringBuilder spannableStringBuilder;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState); ... Read More

Working with Recycler View in Android App

Azhar
Updated on 03-Jul-2020 13:23:47

519 Views

This example demonstrates about Working with Recycler View in Android AppStep 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 app.com.sample; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity {    private List movieList = new ArrayList();    private MoviesAdapter mAdapter;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState); ... Read More

Sending an Intent to browser to open specific URL in Android?

Azhar
Updated on 03-Jul-2020 13:25:15

5K+ Views

This example demonstrates how do I send an Intent to browser to open specific URL 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.     Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    }    public void GetUrlFromIntent(View view) ... Read More

How can I save a HashMap to Shared Preferences in Android?

Azhar
Updated on 03-Jul-2020 13:25:51

1K+ Views

This example demonstrates about How can I save a HashMap to Shared Preferences 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.                 Step 3  − Add the following code to src/MainActivity.javapackage app.com.sample; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import org.json.JSONObject; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Objects; public class MainActivity extends AppCompatActivity {    final String ... Read More

Create Left to Right slide animation in Android?

Azhar
Updated on 03-Jul-2020 13:16:09

2K+ Views

This example demonstrates how do I create left to right side animation 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.                 Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.transition.Slide; import android.transition.TransitionManager; import android.view.Gravity; import android.view.View; import android.widget.Button; import android.widget.RelativeLayout; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    Button btnSlideLeft, btnSlideRight;    TextView textView, textView1;    RelativeLayout relativeLayout;   ... Read More

How can I make a horizontal ListView in Android?

Azhar
Updated on 03-Jul-2020 13:15:26

2K+ Views

This example demonstrates about How can I make a horizontal ListView 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.     Step 3  − Add the following code to src/MainActivity.javapackage app.com.sample; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity {    private List movieList = new ArrayList();    private MoviesAdapter mAdapter;    @Override    protected void onCreate(Bundle savedInstanceState) {     ... Read More

How to stop screen recording in Android?

Azhar
Updated on 03-Jul-2020 13:16:55

685 Views

This example demonstrates about How to stop screen recording 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. Step 3  − Add the following code to src/MainActivity.javapackage app.com.sample; import android.os.Bundle; import android.view.WindowManager; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,       WindowManager.LayoutParams.FLAG_SECURE);       setContentView(R.layout.activity_main);    } }Step 4  − Add the following code to ... Read More

How to get the web page contents from a WebView in Android?

Azhar
Updated on 03-Jul-2020 13:17:33

717 Views

This example demonstrates how do I get the web page contents from a webView 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.     Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       WebView webView = findViewById(R.id.webView);       webView.loadUrl("http://www.tutorialspoint.com");   ... Read More

How to use facebook SDK in Android studio?

Azhar
Updated on 11-Sep-2019 11:50:10

183 Views

This example demonstrates about How to use facebook SDK in Android studioDownload the SDK from the Maven Central Repository:buildscript { repositories { mavenCentral()}}Compile the latest version of the SDK:dependencies {    implementation 'com.facebook.android:facebook-android-sdk:[5,6)' }Click here to download the project code.

How to open Facebook page from Android app?

Azhar
Updated on 03-Jul-2020 13:09:28

1K+ Views

This example demonstrates about How to open Facebook page from Android app?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 app.com.sample; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import androidx.appcompat.app.AppCompatActivity; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    }    public void fbClick(View view) {     ... Read More

Advertisements