Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. releated to android

releated to android

Scheduled Pinned Locked Moved Android
androidhelp
6 Posts 2 Posters 5 Views 1 Watching
  • 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.
  • U Offline
    U Offline
    User 10659791
    wrote on last edited by
    #1

    i am trying to block call in aur application . in which i want that this application run in background while application is closed for this i am using broadcastreciver but this application cannnot work plz help me to build my apps

    L 1 Reply Last reply
    0
    • U User 10659791

      i am trying to block call in aur application . in which i want that this application run in background while application is closed for this i am using broadcastreciver but this application cannnot work plz help me to build my apps

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to provide some better detail about your code and what is not working.

      U 1 Reply Last reply
      0
      • L Lost User

        You need to provide some better detail about your code and what is not working.

        U Offline
        U Offline
        User 10659791
        wrote on last edited by
        #3

        ****************this is my first java file of my application ***************** package com.collblockinandroid; import java.lang.reflect.Method; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.telephony.TelephonyManager; import android.util.Log; public class CallblockinandroiddemoooActivity extends BroadcastReceiver { Context context = null; private static final String TAG = "Phone on Call"; private ITelephony telephony; @Override public void onReceive(Context context, Intent intent) { Log.v(TAG, "Receving...."); TelephonyManager telephonymanager= (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); try { Class c = Class.forName(telephony.getClass().getName()); Method m = c.getDeclaredMethod("getITelephony"); m.setAccessible(true); telephony = (ITelephony) m.invoke(telephonymanager); telephony.silenceRinger(); telephony.endCall(); } catch (Exception e) { e.printStackTrace(); } } } ********* After that i make a file of aIDL THAT IS GIVEN BY THE NAME ITtelephony************************

        package com.collblockinandroid;

        public interface ITelephony {
        boolean endCall();

          void answerRingingCall();
        
          void silenceRinger();
        

        }

        ********************** my menifest file is ********************************************

        L 1 Reply Last reply
        0
        • U User 10659791

          ****************this is my first java file of my application ***************** package com.collblockinandroid; import java.lang.reflect.Method; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.telephony.TelephonyManager; import android.util.Log; public class CallblockinandroiddemoooActivity extends BroadcastReceiver { Context context = null; private static final String TAG = "Phone on Call"; private ITelephony telephony; @Override public void onReceive(Context context, Intent intent) { Log.v(TAG, "Receving...."); TelephonyManager telephonymanager= (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); try { Class c = Class.forName(telephony.getClass().getName()); Method m = c.getDeclaredMethod("getITelephony"); m.setAccessible(true); telephony = (ITelephony) m.invoke(telephonymanager); telephony.silenceRinger(); telephony.endCall(); } catch (Exception e) { e.printStackTrace(); } } } ********* After that i make a file of aIDL THAT IS GIVEN BY THE NAME ITtelephony************************

          package com.collblockinandroid;

          public interface ITelephony {
          boolean endCall();

            void answerRingingCall();
          
            void silenceRinger();
          

          }

          ********************** my menifest file is ********************************************

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Please edit the above entry and format it properly between the appropriate <pre> tags so we can read it. Also explain whaere it is failing and what error codes or messages you see.

          U 1 Reply Last reply
          0
          • L Lost User

            Please edit the above entry and format it properly between the appropriate <pre> tags so we can read it. Also explain whaere it is failing and what error codes or messages you see.

            U Offline
            U Offline
            User 10659791
            wrote on last edited by
            #5

            Sir no error is shown in my application code but problem is that while we run this app then it gives Application not responding Error to the emulator . i cannot reconize that where is problem ..

            L 1 Reply Last reply
            0
            • U User 10659791

              Sir no error is shown in my application code but problem is that while we run this app then it gives Application not responding Error to the emulator . i cannot reconize that where is problem ..

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Member 10693658 wrote:

              i cannot reconize that where is problem .

              I'm afraid we cannot either. You need to use your debugger to try and find out what is happening in your program.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups