For API above 19 For API from 11 to 18 For API below 11 Check this post to show the image selected from gallery in an imageview.
Special characters can be included in string literals using the following escape sequences: The following example shows how to use a few string literals: Swift 4 Escape sequence Meaning \0 Null Character \\ \character \b Backspace \f Form feed \n Newline \r Carriage return \t Horizontal tab \v Vertical tab \’ Single Quote \” Double Quote \000 Octal… Read More »
We all know that Android only allows primitives types like int, float to be stored in preferences. But we can change this with the help of GSON. If you want to know more about GSON, you can refer my post here… Using GSON in Android – Simple Demo Now, In this demo, I will show you how to… Read More »
To retrieve a count of the characters in a string, call the global countElements function and pass in a string as the function’s sole parameter: prints “sampleString has 32 characters” Note : Different Unicode characters and different representations of the same Unicode character can require different amounts of memory to store. Because of this, characters in Swift do… Read More »
Swift 4 is a type-safe language which means if a part of your code expects a String, you can’t pass it an Int by mistake. As Swift 4 is type-safe, it performs type-checks when compiling your code and flags any mismatched types as errors. Playground execution failed: error: :6:6: error: cannot assign to ‘let’ value ‘myVar’ myVar =… Read More »
Dear Friends, In Today’s post I will show you how to convert a simple hex color string to UIColor in Swift 3. Code
Dear Friends, Today I will show you how to create a simple alert with two buttons and how to write a callback for each button. The code is simple. Its written for Swift 3. Send your comments to firstname.lastname@example.org
Life is good and everything will be ok, Kotlin is here… In this article we will check how we can start with Kotlin for Android. Make sure you won’t overwrite your old Android Studio when you install the new version. Method 1 : Pre-requisites First you have to download Android Studio Beta 3.0 from here. Android Studio has… Read More »
What are Deep Links? Let’s understand this with the help of a situation. If you happened to click a link on a webpage and suddenly it opens an application inside you phone or opens a dialog asking you to choose an application to handle this click. Yes, this is called deep linking. You can read more about deep… Read More »
Here are some plugins that are really handy for developers to speed up their development. 1. ADBWIFI This plugin helps you to debug your app over Wi-Fi. Check out my previous blog post on how to do this without any plugin. 2. DTO generator This plugin is useful when you want to generate corresponding POJO classes for your… Read More »
Here is a simple ulility function to convert a hex color string to UIColor in iOS in Swift 3.
There is often a settings page when we make our app and most of the people end up making it using their own UI. But interestingly Android provides API specific for building preferences using your own values. Check the below UI for my settings Lets see how that is done. Using Preference Headers Preference Headers displays only the… Read More »
Even with good hardware configuration for the system, we often end up with slow gradle build process in Android Studio. So here I will discuss some steps to Speed up Android Gradle build. 1. Stay Up to Date Make sure you have the latest Android Studio and have the latest build tools updated. 2. Create a build variant… Read More »
We will see the different ways to get the battery percentage in Android. Method 1 Register a Broadcast Receiver Receive like this Method 2 Method 3 Note : Make sure you unregister the receiver when you don’t need.
Steps Enable usb debugging and Connect the device to dev system with USB cable. Type “adb tcpip 5555” in Terminal/Command prompt. (Here we are opening a port in device to connect from development system.) Disconnect the phone and check the ip address of phone from network settings Type “adb connect :5555” Now the phone will be connected with… Read More »
ng-repeat. Example Now we will do a filter Search Filter In the above example if we want to search by country we will modify the code like below will search in country fields of the employees only and the boolean value from the checkbox will look for the exact match from the checkbox. Complete Example
This is a simple demo to do Slide to Unlock in Android. Layout Activity
This is a common question. Eventhough the Android System calls garabage collector at appropriate times, this usually will not be adequate. Because the system calls GC at intervals, most of the time it wont work perfect and causing unnecessary pauses in the application. If these pauses are more than 16ms, then the user will notice some lag in… Read More »
Automatic animations on Layout Change If you want to animate views in a layout without writing big codes. Here is a Simple way. Find the root element of the layout and add this property to it. Adding Manual Animations Fade Out Animation Fade In Animation Move Down by height Translate animate to origin Position Adding Duration Chaining Animations… Read More »
Android 6.0 saw the introduction of fingerprint authentication, a new security feature that allows users to confirm their identify with a single touch. Well, after that this has become a common way of authentication for users. Advantages Very easy, fast and convenient to use for authentication Don’t need to remember No struggling with the keyboards No more password… Read More »
You can add AngularJS event listeners to your HTML elements by using one or more of these directives: ng-blur ng-change ng-click ng-copy ng-cut ng-dblclick ng-focus ng-keydown ng-keypress ng-keyup ng-mousedown ng-mouseenter ng-mouseleave ng-mousemove ng-mouseover ng-mouseup ng-paste Example
Filtering is really easy in Angular JS. In Angular JS we use the “filter” keyword to do the filtering. Example Copy and paste the above code in an html and run. You will see the result. Here we have a variable named “my_search” which is a textbox in HTML. so the filter value is taken from the textbox.… Read More »
Apart from other languages, when you write a class in Swift, It should have a initialiser. To solve this we have to write init() function in that particular class. Just like below. For example, look at the below class. Here we have 5 variables. The above error usually comes when you don’t initialize all variables in the class… Read More »
You can use the ng-bind directive, which will bind the innerHTML of the element to the specified model property: Method 1 Method 2 Complete Example