title: Android GCM PushNotification - Add add custom sound file in app
body: <p>I am getting GCM Push Notification successfully. Now i want to add custom sound file instead of default sound. I have tried with <strong>Uri</strong> from </p>
  
  <blockquote>
    <p>file:///res/raw/pop.mp3</p>
  </blockquote>
  
  <p>in </p>
  
  <blockquote>
    <p>Notification.DEFAULT_SOUND;</p>
  </blockquote>
  
  <p>but not success. Please share if you have better solution.</p>
  
  <p>My <strong>GCMIntentService.java</strong> method code is below - </p>
  
  <pre><code>/**
   * Issues a notification to inform the user that server has sent a message.
   */
  private static void generateNotification(Context context, String message) {
  
      System.out.println("Called generateNotification&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"+message);
      NotificationManager notificationManager = (NotificationManager) context
              .getSystemService(Context.NOTIFICATION_SERVICE);
      // Notification notification = new Notification(icon, message, when);
  
      String title = context.getString(R.string.app_name);
  
      NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
              context)
              .setSmallIcon(R.drawable.app_icon)
              .setContentTitle(title)
  
              .setStyle(
                      new NotificationCompat.BigTextStyle().bigText(message))
              .setContentText(message);
  
      Intent notificationIntent = new Intent(context,
              SplashActivity.class);
      PendingIntent intent = PendingIntent.getActivity(context, 0,
              notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
  
      mBuilder.setContentIntent(intent);
  
      Notification notification = mBuilder.build();
      notification.flags |= Notification.FLAG_AUTO_CANCEL;
  
      notification.defaults |= Notification.DEFAULT_SOUND;
      notification.defaults |= Notification.DEFAULT_VIBRATE;
  
  
      notificationManager.notify(0, notification);
  
  
  
  }
  </code></pre>