Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Set multiple alarm on Android device by Qt

Set multiple alarm on Android device by Qt

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
alarmmultiple alarmandroid alarmandroid
2 Posts 2 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kybernetesK Offline
    kybernetesK Offline
    kybernetes
    wrote on last edited by kybernetes
    #1

    Hello,

    i want to write an alarm program on android, is there any idea for that?

    i found some android code but not for qt, for android studio.

    Intent intent = new Intent(AlarmList.this, AlarmReceiver.class);
    PendingIntent sender = PendingIntent.getBroadcast(AlarmList.this, 0, intent,PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager ALARM1 = (AlarmManager)getSystemService(ALARM_SERVICE);
    ALARM1.set(AlarmManager.RTC_WAKEUP, sdl, sender);
    

    some more for symbian

     // Creating a workday wakeup alarm 
        XQAlarms* alarms = new XQAlarms(this); 
        QDateTime alarmDateTime = alarmDateTime.currentDateTime();
        alarmDateTime.setTime(QTime(15, 0)); 
        // Create XQAlarm data object 
        XQAlarm weeklyReport; 
        weeklyReport.setExpiryTime(alarmDateTime); 
        weeklyReport.setMessage("Do weekly report"); 
        weeklyReport.setRepeatDefinition(XQAlarm::RepeatWeekly);
        alarms->addAlarm(weeklyReport);
    

    i can play sound but for this i have to run my program for background and i dont know how also i need vibration too.

    Thanks.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kornava
      wrote on last edited by
      #2

      I think no way to do it from Qt directly,
      but you still have the choice to make it with android java code inside your Qt App !
      the principle is simple, you insert your alarm management code (without any layout items, like buttons) in a java file inside a method, then you add the package name, then you put the Java file inside the src path (you will find it in ANDROID folder inside your Qt project folder),
      Now you have to call your Java method from the Qt side, this can be done easily if you understand this tuto:
      http://www.kdab.com/qt-android-episode-5/

      You can make multiple methods, and transfer data between the two side (the Qt C++ and Android Java)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved