Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Phone calls during a game

Options
  • 09-12-2013 11:04pm
    #1
    Registered Users Posts: 25


    What are the methods used to deal with phone-calls during a game?

    Are there different methods depening on the game-type, online v offline, single-player v multiplayer?

    Without handling it, I guess the phone-call gets priority and interrupts the game.

    Firstly, are you actually able to prevent this, and secondly, should you?

    I am thinking a good solution is to allow the user to determine how they should be interrupted.

    Either the default where the phone-call gets full screen priority or a pop-up notification.


Comments

  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Depending on the platform, there are specific guidelines for handling incoming calls. I don't think any of the guidelines mention preventing a call.

    It's fairly safe to say the game will be interrupted, you will need to work out how your game handles this.

    Go download the developer guidelines, they're available free for both Android and iOS.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    FicheCuig wrote: »
    What are the methods used to deal with phone-calls during a game?
    With Android, take a look at PhoneStateListener.


  • Registered Users Posts: 25 FicheCuig


    Thanks. I did forget to mention that I'm interested in Android.

    What I will look to do is something similar to this:

    Screenshot_2013-02-04-13-50-13_610x343.png

    pg782c5rMHLjJ70QVFKOzTNwqJIqDGtCAJKfrd_M7aEP7HfLjEXEI2BUrbcXxX3vp4kZ=h900-rw

    SmallCall


  • Registered Users Posts: 98 ✭✭YoungPayters


    See here for a guide on how to use the hidden ITelephony Aidl to cancel calls. This should help you cancel any calls from people while your game is playing.
    http://androiddesk.wordpress.com/2012/08/02/blocking-a-call-without-user-intervention-in-android/

    However you still need to use the activity lifecycle methods (onPause(), onResume()) to store key information on current game play as some phones will show the dialer for just a couple of milliseconds, enough to place your game in the background.

    If you want to show SMSs similar to the screenshot then you need to register a broadcast receiver for SMSs and have your own in game notification image appear displaying the body of the SMS.
    You can look into setting up a SMS broadcast receiver here:
    http://androidexample.com/Incomming_SMS_Broadcast_Receiver_-_Android_Example/index.php?view=article_discription&aid=62&aaid=87


  • Registered Users Posts: 25 FicheCuig


    Nice! Gonna check these out! Thanks!


  • Advertisement
  • Registered Users Posts: 18,272 ✭✭✭✭Atomic Pineapple


    You can no longer get access to the internal telephony calls in the latest versions of Android, I think it was from 4.0 on wards it was blocked.


  • Registered Users Posts: 98 ✭✭YoungPayters


    You can no longer get access to the internal telephony calls in the latest versions of Android, I think it was from 4.0 on wards it was blocked.

    Not true. You can still access it through reflection and having the ITelephony aidl stored in your project.


  • Registered Users Posts: 18,272 ✭✭✭✭Atomic Pineapple


    Not true. You can still access it through reflection and having the ITelephony aidl stored in your project.

    Really? Hasn't worked for me on any top end phone since Android 4.0.


  • Registered Users Posts: 98 ✭✭YoungPayters


    Really? Hasn't worked for me on any top end phone since Android 4.0.

    Yeah I had a working example with an S4 and that is JB.
    I would say take a look again, because your app/phone is broke :p


  • Registered Users Posts: 18,272 ✭✭✭✭Atomic Pineapple


    Yeah I had a working example with an S4 and that is JB.
    I would say take a look again, because your app/phone is broke :p

    Luckily its an old app that I don't support anymore! :D


  • Advertisement
Advertisement