Mobile Development Articles - Page 58 of 199

How do I programmatically “restart” an iOS app?

Mohtashim M
Updated on 16-Dec-2019 12:24:41

2K+ Views

You cannot restart an iOS Application in any case, even if you’re able to do using some private api your application will be rejected by Apple and will not be considered for App store release.

How to create a file, write data into it and read data from it on iOS?

Mohtashim M
Updated on 16-Dec-2019 12:23:05

1K+ Views

Being a software developer we should be always aware of how to play with files, write to a file, read from the file and so on.In this post we are going to learn the same, we will be creating a file and writing the data to the file and later reading through the same file.So let’s get started, Step 1 − Create new Xcode Project → Single View Application → name it “ReadingWritingFile”Step 2 − Open ViewController.swift and add new function as show belowpublic func createAndWriteFile() { }Now we will create a file and will print the path of the ... Read More

Difference between 1G and 2G protocols

Kiran Kumar Panigrahi
Updated on 27-Jul-2022 10:21:29

3K+ Views

After the launch of the first generation mobile network in the early 1980s, the mobile wireless communication system has gone through numerous stages of evolution in the last several decades. Because there was such a high demand for new connections throughout the world, mobile communication standards progressed quickly to accommodate more users. In this brief article, let's have a look at the features offered by the early generation mobile standards.1G ProtocolThe first generation of wireless cellular technology is referred to as 1G. These are analog telecommunications standards that were launched in the 1980s and lasted until 2G digital telecommunications superseded ... Read More

How to add a shadow and a border on circular imageView android?

Azhar
Updated on 26-Nov-2019 09:59:21

942 Views

This example demonstrates how to add a shadow and a border on circular imageView androidStep 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.app.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.core.graphics.drawable.RoundedBitmapDrawable; import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.RelativeLayout; import android.os.Bundle; public class MainActivity extends AppCompatActivity ... Read More

How to bind data from a database to an Android CheckBox in a ListView?

Azhar
Updated on 26-Nov-2019 09:55:30

943 Views

This example demonstrates how to bind data from a database to an Android CheckBox in a ListView.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 res/layout/row_item.xml.         Step 4 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import java.util.ArrayList; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    ArrayList dataModels;    ListView ... Read More

How to make a GridLayout fit screen size in Android?

Azhar
Updated on 09-Jul-2020 12:07:43

2K+ Views

This example demonstrates how How to make a GridLayout fit screen size 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 com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.Gravity; import android.widget.GridLayout; import android.widget.ImageView; ... Read More

How to Justify Text in TextView in Android?

Azhar
Updated on 26-Nov-2019 09:45:20

826 Views

This example demonstrates how to Justify Text in TextView on 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 res/layout/list_item.xml             Step 4 − Add the following code to src/MainActivity.javapackage com.app.sample; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.os.Bundle; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity {    private final String TAG = "MainActivity";    private ... Read More

How to detect user inactivity for 5 seconds in Android?

Azhar
Updated on 26-Nov-2019 09:37:18

1K+ Views

This example demonstrates how to detect user inactivity for 5 seconds 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 com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.os.Handler; import android.widget.Toast; public class MainActivity extends AppCompatActivity {    Handler handler;    Runnable r;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       handler = ... Read More

How to scale an Image in ImageView to keep the aspect ratio in Android?

Azhar
Updated on 26-Nov-2019 08:15:19

1K+ Views

This example demonstrates how to scale an Image in ImageView to keep the aspect ratio 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 com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       ImageView my_image = (ImageView) findViewById(R.id.my_image);   ... Read More

How to support different screen size in Android?

Azhar
Updated on 26-Nov-2019 08:12:25

1K+ Views

This example demonstrates how to support different screen sizes 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 com.app.sample; import androidx.appcompat.app.AppCompatActivity; import android.util.DisplayMetrics; import android.widget.TextView; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       DisplayMetrics metrics = new DisplayMetrics();       ... Read More

Advertisements