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 6843371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:14:13+00:00 2026-05-27T00:14:13+00:00

Following this tutorial: http://www.vogella.de/articles/AndroidServices/article.html#receiver I created my own project. Manifest: <?xml version=1.0 encoding=utf-8?> <manifest

  • 0

Following this tutorial: http://www.vogella.de/articles/AndroidServices/article.html#receiver I created my own project. Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="alex.broadcast.sample"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="13" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <receiver android:name="MyPhoneReceiver">
            <intent-filter>
                <action android:name="android.intent.action.PHONE_STATE"></action>
            </intent-filter>
        </receiver>

        <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
    </application>
</manifest>

Code:

public class MyPhoneReceiver extends BroadcastReceiver {
final String logTag = "BroadcastReceiverSample";

@Override
public void onReceive(Context context, Intent intent) {
    Bundle extras = intent.getExtras();
    if (extras != null) {
        String state = extras.getString(TelephonyManager.EXTRA_STATE);

        Log.i(logTag, "Call state: " + state);

        if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
            String phoneNumber = extras.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
            Log.i(logTag, "Phone number: " + phoneNumber);
        }
    }
}
}

Running this sample on Android simulator, I see that it is successfully installed. However, onReceive function is never called. I make incoming call using:

telnet localhost 5554
gsm call 12345678

Emulator shows incoming call, but onReceive is not called.

  • 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-05-27T00:14:13+00:00Added an answer on May 27, 2026 at 12:14 am

    Shouldn’t it be:

    <receiver android:name=".MyPhoneReceiver">
                            ^ note the dot
    

    Also, the location of the permission is wrong, it should be a child of <manifest> not of <Application>.

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

Sidebar

Related Questions

I have been learning RESTful webservices following this tutorial http://www.vogella.de/articles/REST/article.html . As I understand,
Hi i am following this tutorial http://www.vogella.de/articles/AndroidGestures/article.html i want to create an application in
I have created a dataset with the C# designer following this tutorial http://www.devx.com/dotnet/Article/28678/1954 ;
http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I am following this as a guide to install subversion. The tutorial at
I was following this tutorial: http://www.marcofolio.net/webdesign/a_fancy_apple.com-style_search_suggestion.html And checking out the demo here: http://qpoit.com/marcofolio_demo/apple_search/ I
I'm following this tutorial on Flash Pro CS4: http://www.baycongroup.com/flashCS4/09_flashCS4.html I have a button. I
I am following this tutorial, I'm using netbeans 6.5.1 http://www.netbeans.org/kb/docs/java/gui-db-custom.html When I get to
I am following this tutorial: http://www.9lessons.info/2011/03/live-table-edit-with-jquery-and-ajax.html My addition is most content is ajax/json/dynamic. I
I am following the C programming tutorial at http://www.cprogramming.com/tutorial/c/lesson10.html . This particular tutorial teaches
New Android developer here. I'm following a tutorial at http://www.vogella.de/ . The first applications

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.