- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2041 Articles for Mobile Development
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
991 Views
GSON is java library, It is used to convert OBJECT to JSON and JSON to Object. Internally it going to work based on serialization and deserialization.This example demonstrates how to convert HASHAMP to JSON using GSON library.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 15 targetSdkVersion 28 versionCode ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
387 Views
Before getting into shared preference apply(), we should know what is shared preferences in android. Using share preference, we can store or retrieve values as key and value pair. There are five different methods are available in share preference as shown below -Edit()- It going to edit shared preference valuescommit()- it going to commit shared preference values in xml fileapply()- It going to commit back changes from editor to shared preference.remove(String key)- It going to remove key and vales from shared preference use key.Put()- It going to put key and values to shared preference xml.A sample example syntax of shared ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
3K+ Views
To add navigation bar programmatically we’ll go through a series of steps that are mentioned below. We’ll be doing this in ViewWillLayoutSubviews method of our viewController.Getting the width of the current View.let width = self.view.frame.widthCreating a navigation bar with the width of our current view and height of 44 px which is the default height of a navigation bar.let navigationBar: UINavigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: width, height: 44))Adding the newly created navigation bar to our view.self.view.addSubview(navigationBar)We can further extend this example to add a title and a button to our View. The complete result should look something ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
5K+ Views
In iOS apps sometimes we need to restrict our text field to take only numbers as an input, this can be done in several ways, let’s see some of them.Method 1: Changing the Text Field Type from storyboard.Select the text field that you want to restrict to numeric input.Go to its attribute inspector.Select the keyboard type and choose number pad from there.Method 2: Programmatically limiting inputs to number.Select the text fieldCreate its outlet in the view controller.Conform the view controller to UITextFieldDelegateSet the text field’s delegateAdd the following functionfunc textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
2K+ Views
Sometimes in our application, we need to hide the status bar, navigation bar, and other things and only show the content we want to display. In this article, we’ll see how to hide the status bar in our application. To hide status bar in our iOS application using swift language we need to go through very basic steps.We can hide the status bar in two general ways. Both of these methods involve a common step.Common StepGo to Your info.plist file.Add a key called “View controller-based status bar appearance” and set its value to NO.This was a common step we’ll use ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
745 Views
In iOS versions previous to 7.0 getting the MAC address of device was possible. But with new iOS version it has been disabled for the apps to access MAC address of the device.When it is accessed or requested on current version of iOS it always returns 02:00:00:00:00:00. This has been implemented by apple because of privacy concerns. If your app needs to uniquely identify a device, apple recommends to use UDID/ UUID instead of MAC. In swift we can useUIDevice.current.identifierForVendor Which as per apple documentation says that, The value of this property is the same for apps that come from ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
142 Views
To create a date object in swift we’ll use DateComponents() of swift. We can do this In two ways. We’ll use Playground to test our code instead of simulator.We’ll use date component and calendar to create a date. We can create date component in two ways.Method 1Creating date using the default initializer of DateComponent().var date = DateComponents.init( calendar: , timeZone: , era: , year: , month: , day: , hour: , minute: , second: , nanosecond: , weekday: , weekdayOrdinal: , quarter: , weekOfMonth: , weekOfYear: , yearForWeekOfYear: )This will ask all the things like calendar type, date, day, month, ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
87 Views
This example demonstrate about How to remove duplications from arraylist using treeset for listview in 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. In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of listview.Step ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
94 Views
This example demonstrate about How to remove duplications from arraylist using linked hashset for listview in 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. In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
105 Views
This example demonstrate about How to remove duplications from arraylist for listview in 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. In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of listview.Step 3 − Add ... Read More