28 Apr 2014

Flurry integration | Flurry analytics in android

Hello Friends,

Today i am going to post Flurry analytics integration with android application.

What is Flurry Analytics?

According to flurry website, Flurry Analytics can be defined as  "Flurry Analytics provides accurate, real time data to developers about how consumers/users use their mobile applications and games, as well as how applications are performing across different handsets.

Why do we need Flurry?

As I have already mention, you would like know every detail statistics of your app after it goes on market. All these details are recorded after you integrate in it your app using Flurry SDK. What you need to do is just register and add application. After that you can download the corresponding SDK (latest one). Then you can see each day how our costumer grows and how much time they have used your application. It is very useful tool for developers to know the market value of your application.

Steps to implement Flurry with Application : 
1) Sign up with flurry 
2) Create A New Application
     -Click on the Applications tab to set up a new  application.
     -Choose your platform


3) Obtain Application Key:

    3.1 Download the Flurry Android SDK

    -The archive should contain these files:
     1. FlurryAnalytics_x.y.z.jar : The library containing Flurry's analytic collection and reporting code
         (where x.y.x denotes the latest version of Flurry SDK).
     2. FlurryAds_x.y.z.jar: The optional library to incorporate Flurry's ads into your application (where x.y.x            denotes the latest version of Flurry SDK).
     3. ProjectApiKey.txt : This file contains the name of your project and your project's API key.
         Analytics-README.pdf : This PDF file contains instructions.



4) Add the FlurryAnalytics_x.y.z.jar to your classpath 

     -If you're using Eclipse, modify your Java Build Path, and choose Add External JAR.
     -If you're using the SDK tools directly, drop it into your libs folder and the ant task will pick it up.

5) Add calls to onStartSession and onEndSession 

The following three lines of the code need to be added to the each Activity of your application to accurately capture duration of users' interaction with the application.

        @Override
 protected void onStart()
 {
  super.onStart();

  FlurryAgent.onStartSession(this, "Your Flurry ID");
  FlurryAgent.logEvent("Dashboard Screen Visited");
 }

 @Override
 protected void onStop() 
 {
  super.onStop();
  FlurryAgent.onEndSession(this);
 }


6) Now the way to log event is as follows


FlurryAgent.onEvent("Started Application");

-To set multiple event at time

HashMap<String, String> parameters = new HashMap<String, String>();
     parameters.put("Final score", "testing score");
     parameters.put("Time taken", "testing taken");
     FlurryAgent.onEvent("testing game", parameters);



Permission:
<uses-permission android:name=”android.permission.INTERNET”> </uses-permission>
<uses-permission> android:name=”android.permission.ACCESS_COARSE_LOCATION”> </uses-permission>


Result of tracing application:




Reference link:


I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)

27 Apr 2014

Integrating Google Analytics with Android

Hello Friends,

The Google Analytics SDK for Android makes it easy for developers to collect valuable statics about how the users are using their app.

Features Android Google Analytics:

- The number of active users that are using the application
- Usage of specific features in application by any user
- Lock the number and type of application crashes
- From where in the world the application is used
- And many other useful features...

Steps to Integrating Google Analytics with Android application:

1. Create a new Google Analytics Account  Create Account

2. Add a new mobile app in your account(This is the app which you want to track)

3. After you add a app in your account,google provides you a tracking Id unique for that app. Note down the tracking ID , it is usually in  UA-XXXX-Y format

4. Download the Google Analytics jar file Jar Download Link

5. String.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>

   <!-- Replace placeholder ID with your tracking ID -->
   <string name="ga_trackingId">your tracking ID</string>

   <!-- Enable Activity tracking -->
   <bool name="ga_autoActivityTracking">true</bool>

   <!-- Enable debug -->
   <bool name="ga_debug">true</bool>

   <!--
   The inverval of time after all the collected data
   should be sent to the server, in seconds.
   -->
   <integer name="ga_dispatchPeriod">30</integer>

</resources>

6. DashboardActivity 
public class DashboardActivity extends Activity
{
 private GoogleAnalytics mGaInstance;
 private Tracker mGaTracker;

  @Override
 public void onStart() 
 {
  super.onStart();
  EasyTracker.getInstance().setContext(this);
  EasyTracker.getInstance().activityStart(this);
  mGaTracker.sendView("DashboardActivity Visited...");// Add this method.
 }

  @Override
 public void onStop() 
 {
  super.onStop();
  EasyTracker.getInstance().setContext(this);
  EasyTracker.getInstance().activityStop(this);
  mGaTracker.sendView("DashboardActivity Visited..."));// Add this method.
 }

  @Override
 protected void onCreate(Bundle savedInstanceState) 
 {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.act_weblink);

   mGaInstance = GoogleAnalytics.getInstance(this);
  mGaTracker = mGaInstance.getTracker(getString(R.string.tracking_id));  

    // Add tracking functionality to button
      Button btnABC= (Button) findViewById(R.id.btn);
      btnABC.setOnClickListener(new OnClickListener() {
         @Override
         public void onClick(View arg0) {
            // The rest of your code
            mGaTracker .trackEvent("Screen Name", "btnABC Event", "Android app", Long.parseLong("1"));
         }
      });
 } 

}
Note- Don't forget to add Permission Manifest File-

<uses-permission android:name=”android.permission.INTERNET”> </uses-permission>
<uses-permission> android:name=”android.permission.ACCESS_COARSE_LOCATION”> </uses-permission>

Result of tracing application:

If everything is configured correctly, the reports should appear on live. Usually it takes about few hours to see the data in your account.





More Reference Link:

Get starting:  https://developers.google.com/analytics/devguides/collection/android/v3/
Advance : https://developers.google.com/analytics/devguides/collection/android/v2/advanced

I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)

9 Apr 2014

Radial Menu | Semi circular radial Menu in android

Hello Friends,

Here is the another way to display menu with beautiful looking in android application.

RADIAL OUTPUT SCREEN:


CIRCULAR OUTPUT SCREEN:




Download Full source code from here RadialMenu
I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)

8 Apr 2014

Arc Menu | Satellite Menu in android

Hello Friends, 

There is so many ways to display menu in android application, here i am sharing one of the nice way to display menu in android application.


OUTPUT SCREEN:



MainActivity.java

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;
import com.capricorn.ArcMenu;
import com.capricorn.RayMenu;


public class MainActivity extends Activity 
{
 private static final int[] ITEM_DRAWABLES = { R.drawable.composer_camera, R.drawable.composer_music,
  R.drawable.composer_place, R.drawable.composer_sleep, R.drawable.composer_thought, R.drawable.composer_with };

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState)
 {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  ArcMenu arcMenu = (ArcMenu) findViewById(R.id.arc_menu);
  ArcMenu arcMenu2 = (ArcMenu) findViewById(R.id.arc_menu_2);

  initArcMenu(arcMenu, ITEM_DRAWABLES);
  initArcMenu(arcMenu2, ITEM_DRAWABLES);

  RayMenu rayMenu = (RayMenu) findViewById(R.id.ray_menu);
  final int itemCount = ITEM_DRAWABLES.length;
  for (int i = 0; i < itemCount; i++) 
  {
   ImageView item = new ImageView(this);
   item.setImageResource(ITEM_DRAWABLES[i]);

   final int position = i;
   rayMenu.addItem(item, new OnClickListener() 
   {

    @Override
    public void onClick(View v) 
    {
     Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
    }
   });// Add a menu item
  }
 }

 private void initArcMenu(ArcMenu menu, int[] itemDrawables) 
 {
  final int itemCount = itemDrawables.length;
  for (int i = 0; i < itemCount; i++) 
  {
   ImageView item = new ImageView(this);
   item.setImageResource(itemDrawables[i]);

   final int position = i;
   menu.addItem(item, new OnClickListener() 
   {
    @Override
    public void onClick(View v) 
    {
     Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
    }
   });
  }
 }
}
Download Full source code from here ArcMenu 
Download Full source code Satellite Menu from here SatelliteMenu
I will be happy if you will provide your feedback or follow this blog. Any suggestion and help will be appreciated.
Thank you :)