Visualizzazione dei risultati da 1 a 6 su 6
  1. #1

    vibrazione notifica android

    Salve, come si può aggiungere oltre al suono la vibrazione alla notifica?

  2. #2
    Quote Originariamente inviata da signfra Visualizza il messaggio
    Salve, come si può aggiungere oltre al suono la vibrazione alla notifica?
    ma in una tua app, o come impostazione sul cellulare??

    nel primo caso, devi impostare i permessi nel MANIFEST, e poi puoi usare la classe Vibrator.

    nel secondo caso, hai sbagliato sezione....

  3. #3
    Quote Originariamente inviata da fermat Visualizza il messaggio
    ma in una tua app, o come impostazione sul cellulare??

    nel primo caso, devi impostare i permessi nel MANIFEST, e poi puoi usare la classe Vibrator.

    nel secondo caso, hai sbagliato sezione....
    dico in questo caso
    Ultima modifica di deleted_2024.08.22; 21-12-2016 a 17:34

  4. #4
    Quote Originariamente inviata da fermat Visualizza il messaggio
    ma in una tua app, o come impostazione sul cellulare??

    nel primo caso, devi impostare i permessi nel MANIFEST, e poi puoi usare la classe Vibrator.

    nel secondo caso, hai sbagliato sezione....
    dico in questo caso:

    codice:
    NotificationCompat.Builder n = (NotificationCompat.Builder) new NotificationCompat.Builder(Main2Activity.this)
            .setContentTitle("Attenzione")
            .setContentText("OK")
            .setSmallIcon(android.R.drawable.ic_dialog_email)
            .setSound(sound);
    .setVibrate cosa devo impostare?

  5. #5
    Utente di HTML.it L'avatar di andbin
    Registrato dal
    Jan 2006
    residenza
    Italy
    Messaggi
    18,284
    Quote Originariamente inviata da signfra Visualizza il messaggio
    .setVibrate cosa devo impostare?
    Non me ne intendo di Android. Ma basta leggere il javadoc di setVibrate:

    NotificationCompat.Builder setVibrate (long[] pattern)
    Set the vibration pattern to use.

    e poi c'è il link for a discussion of the pattern parameter.

    Dove per i vibrate() spiega:

    Pass in an array of ints that are the durations for which to turn on or off the vibrator in milliseconds. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next value indicates the number of milliseconds for which to keep the vibrator on before turning it off. Subsequent values alternate between durations in milliseconds to turn the vibrator off or to turn the vibrator on.


    Quindi quale è il dubbio ora?
    Andrea, andbin.devSenior Java developerSCJP 5 (91%) • SCWCD 5 (94%)
    java.util.function Interfaces Cheat SheetJava Versions Cheat Sheet

  6. #6
    Quote Originariamente inviata da andbin Visualizza il messaggio
    Non me ne intendo di Android. Ma basta leggere il javadoc di setVibrate:

    NotificationCompat.Builder setVibrate (long[] pattern)
    Set the vibration pattern to use.

    e poi c'è il link for a discussion of the pattern parameter.

    Dove per i vibrate() spiega:

    Pass in an array of ints that are the durations for which to turn on or off the vibrator in milliseconds. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next value indicates the number of milliseconds for which to keep the vibrator on before turning it off. Subsequent values alternate between durations in milliseconds to turn the vibrator off or to turn the vibrator on.


    Quindi quale è il dubbio ora?
    risolto

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.