Usernames and passwords
iOS
It is somewhat unclear, but I assume that you are talking about getting OTHER installed apps' login information since I don't see why you would need a generalized way of getting your own app's information.
As for the iOS part, this is not doable. Most apps stores passwords in the keychain (like Apple suggests), and there is no way to share a keychain access group with other apps (except if the apps share the same Bundle seed ID, but that is not the case here). The Apple Keychain Services Concepts clearly states that
The iOS gives an application access to only its own keychain items.
The keychain access controls discussed in this section do not apply to
iOS.
Android
I strongly doubt there is a way on Android, but I will leave that for a more experienced Android developer to answer.
EDIT: Since you have not received any other answers I will go ahead and say what I think regarding the Android part as well. Generally speaking, Android does not provide a way of storing credentials the same way as iOS does it. Instead, there are multiple ways of doing it. On their Security Tips site, they state that where possible, username and password should not be stored on the device. Gmail, for example, does not (perhaps unreliable source). If you do store them on there, it also says that
By default, files that you create on internal storage are accessible
only to your app.
App detection
When it comes to detecting apps there are two ways to go about it (this is for iOS):
- Checking if a specific URL scheme is supported by the device (and thus the app is installed). This can be done with
canOpenUrl:
- Comparing the device's currently running processes to known app executable names. This is done with
sysctl()
. This is a neat way of doing it: UIDevice Category For Processes
For Android, check out this example: How to Get List of Installed Apps in Android.
Conclusion
By design, there is no way to get usernames and passwords in either iOS or Android. There are ways of getting a list of most apps installed on an iPhone. This should also be possible on Android, I provided a link that describes one way of doing it.