小编Kal*_*har的帖子

Android GCM PushNotification - 添加在应用程序中添加自定义声音文件

我成功地获得了GCM推送通知.现在我想添加自定义声音文件而不是默认声音.我曾尝试与乌里

文件:///res/raw/pop.mp3

Notification.DEFAULT_SOUND;

但没有成功.如果您有更好的解决方案,请分享.

我的GCMIntentService.java方法代码如下 -

/**
 * 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>>>>>>>>>>>>>"+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); …
Run Code Online (Sandbox Code Playgroud)

android uri push-notification google-cloud-messaging

8
推荐指数
1
解决办法
1万
查看次数

如何转换大号双号.在人类可读的格式

我想在TextView中打印一个双号,就像这种格式10699657.6,目前这就像1.06996576E7.请任何人帮帮我吗?

double android

2
推荐指数
1
解决办法
593
查看次数

如何从android中的服务器获取时间?

可能重复:
有没有人知道一个好的JSON时间服务器?

服务器上是否有公共jsonxml现在我可以解析当前时间?我将利用这段时间检查我的应用程序的试用版本的到期时间,我没有使用日历或日期类.我是Android新手.谢谢.

xml android json date

2
推荐指数
1
解决办法
3622
查看次数