Getting crash logs, debug information from android users? - android

This is my first android app.
The code that is heavily tied to hardware features such as the sample rate of the on-board sensors. On most devices the app works, on some I can catch the error and display a message saying that the device is not compatible, but on some devices (perhaps the fault of the phone manufacturer or faulty drivers), the device simply crashes. I need to know where the crash happens and for what devices.
Does a service exist that will enable me to collect debug information and crash logs from an android app I release on the marketplace. For example, something that will send statistics every time a user's app crashes an interface similar Windows Error reporting appears?

Use Acra.
it sends you detailed log right to your google docs
http://code.google.com/p/acra/

Look into https://www.crittercism.com, we use it, and it works nicely.
There's also an open source project for this: http://code.google.com/p/acra/

Related

Google Nearby not working on Android Things by default

I'm developing an Android Things application on the iMX7D development board and I have implemented Google's Nearby services. The issue I have is that I get an error (sometimes) when I begin advertising the device. Here is the error:
com.google.android.gms.common.api.ApiException: 17: API: Nearby.CONNECTIONS_API is not available on this device.
I have managed to fix the error by following the instructions on https://stackoverflow.com/a/51428433/6377151, and that allows the code to run fine. The error gets fixed if I run the ADB command
adb shell am force-stop com.android.iotlauncher.ota
And then run the application, but that only works for the one time. As soon as the device is rebooted, the issue comes back. I'm aware that this is because the default launcher is already advertising the device, but I'm not sure how to fix this issue in code automatically when my application runs. But I need a way to either do this automatically on startup or to overcome the error in another way.
My Android Things device is running Android Things 1.0.10. Can anyone assist?
Disclaimer: I work on Nearby.
We have a release ready to allow multiple apps to advertise/scan at the same time. It's code-complete, but code pushes are slow at Google. It'll be a while before it's public. Note: Android Things boards might need to be reflashed to get the update. That was the case in development, but is hopefully not the case for release builds.
In the meantime, you'll unfortunately have to either install another launcher, or force stop the existing one. We treat clients as first-come-first-serve.

Why do application need serial number?

I use XPrivacy module on my android mobile. After installation of some app, when I check permissions that application is asking, 'almost all' the time application ask for "Identification" which I suppose is generally is serial number of my device. I have few noob questions on this
Why do android application need serial number of my device ?
Why it stops working when I block access to it (it stops working initially but works after 3-4 times you open app)
What will company do with that information (I know it will vary according to their privacy policy but what do they do in general?)
According to [https://android.stackexchange.com/questions/73361/what-does-serial-and-proc-permissions-stand-for][1] "Serial permission allows the app to grab a unique identifier for for your phone." I think it can be applied on user behavior stats report upload, to identify each different mobile user.
The reason why it stops working when you deny the permission request from the app is because it can't get the permission and some of it's function might throw some run time exception and cause the app crashes or stopped if the app developer handles the run time exception properly.

How do I gain access to the application logs on an Android TV device?

I want to be able to access logcat for an app running on an Android TV device, but the TV only has a USB plug not micro-USB.
The Android TV device is
Running a custom Android 4.2.1 ROM (from manufacturer)
Doesn't provide access to device settings
Only has USB plugs
Environment#getStorageState() is always MEDIA_REMOVED
How can I get access to the application log?
You refer to
access logcat for an app
If "an app" is one that you are developing, then although Android now restricts installed apps from seeing the global logcat output, it still allows you to access data that your own process sends to logcat (whether from your own code, or from framework code that runs within your process). It's a simple matter of getting your app to run the logcat command on the device to send the data to a file, and then uploading that file to a webserver somewhere so you can read it.
(Read logcat programmatically within application gives the general principle, which is to exec the logcat program, and then read its output).
If however you are trying to get the logcat output from all the apps on the device, then getting adb working in some form is your only viable choice.
I assume you can install apps on the device, by placing them on an external website and downloading them using the device's webbrowser, then opening the downloaded file.
Thus you may be able to install a settings app extracted from a 4.2 phone, which might allow you to turn on adb debugging (though as you point out, the physical cabling is unusual).
For those facing a similar issue, the solution I have chosen is as follows:
Created a replacement for Android log that decorates Android log but also logs to a log4j RollingFileAppender. This was necessary because the circular logcat buffer on some of the devices was so small that it only contains 5 minutes of log.
Added a menu action that posted all the log4j log files to a web
server
Added a Servlet to my web server to capture client log files and
write them somewhere meaningful.
This seems to work reasonably well.
Aside from item 1 it is pretty the same as zmarties suggestion.

can't find chromecast device using Google's sample app

Using this code, https://github.com/googlecast/cast-android-sample, I build android chromecast sample sender application.
And I also modified the code to use my appID, and uploaded whitelisted URL (already registered to Google).
But I can't find the chromecast device from this sample app. I mean, onDeviceAvailable() is not getting called. And I don't see any suspicious error / log while i am running the app.
is there anything that i need to try to see why i can't find the chromecast device?
(BTW, youtube app in the same device can find the chromecast device)
another question, which may not be related to the main question.
registering the device to have app_id, and whitelisted url is not mandatory step to find the chromecast device from app. right? I guess that registration step is needed for media stream not for device discovery.
can anyone share working sampleapp code / receiver.html? (for me to make sure that i didn't make a mistake..)
Thanks!
Did you try the Tic-tac-toe Android sample too? These two apps are using different ways of displaying the list of ChromeCast devices to the user.
Both sample apps work just fine for me. I used the default reciever.html and only added my own app id.
Technically it is not necessary to register the device to discover it on the network. You can try this app to find all DIAL devices: https://github.com/entertailion/DIAL
However, the Google Cast API wraps the DIAL discovery and they might be enforcing the app id requirement.
Ok, I think i found the cause (with help of you guys, thank you), but that does not mean that i can solve this.
TicTacToe is working because it does not need my app id. it's using something generally working (like what youtube / netflix is using).
I tried "TicTacToe" as app id for cast-android-sample app, and now it can see the chromecast device.
I tried my app id to TicTacToe and it can't show the web page on the screen. (of course i modified my receiver page that is whitelisted)
From above 2 test results, i am confident that there is something wrong with my app id.
How to solve? should i reply to "nobody#google.com" who gave me the app id? or should i register my device again? (is this ok?) i am not sure.... can anyone tell?
Assuming that you've also changed the settings on the Chromecast to send the serial to Google, then you may just need to wait a few hours after doing so. I was having the same issue where my device wouldn't show up with the sample app, after waiting a few hours after changing that setting it showed up just fine.
Did you try rebooting your device by going into your Chromecast settings via the Chromecast Android app or the Chromecast app for your computer?
I spoke to the Chromecast support team because I was having the same issue, and the reboot got it working.
To make sure that your device is whitelisted, you should be able to access this page from chrome (from a computer on the same network as your chromecast device):
<IP address of chromecast>:9222
If you can access that page, then it should work!

Disable Android from emitting LogCat messages

Is it possible to disable Android on a device from emitting ALL log messages from ALL apps?
On a rooted device maybe. With your own ROM mod, certainly. Otherwise, no. Bear in mind the logs are kept even when your tools are not looking at those logs (e.g., device is disconnected from your development machine).
No, you cannot do this. Some devices (like Huawey's) got logging disabled and you have to do some magic to get this functionality restored, but this is just custom firmware modification by huawey.
On a Huawei device, you dial:
*#*#2846579#*#*
This will bring up an app where you can disable all log messages. I'm sure every device has some secret phone number that lets you do this. No rooting necessary.

Categories

Resources