Android app: logging on the device - android

I'm still fairly new to Android coding. I've made lots of use of the Log.d() function in my code to display lots of handy logging messages to the logcat console within the Android Studio environment, when I run the app with the device connected to the computer (or on an emulator).
Now I'd like to be able to get debug information from a user when the app is running on their device, hopefully showing the same Log.d() messages that I see in the logcat console within Android Studio.
I've done some searching but can't seem to find a straightforward guide as to how this is achieved.
Thanks.

You have to use a web server. First send the content of logd() to your server and then check them on your server. However, you may want to test your own apps instead of asking users to test. Google developer console has a place to show some debug information if your app crashed when users are using them.

You can use a webserver, file-backed logger, or any other way of saving/submitting data on the fly.
Most people will recommend either some form of integrated web service like HockeyApp, etc., but you can get it done just by sending a plain old text file if needed. FYI, not best practice, but it gets the job done.

Related

Is that okay that android does open links from sms automatically (google does scanning my sms)?

I have android 10 huawei phone.
I found out that when I receive an sms with a link in it, my phone does a background request to the linked url.
For the test, I've made a custom link to my apache server. And checked the logs. I can see a regular GET request coming from non-my IP (66.102.9.127 which seems to be a google-related IP).
I know about the OG. But my settings state that I should explicitly click the preview area to load the OG.
That looks like a security breach, as some services may send my one-time verification links. And it seems, like google does some scanning on my messages and checks the links in it.
You might wanna check any base application comes with the phone doing that or not, instead of google. Any trace logs?

How can I protect an android app (it has some communication with a backend server)

I'm going to release an android app shortly on the Google Playstore. I am aware that most apps probably don't reach the level of success where the authors need to worry about their app being cloned, but I would still have greater peace of mind if I knew that I had done what I can to stop other people copying it/stealing users by creating an identical knock-off.
I suspect that it's unproductive to try to protect the app itself (?) but my app communicates quite a lot with a backend server and I'm wondering if there are ways to detect if I am getting traffic from my app or a copy? Is there any value I can get the app to send that could tell me, or some technique I could use to differentiate my app from copies?
Thank you
Read the below article at developer.android.com.It provides details on how to obfuscate your app.
https://developer.android.com/studio/build/shrink-code#obfuscate

Can anyone see the background urls my app is using. Like the http request made using volley.

I'm developing an app and I use volley to fetch data from server in background . Can anyone see the urls I have used in my app?
If yes then how? and how can I prevent anyone from seeing them?
Yes, people could see what URLs are used. Specifically:
Users can decompile your app, and read the URLs from the decompiled source. Use an obfuscator such as Proguard to make this more difficult.
Users can also attach a debugger to your app at runtime, again revealing the data. Remember that the user has full control over the device and anything running on it.
Users can use a network traffic sniffer, eg Wireshark, or a firewall which logs all traffic, in order to see what your app is requestion. Make sure you're using HTTPS in order to make this harder. Make sure you also implement HTTPS correctly, especially, this means to not simply accept all certificates.
You cannot completely prevent people from seeing the URLs your app is using, since the app is running on the user's device, where the user can do anything he wants with it. You can only make it harder.
See also:
How to avoid reverse engineering of an APK file?
Android - Get the URL of a file being downloaded, which I answered a while back.
Yes, for example you can open chrome developer console and look at requests that are being made from your app if you are developing web app. In case of mobile app, everyone also can sniffer internet traffic, for example connecting to your own wifi router and listen to traffic, or use special tools like portswigger.
You cant prevent your urls from being revealed anyway, but you can use https in order to hide data you send.
Hope this ll help.

Remote wipe data using Device Administrator Application+ android

I am working on android device policies, i am able to implement wipe data, force lock using sample given at below link
http://developer.android.com/guide/topics/admin/device-admin.html. I am not able understand how to wipe, force lock, change pwd Remotly from server. I spent lot of time in searching to get information but i am not suceed. Please give any information to implement policies Remotely.
Thanks in advance.
I've googled around a bit today as well, and I've come up with the following solution:
First, write a device administrator app, like the one referenced in the link you provided.
Then you will have to implement some technique so that you can push messages from a server to the android client. As of Android 2.2, you can use C2DM (Cloud to device messaging) provided by Google, I guess it isn't to hard to configure and get going. If you do not want to use this, there is the option to use some other kind of messaging framework, that allows you to push data, like XMPP or MQTT. The facebook messenger app for iOS uses MQTT, so that can't be all bad. It will however require more work setting up, than C2DM for example.
Finally you will have to push some kind of message from your server to the client via the method you chose and let your device administrator app listen to these messages and respond with the correct action, depending on message. So you can decide on your own what the messages will look like and contain.
There is also the option of using Exchange, but I do not know how that works.
So that is basically what I found out from my little research, I'd love to hear other ideas from someone else as well.

capturing and sending logcat output by email or to server

I'm developing an Android app which has some complex logic and I am having issues troubleshooting the app that has been installed by beta-testers.
Does anyone know if there's an easy way to capture logcat output and either manually or automatically email it back, or send it to a server? I have asked the person testing the app to install aLogcat app and send me the log, but there are 2 issues with this:
it sends all kinds of logging from other apps that I'm not intested
in
it captures a limited amount of log entries, and did not give the
log entries I needed.
If anyone has any experience with a similar problem and how to solve this, it would be much appreciated.
You could use Acra. I have used and it is great. It can send the crashreport to a GDoc.
I'm pretty sure there are other tools too, and I think since Android 2.2 google has something built-in but I haven't found any docs about it. (Android Error reports).
I would recommend Bugfender. It lets you send all logs to a centralized cloud server, completely managed by you, no need for the user to intervene.
Note: I am one of the creators of Bugfender, still I think this could help solve question.

Categories

Resources