Found 2041 Articles for Mobile Development

How to use both front and back cameras simultaneously in iOS?

Mohtashim M
Updated on 07-Aug-2019 14:06:56

223 Views

As of now, there’s no way you can access both front and back cameras simultaneously. As both cameras have different session, as soon as one will start other session will die.As per the apple developer forum answered by Apple support team −“Apps cannot capture from the front and back cameras simultaneously. You can switch from one to the other (with a short delay between) but not both at the same time”

How to programmatically set drawableLeft on Android button?

Azhar
Updated on 01-Jul-2020 07:48:12

5K+ Views

This example demonstrates how do I programmatically set drawableleft 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 android.graphics.drawable.Drawable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Button; public class MainActivity extends AppCompatActivity {    Button button;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       button = findViewById(R.id.button);       Drawable ... Read More

How to check if an iOS program is in foreground or in background?

Mohtashim M
Updated on 07-Aug-2019 14:06:28

591 Views

Knowing when the application is in foreground or in background is important as being an iOS developer we need to handle multiple events such as background downloads, events if the app comes to foreground.Here we will see how to check if the application is in background or foreground.We will be using Notification Center for that, To read more about it you can refer apple document. https://developer.apple.com/documentation/foundation/notificationcenterA notification dispatch mechanism that enables the broadcast of information to registered observers. We will be adding observer to the same and will be getting the call.Step 1 −  Open Xcode → New Project → Single ... Read More

How to lock screen orientation on all android devices programmatically?

Azhar
Updated on 01-Jul-2020 07:48:49

1K+ Views

This example demonstrates how do I lock screen orientation on all android devices programmatically.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 android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       int currentOrientation = getResources().getConfiguration().orientation;     ... Read More

How do I create a TableView with rounded corners in iOS?

Mohtashim M
Updated on 07-Aug-2019 14:05:02

2K+ Views

Table View is one of the most important and fundamental part of iOS application, Every iOS developer should be familiar with it.Almost every application you see in App store use table view.Table views on iOS display a single column of vertically scrolling content, divided into rows. Each row in the table contains one piece of your app’s content. For example, the Contacts app displays the name of each contact in a separate row, and the main page of the Settings app displays the available groups of settingsYou can read more about table view here,  https://developer.apple.com/documentation/uikit/uitableviewIn this post we will see ... Read More

How to set margin of ImageView using code in Android?

Azhar
Updated on 01-Jul-2020 07:49:26

915 Views

This example demonstrates how do I set margin of ImageView using code 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 – Copy an image file and paste in the res/drawableStep 4 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.ImageView; import android.widget.RelativeLayout; public class MainActivity extends AppCompatActivity {    ImageView imageView;    @Override    protected void onCreate(Bundle savedInstanceState) {   ... Read More

How to detect user pressing HOME key in iOS?

Mohtashim M
Updated on 07-Aug-2019 13:59:26

260 Views

It is very important to know when user is pressing home key as it puts the application to background, here we will be seeing how to identify or get a call when user presses home key.In you AppDelegate.swift, there are delegates methods.Open your AppDelegate.swift and in applicationWillResignActive(_ application: UIApplication) and applicationDidEnterBackground(_ application: UIApplication), write print statement and put a breakpoint as shown.Run the application, once the app is launch tap the home button, applicationWillResignActive will be called and then applicationDidEnterBackground.

How can I create custom button in Android using XML Styles?

Azhar
Updated on 01-Jul-2020 07:38:38

3K+ Views

This example demonstrates how do I create custom button in Android using XML Styles.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 – Right Click on res/drawable, Select new → Drawable resource file and add the following code in custom_dialog.xml         Step 4 – Right Click on res/drawable, Select new → Drawable resource file and add the following ... Read More

How to control the width and height of the default Alert Dialog in iOS?

Mohtashim M
Updated on 07-Aug-2019 13:58:48

1K+ Views

There will be instance where you might get a requirement to control / manipulate width and height the Alert while developing iOS application. If you’re not familiar with the same, it can trouble you.Here we will be seeing how to control the width and height of default alert box, For controlling the height and width we will be using NSLayoutConstraint.To read more about UIAlertController refer − https://developer.apple.com/documentation/uikit/uialertcontrollerIn this, we will be creating a new project where we will have a button, on tapping that button we will show alert with custom message.Step 1 − Open Xcode → New Project → Single ... Read More

How to get a working vertical seekBar in Android?

Azhar
Updated on 01-Jul-2020 07:39:32

1K+ Views

This example demonstrates how do I get a working vertical seekBar 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 android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.SeekBar; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    SeekBar seekBar;    TextView textView;    int min = 0, max = 100, current = 50;    @Override    protected ... Read More

Advertisements