Optimized ListView Having Listener within The Row Items

ListView is an extensively used widget in Android Applications for displaying data in a structured way. To display custom made views as row elements, it is always preferred to associate Base Adapter with ListView. This is how a BaseAdapter can be used to show a list in which each element contains a text field and a checkbox:

MainActivity.java

// Initialize the ListView and set its adapter.
ListView listView = (ListView) findViewById(R.id.list_view);
listView.setAdapter(new NormalListAdapter((Context) this));

Continue reading

Change Proximity Sensor Events by Using Camera

This post is about how to capture pictures using camera with sensor event updates (Proximity Sensor). This is about the simplest implementation of device camera in integration to a particular type of sensor (Proximity sensor here).

This post is also defines how to create and set a transparent theme to the main activity ready to capture pictures on change of proximity sensor state. It also defines how to create a preview for camera resource occupying no space on the activity’s layout.

Continue reading

Control asynchronous processes by multiple callbacks using Deferred

Introduction:
To control the synchronous or asynchronous flow, there may be more methods but we will do this by multiple callback mechanism using deferred and promise object.

Description:
In order to use this mechanism first we need to have an understanding of deferred and promise object.
Here we will use a promise with a deferred object.
A promise is a placeholder for a result, which is initially unknown. While a deferred represents the computation that results in the value. Every deferred has a promise, which functions as a proxy for the future result.
A promise is a value returned by an asynchronous function, but a deferred can be resolved or rejected by its caller which separates the promise from the resolver. Continue reading

Add Core Data to an Application in Xcode

Who should read this Blog: User must know about Basic Concept of CoreData. Those who want to convert their non-Core data Application to a Core Data Application. Those who have some experience working with iOS Application. You must have a Sample Project to which you can convert it to CoreData Project.

So Let’s get started with Step by Step Process.

  1. First and Foremost is to Add CoreData.framework to the application directory.
  2. Now you need to add data model to your Application.

How can you do this?

Go To File-> New File->iOS->Core data->Data Model
Select Next and Give appropriate Name to your Data Model

Continue reading

Implementing Google Analytics in iOS application

When a mobile application is developed for a wide range of users across the world, then the performance of the application becomes a priority. The marketing panel of the application needs to keep a track of the overall performance of the application throughout the world off the shelf.

Google Analytics is such a framework that provides the answer to all such aspects that only the marketers as well as the developers are looking for to implement in their mobile application. So, “What is ‘Google Analytics’?” 

In simple terms Google Analytics is a service offered by Google that generates detailed statistics about a website’s or mobile application’s traffic. The Google Analytics lets you measure user interactions with your business across various devices and environments. This platform provides all the computing resources to collect the information about the application, stores and processes it and provides a detailed report out of it.

Continue reading

LibGdx a Cross-platform Game Development Framework

LibGdx a cross-platform game development framework and a best way for beginners who turned into game development. Using LibGdx one can build 2D or 3D games with little efforts only you need to be familiar with the basic programming language. There is a core project that needs to create on java and some little coding needs to make it executable in different platforms like desktop, Android,IOS Html5 etc. We will focus on to develop android games. I am going to start with the very basics step that needs to be setup before the coding part. And then we build some Demo Projects and try to get understand that how the whole code is working.  To work on LibGdx you need to install Java JDK, Android SDK and Ecllipse. There is a TroubleFire section in the blog where you will find solutions of the troubles that might come during your work.

Download the Java Development Kit(JDK) from the below link :-
http://www.oracle.com/technetwork/java/javase/downloads/index.html.

Download the Java Standard Edition JDK for windows platform after downloading execute the downloaded installer file (for example, jdk-7u11-windows-x64.exe) and follow the instructions on the screen. Setup the Environment variable path with your jdk path

Start->Right Click on Computers->properties->Advanced System Setting → Environment Variable
look out to system variable click on Path click to edit add your JDK directory path (like C:\Java\jdk1.7.0_11)

Continue reading

Copy existing sqlite database into PhoneGap iOS application

Introduction:
Usually PhoneGap supports SQLite database to interact locally. There might be a scenario where we need to create the database freshly or sometimes need to use the existing database. The idea of writing this blog came to my mind while encountered a question in stackoverflow site.  In this blog we will focus on importing existing database into our PhoneGap application and use the same to interact with our application.

Description:
Lets have a pre-populated database having tables with data which needs to be imported to our application. It will help us to minimize our effort in creating the database freshly to the application on its startup. For this we need to follow the bellow steps.

Step 1 : Remove the .sqlite extension from the sqlite database. Ex. If we have the database called DummyDB.sqlite make it only DummyDB.
Continue reading