Completed

Debug: BroadcastReceiver and SMS

CHALLENGE:

In attached project, TxtMsgIn() extends BroadcastReceiver. TxtMsgIn's onReceive event listener sometimes responds to incoming SMS sent by the device to its own phone number. However, onReceive never responds to incoming SMS sent by other phones.

SOLUTION REQUIREMENTS:

(1) Make onReceive respond to all incoming SMS messages.

(2) Preserve object architecture already established in project.

(3) At a minimum, solution must work on BLU B130DL device running Android 10.

(3) Explain your corrections with inline //comments.

CODE SAMPLE:

@Override

protected void onCreate(Bundle savedInstanceState) {

[login to view URL](savedInstanceState);

setContentView(R.layout.activity_main);

// STEPS TO REPRODUCE THE PROBLEM:

// STEP 1

// Set testPhoneNumber, for phone running the app.

String testPhoneNumber = "7274333519";

// STEP 2

// Run app on a physical device, rather than an emulator.

// STEP 2

// Allow SMS permissions

// [login to view URL] will send a txt message to itself,

// which should prompt the [login to view URL]

// including a Toast reading "Received TxtMsg! (Example Text)"

while(!checkPermission()){

// Wait for user permissions

};

TxtMsgIn myTxtMsgIn = new TxtMsgIn();

TxtMsgOut myTxtMsgOut = new TxtMsgOut();

[login to view URL](

testPhoneNumber,

"(Example Text)",

this);

// STEP 3

// From a separate device, manually send a test txt to testPhoneNumber.

// This should likewise prompt the onReceive method in myTxtMsgIn and Toast.

// However, it fails to do so. Why?

}

Skills: Android, Mobile App Development, Java, Debugging

About the Client:
( 1 review ) St. Petersburg, United States

Project ID: #32708568

Awarded to:

jagrit222

"TxtMsgIn receiver FIXING " Hi I checked your CODE and run it on my DEVICE as well. I found the issue that why you're not receiving the message into it as I have already worked on the same thing before. Let's disscuss More

$31 USD in 7 days
(3 Reviews)
1.2

6 freelancers are bidding on average $152 for this job

(40 Reviews)
5.8
GintarasZelvys

Hi, Alexander A. I checked TxtMsg Project and I found a solution. I am very familiar with BroadCast and SMS Process on Android. As an Android Expert, I am very interested in your project. I have mobile development ski More

$200 USD in 1 day
(13 Reviews)
5.4
Slmmy

Hi There, I am flexible with my working hours and would appreciate it if you could discuss your project as soon as possible. I would greatly appreciate the opportunity to be working with you and to discuss my qualifi More

$175 USD in 4 days
(3 Reviews)
3.2
dharmeshapp

Hi Client, I gone through your requirements and have 6+ years experienced as android developer; Provide high quality app with unlimited revisions, your satisfaction is 100% guaranteed. Really happy to work with your b More

$200 USD in 3 days
(11 Reviews)
3.2
danu1418

Hi, I'm Manoj Android Developer. I have 6.8 years of experience in native android development and also 3 years of experience in .Net C#... I had completed 65 projects on android and 3 projects on .net C#... I will prov More

$165 USD in 5 days
(3 Reviews)
2.7