Found 1957 Articles for Mobile Development

Capture picture from iOS camera using Swift

Samual Sam
Updated on 30-Jun-2020 05:35:25
To capture pictures from a camera in swift we can use AVFoundation which is a framework in iOS SDK, but we should try to avoid using it until we need a lot of custom features in our camera application. In this example, we’ll only capture a picture from the camera and display it on the view. We’ll be using image picker in this example instead of AVFoundation.First, create a project and add an image view on its view Controller in the storyboard. Create the outlet in its class. Now inside the ViewController class conform it to −class ViewController: UIViewController, UIImagePickerControllerDelegate, ... Read More

How to access RESTFul services from iOS/iPhone?

karthikeya Boyini
Updated on 30-Jun-2020 05:43:40
To access REST APIs in swift we need to go through a series of steps using the native way of networking in swift, that is using URL sessions and Data Tasks.Rest stands for Representational State Transfer, which defines some set of constraints that are to be used by web services. In swift, we can access web services in the following way.First of all, we need to create a session object, which default configuration.let configuration = URLSessionConfiguration.default let session = URLSession(configuration: configuration)Then we need to create an URL Request of The type we need, it can get, post, delete or put. ... Read More

How to use Swift to run in background to provide current location?

Samual Sam
Updated on 30-Jul-2019 22:30:24
To get background location in swift we need to go through a few stepsGet the permissions from the user, in your info.plist file add Privacy- Location always andwhen in usage Description, Privacy – When in usage description and add their respective description.After that, you need to import the CoreLocation framework which will enable you to use all the location related libraries and methods. Then you need to get permission from the user to use the location. For that, we need to create a CLLocationManager Object and get authorization.var locationManager: CLLocationManager? override func viewDidLoad() { super.viewDidLoad() ... Read More

How to develop or migrate apps for iPhone 5 screen resolution?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24
At the release of iPhone 5, it’s resolution and aspect ratio was different (640 x 1136 pixels), hence it was tough to migrate applications from iPhone 4 sizes to the newer iPhone. But later with the release of iOS 8, size classes and abstract screen sizes were also introduced to make it easier. As of now, applications for almost all sizes can be developed with Xcode storyboard editor.Apart from storyboard editor, you can also change the launch image. Let’s see the first method.Change the launch image to Default-568h@2x.png. Change the size to be 1136x640.Go to info.plist and remove the value ... Read More

How to send an attachment in email using Swift?

Samual Sam
Updated on 30-Jun-2020 05:44:32
To send an email from our iPhone device using our application we need to import the MessageUI framework of iOS SDK. After importing the framework in your application, drag and drop a button on the view controller. Add empty action for that button.Now add the following code in your view controller.funccomposeEmail(to email: String, subject: String, Body: String) {    if( MFMailComposeViewController.canSendMail()) {       letmailComposer = MFMailComposeViewController()       mailComposer.mailComposeDelegate = self       mailComposer.setToRecipients([email])       mailComposer.setSubject(subject)       mailComposer.setMessageBody(Body, isHTML: true)       letpathPDF = "\(NSTemporaryDirectory())result.pdf"       if let fileData ... Read More

How to sort Strings on an Android RecyclerView?

Chandu yadav
Updated on 30-Jul-2019 22:30:24
Before getting into Sort array list elements for recycler view example, we should know, what is Recycler view in android. Recycler view is a more advanced version of the list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrates how to integrate Sorted Recycler View by creating a beautiful student records app that displays student name with age.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 − Open ... Read More

How to set random background for Recyclerview in Android?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24
Before getting into set random background color for recycler view example, we should know what is Recycler view in android. Recycler view is a more advanced version of the list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrates How to set the random background for Recyclerview by creating a beautiful student records app that displays student name with age.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 ... Read More

Android Working with Recycler View

Ankith Reddy
Updated on 30-Jul-2019 22:30:24
Recycler view is a more advanced version of listview and works based on View holder design pattern. Using recyclerview we can show grids as well as a list of items.This example demonstrates how to integrate RecyclerView by creating a beautiful student records app that displays student name with age.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 − Open build.gradle and add Recycler view library dependency.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.tutorialspoint"   ... Read More

How to use Android ViewPager?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24
Before getting into the example, we should know what is view pager in android. View pager found in Support Library in Android, using view pager we can switch the fragments.This example demonstrates how to use android view pager.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 in build.gradle.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       minSdkVersion 19       targetSdkVersion 28       versionCode ... Read More

How to change package name in android?

Chandu yadav
Updated on 30-Jul-2019 22:30:24
Here are the simple steps to change the package name in android .Click on your pack name(in source tree). -> Right Click --> Refractor -> Rename as shown below -Click on rename, it will show pop up as shown below -Click on Rename package, it will show new pop up as shown below -Now change the name as per requirement and click on refractor as shown below -Now it will check all files and asks for refractor as shown below -In the below of Android studio, there is "do Refractor button". click on it. Now open your build.gradle as shown ... Read More
Advertisements