I am using Google Identity Toolkit for login into app I am working on. The problem is, when I get an error (INVALID_IDP_RESPONSE, some error codes without explanations and so on), the Toast with an error code appears. I tried to use a custom UI Manager but then I have to handle all the screens and cannot use the default ones. I am pretty happy with everything beside handling error codes.
So, the question is, how could I actually handle all of the error codes as I don't get them in sign in callbacks? Toast is also problem and I want to get rid of it, but I think I have to use custom UI manager, as I mentioned earlier.
Thanks
Yes, in this version you need to use the custom UI manager to avoid the Toast. However, if you constantly see the INVALID_IDP_RESPONSE error, most likely there are some configuration mismatch between your app and your Google Developers Console project.
Related
The problem I'm facing is that for a given custom event, sometimes certain event parameters are missing in Firebase, even though logcat is showing that everything was submitted correctly. Most notably, sometimes even some of the firebase_* and ga_* parameters are missing in the DebugView. No errors are showing up in logcat or anywhere else.
The set up is as follows:
Blaze plan
6 custom event parameters in total
firebase-analytics:17.2.0
Android API 28
Not reproducible on iOS, only on Android
Unfortunately I can't provide a MCVE right now, but maybe someone has ideas what could potentially cause this? Is this a bug in the Firebase Analytics SDK perhaps?
This is a known issue in the DebugView according to their support. It doesn't affect the actual data, only the DebugView data.
I'm new to android development and I tried 2 tutorials to get the current location but neither of them work for me. I get the exact expected layout but instead of showing the location, it appears to be totally blank as if the command that sets the text field doesn't exist. The logcat doesn't show any exception that's why I didn't post it. Everything else looks normal.
I thought it might be something related to the permissions that must be ran in realtime starting from android 6.0 but this tutorial that I've tried deals with that issue, besides doesn't the lack of permissions throw a security exception ?
Here are the two tutorials that I've followed exactly as they are:
http://demonuts.com/2016/12/30/get-current-location-android-studio/
http://www.viralandroid.com/2015/12/how-to-get-current-gps-location-programmatically-in-android.html
For maps to working you need to put google_maps_key into google_maps_api.xml which is under values folder. You get this key in google api manager.
I am facing a strange issue with my app - if I specify a wrong API Key, I get an authentication error as expected but when I specify the right key, I don't get any error message but just a blank screen. What is even more strange is that when I use the same Google Play Services project in a test project, the map loads and is displayed properly.
I have set the Build Target as 21 for both my app as well as the Test project. Please let me know if you might know the reason. Appreciate your help.
Check you've put the API key into the correct google_maps_api.xml. It me a couple of hours to notice there are two. One for Debug and one for Release.
Finally figured out the reason - all the processing was done on the UI thread, and my phone being slower, was dropping the UI processing. Moved most of the logic to a separate thread and the map started to get displayed.
Obviously with code, errors can occur anywhere. So without having try/catch blocks all over the place (which as I understand it is major overhead) how do I allow errors to bubble up to the application level and then handle them there? Or at the very least, record the error somehow for troubleshooting? I found information on an product called ACRA, but the setup instructions are geared for Eclipse projects. I am using Mono for Android in Visual Studio 2010.
That's a bit of an "It depends" question.
The appropriate handling of an errors is going to depend on what the recovery strategy needs to be, how much information you want the user to see etc.
I wouldn't worry how many Try/Catch blocks you use - just use them wherever you need to handle an error that gets thrown - if they're everywhere, your strategy is probably wrong.
It terms of logging and later interrogation, you can log caught errors using the Android.Util.Log class.
These can be interrogated (provided you're debugging on your own device) using Logcat.
There's some more info on logging and Logcat here.
Found this project that writes crash info to google docs. Android Crasher
I am android newbie.
I made a simple program, and I used Toast code for checking if variable is correct or not. After finishing test, I have to remove all the Toast code to release app. I think there must be more effective and better way to do this.
please help me
thank you in advance.
Use LogCat. You can output values to LogCat output using Log.d in your code. You can read detailed information about LogCat and logging here Debugging in Android using Eclipse
If you use ant, you can have define some parameter like build.debug in build.properties files, you will need to have two different files build_dbg.properties and build_rel.properties.
I would extend the Log class and redirect everything to android.Log.
In your own implementation you can then fire the Toast.
You will need to pass the Context and maybe execute it on UI thread.
If you use Log.[vdiwe], you should consider to use Androlog. It does the same as the default android Log class, but you can switch it of when you release your app later on.
It also supports some kind of reporting mechanism, which I did not test up to now, but looks promising.
I’ve never bothered with the Log class, because I found that everything written to System.err appears in the Android log regardless.