I just setup app insights on my android app but I am not seeing any telemetry make it to the azure dashboard. Does anybody know if you have to do anything special in the setup to make it work when debugging? The documentation doesn't specify anything that would make me think it won't send when in debug mode but I put in the right instrumentation key and I am getting nothing.
As one of the answers mentioned, I checked the logcat after enabling developer mode. and here is what I found:
W/com.microsoft.applicationinsights.logging Sender: Couldn't send data
with IOException: java.net.UnknownHostException: Unable to resolve
host "dc.services.visualstudio.com": No address associated with
hostname
and this...
I/com.microsoft.applicationinsights.logging Sender: Persisting because
of IOException: :We're probably offline =)
and this...
I/com.microsoft.applicationinsights.logging Channel: enqueued
telemetry:Microsoft.ApplicationInsights.PageView
There is nothing more needed to enable events while debugging. Can you please enable developer mode using
ApplicationInsights.setDeveloperMode(true);
and look for log statements in logcat that say you are successfully sending data?
If your problem persists, please shoot me an email via AppInsights-Android#microsoft.com.
By the way, there was a 1.0-beta.9 release the other day, are you already using it?
Related
I have a user who I've diagnosed to have object-box-related issues. I can send him debug builds with the ObjectBox debug flags (debugFlags(), debugRelations(), etc...) turned on. However, I would like to redirect the object box logs to a callback where I can collect the data and save to a file. Is this possible in ObjectBox?
Logs are currently created from native (C++) code, so there is no way to redirect them. But I agree a custom logger is a good idea (e.g. to log to an error report file on production builds).
If you have time, please create a feature issue for it at https://github.com/objectbox/objectbox-java/issues.
How to get complete logcat from remote users phone?
I came across BUGFENDER and www.REMOTELOGCAT.com ... (didnt use yet.)
I need advice what professionals use for remote logging?
What is the industry standard?
How can I get complete logcat from my client's phone living in another country?
In iOS it gets saved in the phone itself so client can email that log file but whats the solution in android ?
P.S by 'complete logcat' i mean COMPLETE logcat rather than specified logs in code like log.e("some exception occured") as in crashlytics...
I'm not sure how to get the full logcat in Android.
What I can answer is that I'm professional and I use Bugfender for remote logging in iOS and React Native and I know many colleagues using Bufender for Android as well.
I am new to Android. Please help me to know about the best practice of using Android Logger. Do I need to keep a file somewhere in android and keep on writing logs into it, or writing of logs into file is not necessary. What could be the best practice.
My real intention is this.
Once we go live, if our customers come back and tell us that something crashed or does not work in their android , then how do we debug ?
In the web application, I would ask my server administrator to provide the log files. What do we do with the android application when there is no server error, but something failed in the phone. Is there a way to get logs from the phone.
Thanks
Ravi
Depends on what you need, you need logging for semi debugging your application than you can easily use the buildin Log functionality. Via Logcat you can easiliy see the logs.
http://www.vogella.com/tutorials/AndroidLogging/article.html
//Declare a tag
String TAG= "SomeActivity";
//Log
Log.d(TAG, "Hello World"); //debug
Log.e(TAG, "Hello World"); //error
If you want to have logging of multiple devices when you have released your app. Use a dedicated Log Framework (e.g. Log4J) and upload it to a server.
One tip (if you are using Eclipse, and not directly related to question) - Eclipse is very unreliable for viewing logs. For apparently no reason it completely stops displaying logs every now and then. A simple solution is to use command line tools for viewing logs. On Linux you can do :
$adb logcat MyTag:D *:S
If you want to capture logs to a file you can do:
$adb logcat -d > logcat.txt.
Hope this helps!
If you are planning to publish/distribute your application then storing logs in a file is possible but as per my opinion better not a better solution. You can configure online tools from your app.
Catch all sever exceptions and sending all the details regarding that exception. And configure any one logging tool into you application.
You can see log4j http://logging.apache.org/log4j/2.x/ or ACRA http://acra.ch/ or http://www.crittercism.com/
The Android logger's (android.util.Log) output goes to a console that you don't have to maintain. You don't actually have to manage files, just outputs.
You have 5 categories of log:
verbose: use Log.v(tag, message)
debug: use Log.d(tag, message)
info: use Log.i(tag, message)
warning: use Log.w(tag, message)
error: use Log.e(tag, message)
For example:
Log.e("MyActivity", "Oops... caught this exception: " + exception.getMessage());
The LogCat console (this is its name) allows you filtering by log level. This is a ceil filtering. For example, if you filter by 'warnings', you will see all warnings and errors, but not verbose, debug and info messages.
You'll find more details here in the official documentation.
My real intention is this.
Once we go live, if our customers come back and tell us that something crashed or does not work in their android , then how do we debug ?
In the web application, I would ask my server administrator to provide the log files. What do we do with the android application when there is no server error, but something failed in the phone. Is there a way to get logs from the phone.
If you use file for storage logs - it possible problem with performance if the file become big. So you need clean file in time.
As for me best solution use firebase or https://fabric.io/.
We use fabric.io.
Also you can use some wrapper for default Log class. This one https://github.com/JakeWharton/hugo for example
I am using ADMS (omniture) library library in android, I want to enable the logs of request and response of omniture library, so that i can track what is exchanged with server, my custom app state is not visible in server reporting, I need to find where is the problem.
In ios omniture logs are printed on console, but how to enable logs in android. Any help is greatly welcomed... please help me.
I using the following code
ADMS_Measurement measurement = ADMS_Measurement.sharedInstance();
measurement.trackAppState(appState, contextData);
I found the solution
ADMS_Measurement measurement = ADMS_Measurement.sharedInstance(activity);
measurement.setDebugLogging(true);
measurement.configureMeasurement(TRACKING_RSID, TRACKING_SERVER);
I have successfully used the Android TicTacToe app to cast to the TicTacToe receiver app (AppID "TicTacToe"), using unmodified code from the TicTacToe example on github.
Next, I tried to use my personal receiver app. I got the email a couple of hours letting me know that my device was whitelisted and providing the AppID. I put the AppID in line 90 on GameActivity.java (not line 91, as stated in the instructions), and I also put it in line 35 of tictactoe.html (this step was missing from the instructions, but I assume it is needed). I also followed all steps in the Common Errors section of the instructions.
When I click the Start button in the Android app, the Tic-Tac-Toe board appears in the Android app, but the Chromecast device does not noticeably react.
Here is the LogCat:
07-28 00:13:47.776: W/StartSessionTask(10892): StartApplicationRequest failed with status: -4
07-28 00:13:47.826: E/ApplicationSession(10892): StartSessionTask failed with error: failed to start application: request failed
07-28 00:13:47.826: D/GameActivity(10892): start session failed: failed to start application: request failed
Try checking the box that says "Send this Chromecast's serial number when checking for updates".
Mine didn't work at first, after doing this and restarting mine seemed to pick up the whitelisted appID.
As mentioned by the author of question: Make sure to do from ChromeOS, Windows or Mac OSX client until they fix the issue from Android app.
Clients can be downloaded here: https://cast.google.com/chromecast/setup
This was fixed for me after I restarted the chromecast by removing power.
I tried Aaron's answer several times (was finally able to get the setting to stick using the Chromecast Mac app) but it still was giving this same error.
Then, I discovered I actually uploaded the receiver file to the wrong url. So double check which url was actually whitelisted!
Though even after fixing the url it still was broken. So I think I must have entered the wrong serial number when I made the whitelist request. I resent the whitelist request and the new app ids are working properly.
I solved same problem by using HTTP instead of HTTPS for my local hosted receiver, it seems Chromecast looks for valid certificate.