What are optionals in Swift ( ? && ! ).

By | June 30, 2016

Swift introduces Optionals type, which handles the absence of a value. Optionals say if there are set a value, then take that value, it can be of any type AND else it is nil. Basically It has two possible values, None and Some(T), where T is an associated value of the correct data type available… Read More »

CRUD Operations in SQLite using SQLiteOpenHelper – Android

By | June 26, 2016

We do SQLite operations in Android by extending the SQLiteOpenHelper Class. I will create an Employee table with three fields id name company. I have a model class same as the database table Employee. Employee.java Lets see How we can do the CRUD (Create, Read, Update and Delete) Operations. CREATE We create a class that… Read More »

Geofencing in Android, A Simple Example.

By | June 20, 2016

What is Geofencing? Geo-fencing is a feature in a software program that uses the global positioning system (GPS) or radio frequency identification (RFID) to define geographical boundaries. A geofence is a virtual barrier. Today we will discuss how we can implement Geofencing in Android with a single location. First You need to provide the permissions… Read More »

Ionic Commands for building and Publishing Hybrid Mobile Apps

By | June 10, 2016

1. Desktop browser testing Testing your app in a browser is as simple as running the serve command in your project’s root folder. 2. Simulator testing You can also test right in the simulator using the cordova commands from the previous chapter. For example, to test in the iOS simulator, run: Substitute ios with android… Read More »

Downloading Multiple files(Images etc..) in Android Simultaneously/or in Batches in Android using ThreadPoolExecutor.

By | June 10, 2016

CPUs with multiple cores have almost become the standard in Android devices. This means multiple operations doesn’t have to wait to be executed on a single thread. They can rather run on multiple threads in parallel where each threads gets executed on a single processor. For example imagine an operation where multiple images have to… Read More »

Implementing Google Analytics in your Android app – Track User Activities.

By | June 5, 2016

Implementing Google Analytics can help you find out how users are using your app. Which page is being visited regularly.You can also Know about the crashes happening in your app. How many users are currently using your app in real time and which page is currently being used more. Lets see how we can implement… Read More »

Custom Loaders with SQLite in Android

By | June 1, 2016

Introduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment. Loaders have these characteristics: They are available to every Activity and Fragment. They provide asynchronous loading of data. They monitor the source of their data and deliver new results when the content changes. They automatically reconnect to the… Read More »

Using Loaders in Android Using SimpleCursorAdapter in Android.

By | May 20, 2016

Introduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment. Loaders have these characteristics: They are available to every Activity and Fragment. They provide asynchronous loading of data. They monitor the source of their data and deliver new results when the content changes. They automatically reconnect to the… Read More »

Filtering a RecyclerView with Custom Objects.

By | May 13, 2016

This demo will show you how you can filter a RecyclerView with your Custom Objects. If you are new to RecyclerView, then please go through this post to get a glance. Check out the Demo Video ( 7 seconds) Here I am using a CustomClass called “ListItem” which has three members. ListItem MainActivity We have… Read More »

Using NSOperationQueue in iOS to do Serial/Concurrent Operations.

By | May 7, 2016

NSOperationQueue is used to do scheduled operations in iOS. You can customize NSOperationQueue to do Concurrent/Serial operations. You can set NSOperationQueue maxConcurrentOperationCount to tell it to do how many operations to execute at a time. Lets see this with an example [Swift Version] In the above example, we set maxConcurrentOperationCount to 1, telling it to… Read More »

Solution for CoreData Multithreading problem.

By | May 1, 2016

This post is for people who are at least familiar with CoreData. But just knowing is not everything.. CoreData creates problems when you access them from different threads… Most common problems are listed below CoreData: error: Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer… Read More »

ld: warning: directory not found for option -F or -L, Xcode Error – Solved.

By | April 15, 2016

There are two errors like this that often happens with the Xcode. If it is a “directory not found for option ‘-L/…” error, that means it’s a Library Error, then Follow the below steps… Click on your project (targets) Click on Build Settings, Search for “Library Search Paths” Under Library Search Paths, delete the paths… Read More »

Volley Demo in Android

By | April 10, 2016

Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available through the open AOSP repository. Volley offers the following benefits: Automatic scheduling of network requests. Multiple concurrent network connections. Transparent disk and memory response caching with standard HTTP cache coherence. Support for request prioritization. Cancellation request… Read More »

Best Coding Practices in Android – Part 2

By | April 5, 2016

You can read the First Article about Best Coding Practices in Android here. Re-Use Elements and Layouts Use for reusing layouts. You can read about this from here. Use Different resources for different density Screens. Properly organize your images in mdpi, hdpi,xhdpi etc folders for corresponding screens. This helps to prevent blurry images. Read more… Read More »

Best coding practices in Android Part 1

By | April 5, 2016

Following conventions. Do not try to create a new convention for coding. Follow the standard convention. Like Class Naming. File Naming. Variable Naming. Code commenting. Code intending. Use Memory Efficient Structures The above code results in unnecessary Integer objects created. Android provides data structures which are more efficient for mapping values to other objects. This… Read More »

Advantages of NSURLSession over NSURLConnection in iOS and Sample Demo Code

By | March 30, 2016

In an application we usually works with Data tasks – Data tasks are used for requesting data from a server, such as JSON data. These data are usually stored in memory and never touches the File System We can use NSURLSessionDataTask. Upload Tasks – Upload tasks are used to upload data to a remote destination.… Read More »

RecyclerView Simple Example in Android.

By | March 25, 2016

The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network… Read More »

Custom Transitions in Android M using RippleDrawables

By | March 20, 2016

Ripple Drawables. Touch feedback in material design provides an instantaneous visual confirmation at the point of contact when users interact with UI elements. The default touch feedback animations for buttons use the new RippleDrawable class, which transitions between different states with a ripple effect. We can either apply RippleDrawable in XML or using Drawable XML… Read More »

Bluetooth Demo in Android – Listing paired Devies, Find other Online BT devices, Connect to a BT Device, Communicate between connected BT Devices ( Chat ).

By | March 10, 2016

In this Demo we will see Check compatibility of the device. Turn On/Off Bluetooth, Making it discoverable List Paired Devies. Check for Online Bluetooth Devices. Connect with a Device. Communicate between Connected Bluetooth Devices. Disconnect from Device. You can download the complete Android Studio Source code at the end of the post. Before We start… Read More »

Using “BackgroundFetch” in iOS to do task in the Background.

By | March 5, 2016

Hi Friends, Here is a simple way to do background task in iOS using “BackgroundFetch”. We will just try to send a message to the UI when a new data arrives in the background. You can do anything there you want. To enable “BackgroundFetch” in your app, you have to do some modifications in your… Read More »

Local broadcast events with LocalBroadcastManager in Android

By | March 1, 2016

LocalBroadcastManager is Helper to register for and send broadcasts of Intents to local objects within your process. This is has a number of advantages over sending global broadcasts with sendBroadcast(Intent): You know that the data you are broadcasting won’t leave your app, so don’t need to worry about leaking private data. It is not possible… Read More »

Swipe Refresh ListView using ListFragment and SwipeRefreshListFragment in Android

By | February 25, 2016

This demo shows How to use Swipe to Refresh in ListViews and ListViewFragments. You can download the complete Android Studio Source Code at the end of the Post. 1. Using ListFragment 2. Using SwipeRefreshListFragment You can download the complete Android Studio Source Code from here. You can send your valuable comments @coderzheaven@gmail.com.