Simulate Bad Network Connection in iOS Device and Simulator

While developing an app that requires an internet connection, it is very important to handle use-cases when the connection is slow or non-existent. To figure out when there’s a bad connection via your code, you can use this great Reachability library.

Once Reachability is implement it, it’s pretty easy to test it by simulating a bad connection on your iPhone or iPhone Simulator if you know what tools to use. Here is how you can test a your app on different internet connections using your iPhone and iPhone Simulator:


Continue reading

Getting Started with SQLite3

SQLite is a C library that implements an SQL database engine. It is a Relational Database Management System (or RDBMS). Most of the SQL databases work with the client/server model. Take MySQL for an example. To enter and receive data from a MySQL database you need to send a request to the MySQL server, which on reception will provide you with the appropriate response. Contrary to MySQL, SQLite databases are operated directly from the disk. There is no need to create requests to the server.

Continue reading

Useful Mac Terminal Command

Combine pdf file into one

/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/” -o “/Users/user name/Desktop/Merged PDF.pdf” “/Users/user name/Desktop/My folder/PDF 1.pdf” “/Users/user name/Desktop/My folder/PDF 2.pdf

Mobile Application Development Protocol

Mobile application development protocol is a set of rules and procedure that we need to follow before starting the mobile application project, during the project execution and after the project delivery. We are introducing this protocol for following reasons,

  1. To make our work efficient and fast by following standard programming practice.
  2. Easy to collaborate with multiple team member.
  3. Increase readability of code.
  4. Ensure security / privacy in mobile application
  5. Gathering crash report information to resolve bugs in the application before and after production.
  6. Collecting user behaviour within the app that will help for future enhancement planning.

Continue reading

Get property name as string

Go to get the name of an object property, can be boring using the Objective-C runtime reference.
Fortunately there is a quick way to get it. Assume that you have an object named “appleStore” that has a property named “storeLocation”.
StoreLocation is another object with some properties: “city”, “lat”, “lon”, “street”, “state”, “code”.

Continue reading

Network Reachability Test and HTTP Call with AFNetworking

There are plenty of time when we need to have active internet connection for an mobile application to be used. So it is always good idea to check internet connection before the application get ready for use.

AFNetworking is one of the best iOS library out there for making HTTP request for accessing web services.  Same library is good enough for checking active internet connection. So now let’s dive into how we can constantly monitor the internet connection throughout the application.

Understanding Key-Value Observing and Coding

In programming, one of the most commonly accepted facts is that the flow of a program depends on the value of the various variables and properties you use. You just have to think how many times during an application development you have to check for your properties’ values, and based on them to drive the execution of the code to one or another way. Even more, think of how many times you need to check if an object has been added to an array, or if it has been removed from it. So, being aware of the changes that happen to the properties of your classes is a vital part of the programming process.

There are various ways that let us be notified when a property gets changed. For example, if you have a method to set a property’s value, or you just override a setter method, you can send a notification(NSNotification) to notify an observer about that change, and then perform the proper actions based on the value that was set. If you are familiarized with notifications, then using them would not be a problem at all if you would want to use them for being aware about changes in properties, but the truth is that doing so for a great number of properties would require to send and observe for a great number of notifications as well, and that could lead to a lot of extra code writing.

Continue reading

Manage Development and Production Builds

For starters, some of you may be wondering why you should use two builds while developing your app. The reason is because as you continue to build new features, you want to separate the development version from the existing public production app. Standard software development practice is to use different environments for the different versions of the software. The development version of an app typically uses a different database and server from the production environment. Developers commonly use dummy images or data during testing. In testing or development environments, it’s not uncommon for one to use test data such as “test comment”, “argharghargh” and “one more test comment”. Obviously, you don’t want your real users to see this kind of messages. In the case, if your app using an analytics system, you may even send thousands of events during the testing stage. Again, you don’t want to mix the test data with the production data in the same database. This is why it’s always recommended to separate the development and production builds.

Continue reading

How to install Google Play Services on Genymotion

Due to Genymotion’s fluidness and ease of use, it now becomes the most popular android emulator allows android developers to test their app directly on their computer.

However, it still lacks of Google Services just like Google Play Store, Google Maps, etc. on Genymotion emulator which makes us developer not be able to test those functionalities that use Google Services for example GCM Push Notifications or Google Maps.

Anyway it is not a problem anymore since there is some simple steps to do to make Google Services be avaiable on Genymotion with some help from CyanogenMod’s gapps.

Continue reading

Android Emulator (BlueStacks vs Genymotion)

There are a number of various Android Emulators available in the technology world, all studded with amazingly useful features. Apart from all these Emulators, there are three most popular Emulators and to get you the best one from all these popular Emulators, we have thought of comparing the features of all of them so that we can choose the best Android Emulator out of them. Here’s the comparison, take a look!

Continue reading