Wednesday, February 27, 2013

Push Notification (GCM,C2DM) in Android

"Push Notification" this is from iPhone,
In Android this is GCM(Google Cloud Messaging), C2DM.

Check this is best links for Android

***Source code for ANDROID also for OWN SERVER***
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

***GCM Architecture Overview***
http://developer.android.com/google/gcm/gcm.html
http://developer.android.com/google/gcm/gs.html

** Registering Process with GCM ***
http://fundroiding.wordpress.com/2012/06/29/google-cloud-messaging-for-android-gcm-simple-tutorial/

***C2DM***
http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html

NOTE:
Google has officially deprecated C2DM as of June 26,2012. This means that
C2DM has stopped accepting new users and quota requests. Existing C2DM
developers are encouraged to migrate to Google's new push service, called
GoogleCloud messaging for Android (GCM).
               ->From : https://docs.urbanairship.com/pages/viewpage.action?pageId=1509252

Friday, February 22, 2013

In Android how to storing and retrieving images as a BLOB from SQLite Database

This is 2 import link for storing and retrieving images as a BLOB from SQLite Database.

http://android-codes-examples.blogspot.in/2011/09/image-and-content-is-populated-from.html


http://sree.cc/google/storing-and-retriving-images-in-sqlite-database-in-android


> First link showing full process and also showing retrived data in listview.
> Second link have a code to convert online image as a BLOB and storing in SQLite DB. Also having the process of retrieving same image and convert in an bitmap format.

Friday, February 15, 2013

How to finish all Activity's running in background in Android

---------------------------------------------------------------------------
Hello All,

This is very easy solution for this question.

A->B->C->D

We start from A and now we are on D activity.

We used intent for jump one activity to another.

Note: yet we not use finish...

Means A,B,C is running in background...

So, therefore we need to finish all (A,B,C) activities from activity C.
--------------------------
Step 1 : Save A, B, C activity in static Activity Vector. Create Static class and create Activity Vector.

public class VARIABLES_STACK_RANJIT {
                 public static Vector<Activity> v_context = new Vector<Activity>();
}

Step 2 : Write following code in A,B,C activity
               i) VARIABLES_STACK_RANJIT.v_context.add(A.this);
               ii) VARIABLES_STACK_RANJIT.v_context.add(B.this);
               i) VARIABLES_STACK_RANJIT.v_context.add(C.this);

Step 3 : Write final code in D activity

Start loop and finish manually all saved activity.

                 for (int i = 0; i < VARIABLES_STACK.v_context.size(); i++) {
(VARIABLES_STACK.v_context.elementAt(i)).finish();
Log.e("Activity :" + i, "finished...");
}

---------------------------------------------------------------------------

Monday, February 4, 2013

Don't reload activity when orientation changes in an Android

Changes in an AndroidManifest.xml file
Set configChanges="----------" property in <activity> tag.

Example:
android:configChanges="orientation|screenSize"

If we use this property then do not reload activity after changing the orientation (Portrait/Landscape).