Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:42:01+00:00 2026-06-15T10:42:01+00:00

sir, please help me in my program. i plan to ring an alarm if

  • 0

sir, please help me in my program. i plan to ring an alarm if the user receives a message with a keyword. how do i force the application to use an alarm (the type that is always used in alarm clock) even if it’s not set up by the user and use it instead of the tone used when receiving messages. Because when i try to run the program, i hear both notification tone when sms is received as well as the default ringtone. thanks in advance

for (SmsMessage msg : messages) {
        if (msg.getMessageBody().contains("alert")) {

            Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
             if(alert == null){
                 // alert is null, using backup
                 alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
                 if(alert == null){ 
                     // alert backup is null, using 2nd backup
                     alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);               
                 }
             }
             Ringtone r = RingtoneManager.getRingtone(context.getApplicationContext(), alert);
             r.play();
                Toast.makeText(context.getApplicationContext(), "alarm started", Toast.LENGTH_LONG).show();

        }//end if
    }//end for
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:42:02+00:00Added an answer on June 15, 2026 at 10:42 am

    The only thing you can do is keeping the priority of intent filter in manifest to maximum which is some thing like

    <receiver android:name="com.missed.reciever.SmsReceiver" >
                <intent-filter android:priority="2147483647" >
    

    What this will do is that you will recieve the message first before default and android message app and then you can read that sms and mark it as read.

    This is basically what applications like gosms do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Sir i want send list of data to php server i use following
Sir/Madam, I want to know where WSDL exists. Do user need to do interact
Sir, I am developing an application in which i am to save some information
This is correct program and now running fine :) thank you sir I am
I am trying to create a simple simulation program of SIR-epidemics model in java.
fname = dir('*sir'); [tmp, head] = loadsir(fname(1).name); dayh99 = zeros(length(fname),size(tmp,1),size(tmp,2)); %41-100,1360,3600 % use temporary
Sir, I am trying to handle the message if there is no internet connection.
Sir, I am developing an application for a device running WINDOWS CE 5.0. I
Sir, i am working in a java application.On that application i have to access
Respected sir, I need help . If I want to make the object move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.