Found 2041 Articles for Mobile Development

How to send an attachment in email using Swift(ios)?

Mohtashim M
Updated on 23-Oct-2019 09:05:25

2K+ Views

Knowing how to send attachments in the email is very important since most of the application has sharing features. Hence having hands-on experience is important.In this post, we will be seeing how to send an attachment in the mail using Swift.So, let’s get started.For this, we will be using MFMailComposeViewController, which is a standard view controller, whose interface lets the user manage, edit, and send email messages.You can read more about it here https://developer.apple.com/documentation/messageui/mfmailcomposeviewcontrollerWe will also be using MFMailComposeViewControllerDelegate to handle results from MFMailComposeResult.You can read about it here https://developer.apple.com/documentation/messageui/mfmailcomposeviewcontrollerdelegateWe will be creating one sample application to understand, Step 1 ... Read More

How to call a method after a delay in Swift(iOS)?

Mohtashim M
Updated on 23-Oct-2019 08:40:00

2K+ Views

In this post, we will be seeing how you can delay a method call using Swift. Here we will be seeing how you can achieve the same in two ways, So let’s get started, We will be seeing both the example in Playground, Step 1 − Open Xcode → New Playground.In the first approach, we will be using asyncAfter(deadline: execute:) instance method, which Schedules a work item for execution at the specified time and returns immediately.You can read more about it here https://developer.apple.com/documentation/dispatch/dispatchqueue/2300020-asyncafterStep 2 − Copy the below code in Playground and run, func functionOne() {    let delayTime = ... Read More

How to rotate an image in imageview by an angle on iOS App using Swift?

Mohtashim M
Updated on 23-Oct-2019 08:36:31

4K+ Views

Images are everywhere almost in all application, you might have come across many applications like gaming applications where you see images getting rotated.So, In this post, we will be seeing how to rotate the image in an image view by an angle in an iOS application.So, Let’s get started, Step 1 − Open Xcode→SingleViewApplication→name it RotateImage.Step 2 − Open Main.storyboard, add UIImageView and add 2 buttons as shown below name them ROTATE BY 90 DEGREES AND ROTATE BY 45 DEGREES. Add some sample images to UIImage View.Step 3 − Create @IBAction for both buttons and name them as rotate45button and ... Read More

How to convert a color integer to a hex String in Android?

Azhar
Updated on 07-Jul-2020 11:44:56

3K+ Views

This example demonstrates how do I 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.widget.TextView; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);       TextView textView = findViewById(R.id.textView);       int intColor = -16895234;       String hexColor = ... Read More

How can I override the 'Home' button in my Android App?

Azhar
Updated on 07-Jul-2020 11:40:42

581 Views

This example demonstrates how do I 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.widget.Toast; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main);    }    @Override    protected void onUserLeaveHint(){       Toast.makeText(getApplicationContext(), "Home Button is Pressed", Toast.LENGTH_SHORT).show();       ... Read More

How to get the Android Emulator's IP address?

Azhar
Updated on 23-Oct-2019 08:34:58

839 Views

This example demonstrates how do I get the Android Emulator’s IP address.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.net.wifi.WifiManager; import android.os.Bundle; import android.text.format.Formatter; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    Button button;    TextView textview;    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.activity_main); ... Read More

How to add a button to PreferenceScreen in Android?

Azhar
Updated on 07-Jul-2020 09:14:41

1K+ Views

This example demonstrates how do I add a button to PreferenceScreen in android.Step 1 − Create a new project in Android Studio, go to File rArr; 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.os.Bundle; import android.widget.Toast; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; public class MainActivity extends AppCompatActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main_activity);       getSupportFragmentManager().beginTransaction().replace(R.id.settings, new SettingsFragment()).commit();       ... Read More

How to upgrade your smartphone to android m

Samual Sam
Updated on 13-May-2022 07:21:27

75 Views

The latest version of Android, Android Marshmallow, is often referred to as Android M. Android M comes with a lot of new cosmetic upgrades for the phones along with many bug fixes. Android M comes with new features like refined permissions, simplified volume controls, improved copy and paste function, Google Now on Tap, and Android Pay.Not only that, it also has an built-in fingerprint scanning support and many other new enhancements which makes it a highly desired smartphone OS in 2016. Android M, being the desired smartphone OS used by the majority of the community, is almost a must-have for ... Read More

How do you animate the change of background color of a view on Android?

Azhar
Updated on 03-Jul-2020 13:22:59

1K+ Views

This example demonstrates how do I animate the change of background color of a View 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 src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.TransitionDrawable; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity {    TextView textView;    Button button;    @Override    protected void onCreate(Bundle savedInstanceState) {   ... Read More

How to change font face of Webview in Android?

Azhar
Updated on 03-Jul-2020 13:22:13

1K+ Views

This example demonstrates how do I change font face of 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  – Create an assets folder. Right click asset folder >> Create a new file (webView1.html) and the following code: WebView9    @font-face {       font-family: 'Font';       src:url("file:///android_asset/Font.otf")    }    body {       font-family: 'Font', serif;       ... Read More

Advertisements