On Android or iOS - how to approach the possibility of a service or app going into a broken state - iphone

...and this broken state persisting until a device restart, since a naive attempt to restart an app would not work. Many users are not savvy enough to know how to terminate services/backgrounded apps. If the user can't (or doesn't 'need to') close apps, then what about restarting apps which have gone wrong? ( It can happen :) ) If my app goes wrong on someone's phone and they cannot easily restart the app without restarting the phone, that seems like a problem. I am aware that apps and services can be terminated by navigating system menus or double tapping the home button etc. but - many users are not aware of these features. For this reason I am thinking of adding an explicit close button to my app which will kill everything to the best of my ability, such that on a subsequent launch the program runs from the beginning again. I realise this is not the 'recommended' approach. Thoughts?

Thoughts?
Don't do it. Instead you should put a FAQ entry on your apps website that says.
Q: My app does not run anymore. HELP!
A: First you should try to restart the app. If that doesn't work feel
free to contact me.
Here is how you do this on the iPhone,
iPad or iPod.
double press the home button. the
multi tasking bar appears.
[ some screen shots ]
long press the app icon and press the
little x that appears on the icon.
[ more screenshots ]
If you want to put buttons for functions that are not obvious for many users you end up with a button for everything. And I (as somebody who knows every function) don't want a button cluttered user interface.
You would be surprised how many emails I get about "how can I zoom?" (A: Pinch your fingers) or "how do I delete an entry (in a tableview)" (A: Swipe your finger over the entry from left to right, and press the red delete button).
If I get an email about this I just point them to the faq which has some nice screenshots.
Btw, if the "broken state" happens so often that you would consider adding a special button I would check my code for bugs again.

Related

How to close System dialogs that appears on app crash?

I'm using xcuitest framework to automate mac application. I get system dialogs when the app is opened again after it crashes. I want to handle the dialog programmatically. But the dialog appears under the process `UserNotificationCenter' instead of the application under test. How can I handle the alert in such case?
You have two options:
Use InterruptionMonitor (documentation, use-case). This
approach is however kinda old and I found, that it does not work for
all dialogs and situations.
Create a method, which will wait for some regular app's button. If the app's button (or tab bar or other such XCUIElement) is visible and hittable after your app started, you can proceed with your test and if it's not, you can wait for the UserNotificationCenter dialog's button and identify&tap it by its string/position.
I'm using the second approach and its working much better, than the InterruptionMonitor. But it really depends on your app layout and use-case.
You should be able to revent it from appearing in the first place. Something like:
defaults write com.apple.CrashReporter DialogType none

Is it possible to write a custom TouchBar app for an existing application?

I have tried looking for an answer to this but can't seem to see anything about it.
I have a piece of software on my laptop (not written by me), that I want to customise. Some of the tasks I do are very repetitive, and could be simplified by just pressing a button on the Touch Bar that executes a number of commands.
Is it possible to write a Touch Bar app that either:
1) Customises the application's original TouchBar app (for which there is none)
2) Runs only when that application is running, and hides when the application is out of focus
Thanks
I believe BetterTouchTool can do that.
Also in the "App Specific" button you can customise when to hide system touch bar and when to show it again

Disabled keyboard state in iOS 6?

I have implemented a "token" or "chip" text field similar to the stock messaging apps where a user enters entries which become colored tokens. When a user presses backspace, it highlights the token, and one more backspace deletes it. This all works great on iOS 5.
On iOS 6, however, once my tokens (UIView-based) are highlighted, and they call becomeFirstResponder, the keyboard becomes disabled as seen below. When testing in the simulator using the "hardware keyboard", things still work fine, but a real user on device cannot press backspace again since it is disabled.
How does one avoid this? What calls/properties should I even be looking for? In my research I am unable to find what this mode is called or how it is used.
Thanks!

iOS: Making an App terminate when leave screen

I've build a simple app activating something in hardware, not important.
Now I just want the app to terminate completely if the user leaves the screen, switches apps, gets a call, press the home button, etc.
I'm all mixed up by all the application states, I couldn't find the right place to handle it.
I guess I need to listen to an "going to sleep" event and put a termination command (exit!)
or something like that.
This is easier than what one might think.
In your app's plist file define (check) the option "Application does not run in background" (UIApplicationExitsOnSuspend), and you are done.

How to create android app running on top of another app

I want to develop a program like button savior (which runs on top of a another app and we can press menu, back buttons on top of a running app). So user do not need to press hardware buttons to access menu, back functionalities.
I want to do the same but to do it I have to run a app on top of another app.
How can I do this?
-Lasith.
Take a look at Robotium: http://code.google.com/p/robotium/
It seems to be doing what you want to do. You can take a look at the code and figure out how to do it.
Well i think that what you are looking for is creating something like Input Method (IME), there is a good tutorial to start with on Android Docs, another thing you can do is to create an activity which contains your virtual controller, distribute that as a lib and then if someone need it they can downloads and register your component into their project, something like what AdMobs does.