1

I have an idea that would require triggering a call or text message simply by pressing or dialing a certain number.

Example: Pressing 2324 on the pin code. Despite it not being your pin code to unlock the device, my application (always running in the back) would detect your code "2324" has been typed in and send a call or text message.

Another Example: Holding volume button for 5 seconds and then pressing "2" on pin code lock. This could be another trigger.

My question is, how flexible are the iOS and Android SDK's to allow this level of customization? Can I override tone settings via an application (change from Silent to Normal)? Can I close applications? What can't I do?

I tried researching this but have not come up with any recent or updated answer. Hoping someone could clarify what I can't/can do with Iphone and Android SDK's.

6
  • 1
    For "atypical" use of Android SDK, asking on Google Groups - Android Developers might get you answers that are closer to the knowledgeable source.
    – rwong
    Commented Jul 24, 2014 at 11:08
  • 1
    I suggest just plainly stating your design goal, which I guess would be a "distress call", or Duress code - a special code that is entered into a system in place of a normalcy code, which causes the system to discreetly send over a distress call to some intended recipients.
    – rwong
    Commented Jul 24, 2014 at 11:11
  • 1
    Implementing a duress code system may carry some legal risks; if you are looking to eventually go beyond the proof-of-concept stage (i.e. publishing it, whether commercial or free-of-charge), you might be well-advised to get some legal opinions.
    – rwong
    Commented Jul 24, 2014 at 11:36
  • 1
    My comment (regarding the need for legal opinions) is for systems that may serve similar purpose as existing emergency (distress) call systems: Enhanced 9-1-1 system in North America), and whether it may complement, compete or interfere with its capabilities or features.
    – rwong
    Commented Jul 24, 2014 at 11:39
  • 1
    Similar designs may have been patented, such as this. If you have a question about prior-art, you can ask on Patents StackExchange.
    – rwong
    Commented Jul 24, 2014 at 11:40

2 Answers 2

3

I'm an iOS developer so I don't know much about Android, but the way that iOS works is that each app is inside its own "sandbox" so that the apps cannot call actions on each other such as closing. This is done as a security measure. More on App Sandboxing (paragraph 'The App Sandbox').

The only way apps can interact is through urls such as "tel:1-408-555-5555" to open the phone app and pre-enter the phone number 1-408-555-5555. More on device urls here. You can custom configure urls for your app, for example Facebook and Twitter have their own app urls you can call from your app to open up Facebook or Twitter if the user presses a certain button or whatnot. But after that, all control of the device and the user interaction is up to Facebook or Twitter, not your app. If they are posting a status and the Facebook app closes after that, then control is returned to your app, but there is only one dominant and active app at a time.

As far as volume, I'm not 100% sure but I don't think you can control silent/sound since that is controlled by a hardware switch on the side of the device.

Overall, no, Apple doesn't let you interfere with other apps. If you have an app running in the background, it cannot pick up on activity done within another app (due to the sandbox).

So I dug through the Android docs a bit and found this article on interacting with other apps. Most interestingly is this subarticle which seems to indicate that you can collect a result from another app. This might be what you're looking for? However I don't know how you would collect results form the lock keypad as that's not really an "app", more of just the OS itself. It seems that this use is more of like opening contacts and getting the info for which contact the user selected, which iOS supports that functionality too. But there's no like "listening in" on just any app. Again, not an Android guy.

5
  • Ok so the basic idea is that I want to be able to create an easy trigger for people to dial out to multiple people. For instance, I want to make a trigger (could be anything: type on pin code, press hardware button a certain way, etc.) but it needs to be very accessible. This trigger would send out a text message, and open my app. After the app opens, I need it to turn on data/wifi, and be able to open a connection with another phone over 4g and continuously send voice and gps and camera data until an abort function is pressed. Is this possible on ios?
    – tabchas
    Commented Jul 24, 2014 at 4:49
  • If it is possible, how would it be? Like what would you imagine a the fastest trigger accessible to people that iOS SDK allows? Also can my app turn on data/wifi, gps, start a connection with another phone, and send gps, camera, and voice data all simultaneously?
    – tabchas
    Commented Jul 24, 2014 at 4:50
  • 1
    It would seem that what you want is not possible in iOS. That would quite frankly just be giving too much power to the developers. The Trigger seems to be only possible on jailbroken devices. As I said, outside the app's sandbox, you have no control. The closest I found looking around the internet for overriding settings is the ability to change network settings, but on OSX (mac), not iOS. It is definitely possible to connect to another device over data and send information, granted that the user has their data on. Commented Jul 24, 2014 at 5:09
  • 1
    For iOS, try ask on Apple's discussions as well: discussions.apple.com/thread/4315446?start=0&tstart=0
    – rwong
    Commented Jul 24, 2014 at 11:14
  • Android: Intents do let you pass messages between apps, and sometimes get a response back, but only at preset points - for exactly the same security and sandboxing reasons you describe for iOS. You can't just hook into another app at any point you want (well maybe you can on a jail broken device). So I don't think Intents will help OP in this case.
    – James
    Commented Jul 25, 2014 at 7:24
2

Android:

Pretty sure its not possible to hook into the standard unlock screen in this way.

But, in Android you can write an app to provide a custom lock screen, and once you've done that adding a "duress/distress" function would be easy. If you just search for "Android custom lock screen" you'll find tons.

Edit: or you can write a widget that the user can place on their lock screen, and then capture an interaction in that.

2
  • Does the phone have to be jailbroken in order to place a widget on the lock screen?
    – tabchas
    Commented Jul 24, 2014 at 18:49
  • Jailbreaking not required.
    – James
    Commented Jul 24, 2014 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.