Page 1
Standard

AsyncTask with callback – Android Example

This tutorial describes the usage of AsyncTask in your application. However, our main focus will be, how to write AsyncTask and use callback method to get result of background processing in calling activity. We will use interface for creating callback method.
Continue Reading →

Drag and Drop
Standard

Drag and Drop in Android – Tutorial

Drag and Drop is one of the best feature provided by the Android Developer API. The Android System provides Drag and Drop framework, which facilitates users especially to move data from one View to another within the current layout. In this tutorial I will show you an example, which will show you how to perform Drag and Drop in Android. For Drag and Drop we will use DragEvent and OnDragListener, which were added in API level 11. We will register DragListener on the view (drop zone) where we will drop other view. Similarlay, we will register TouchListener on the view which we want to drag. Here in this example I have created a custom TouchListener i.e. MyTouchListener.
Continue Reading →

Standard

How to use Observer interface and Observable class in Android

In Android sometimes we came across a situation when on a certain event we have to perform a certain task on more than one places i.e. fragments and activities. For example, If we have three fragments displaying score and on a specific event at any place in application we have to update score, what we will do? We will update score on all three place but how? And what if we have to update score at 15 places. I will try to answer these question in this tutorial with the help of Observable class and Observer interface.
Continue Reading →

Standard

How to Add AdMob Interstitial Ads in Your Android App

Apart from offering paid apps, there are a number of other ways to monetize your mobile applications. Advertising is one of the means to monetize (make money with) mobile applications. In this tutorial I will show you how to display ads in your application. There are may mobile advertising networks and Android allow developers to choose any network of their choice. In this tutorial I am using AdMob.

Continue Reading →

Standard

How to access function in FragmentActivity from Fragment in Android

When we use Fragments, we often came across a situation when we need to change or update a variable or access function in parent activity i.e. FragmentActivity. We can directly accessing parent activity to accomplish this task.

Continue Reading →

Organize project
Standard

Organize medium or large scale Android project efficiently

This is the 1st article of a series of articles on how to organize Android project. You can find links to other related articles at the bottom of the page as soon as they are published.

Organize Android projects

It is very important to know basic information about the project, before you start working on project. I am writing few techniques and rules of thumb based on my experience. These rules can give you an idea how to start and organize a medium or large scale Android project. You can organize your project in any way which makes the most sense to you. There is no 100 percent correct or wrong way to organize a project.
Continue Reading →