How can I get statistics about how many of my users have rooted phone? Does the Google/Firebase analytics produce such reports?
Update: I know how to check root permissions. The question is how can I get statistics? I can add check for root in Application onCreate() and send it to analytics. But I will get so many events as the number of starts of applications, what is not what I am looking for. Of course, I could write my own backend and send some device id and and root status there but I think I am not the first and it is not needed to write my own bicycle.
I want to be able to see something like: "In last month, 30% of active users had rooted phones."
P.s. I do not have experience with google analytics, so if it is possible to somehow specify such type of event (for example, I already have value "isRooted = false" in my application), show me an example or give a link to manual, please.
Rather than using events, I would use Firebase Analytics user properties.
Define the property "is_rooted" in Firebase console > Analytics > User properties > New
Set the property in your code (Your main activity's onCreate() sounds good) :
FirebaseAnalytics.getInstance(this).setUserProperty("is_rooted", true|false);
Then you can use this property in filters, and even create audiences, etc. in the console.
Hope this helps.
No, Firebase/Google Analytics does not contains method(s), who provided this info.
But, you can check independently, if device was rooted and send your custom report.
You can check root permissions like this
Related
I have an Android App where I want to the UserName and serverURL to be pre-filled when device opens , Based on the device enrolment it will fetch the these values on userName and serverURL field .
Can I use Android Restriction API to get those configuration value.
like below
List<RestrictionEntry> restrictions =
manager.getManifestRestrictions(Constants.PACKAGE_NAME_APP_RESTRICTION_SCHEMA);
It seems documents kind of vogue for Android
Android documentation isn't perfect but at least this one about managed configurations is a bit good ;) .
To provide externally managed configurations:
Declare the managed configurations in your app manifest. Doing so allows the IT admin to read the app's configurations through Google Play APIs.
Whenever the app resumes, use the RestrictionsManager object to check the current managed configurations, and change your app's UI and behavior to conform with those configurations.
Listen for the ACTION_APPLICATION_RESTRICTIONS_CHANGED intent. When you receive this broadcast, check the RestrictionsManager to see what the current managed configurations are, and make any necessary changes to your app's behavior.
You can also check the sample projet AppRestrictions for more details.
Good luck
For example I expect this kind of situation: data in my application lost relevance and so it usless until update. And until update it have to show users some predefined message.
Is here any simple and free solution to this task?
Guess I can use some server to somehow send simple messages... but it sounds way too complicated.
If this is important I use Xamarin.
Update: main difficulty here is fact - my application can't in any way define if it's outdated or not. This may happen in random moment.
Although the requirement is not very clear I assume Update here means app update.
each time user launches app make call to an api on ur server to check if user needs to update app
If that returns true take user to a static view that says app needs update and redirects user to google play to install updates
If you want to avoid using a server, you should try Firebase (https://firebase.google.com/). More specifically, you should use Firebase Remote Config (https://firebase.google.com/features/remote-config/).
Define in a key-value pair of something like minimum_app_version_required in Firebase Remote Config. Every time user opens the your app, compare the values of app version and minimum_app_version_required that you are getting from Firebase console and show a dialog box accordingly. You can also change the value of minimum_app_version_required anytime you want.
Just set some internal flag. That when that situation occurs, you can set the flag to true and just edit whatever layout element you are using such as listView or any other element with your predefined messages saved in strings.xml. You can also build any custom pop up screen, depends how you want to show them. Let me know if you didn't understand or exactly how you want?
Need to implement versioning for this problem. To achieve this, you have to maintain a version number in server, this is the version number you app will have to save and use it to validate with server. If both are not same, then app will get the latest data from the server.
I can't seem to find any literature on expiring content with Android's App Indexing feature.
Let's say you have an app that shows users information on store sales. The store sales are time sensitive - they will eventually expire, and no longer be available. While the sale is available the user can see related search results because the app has used App Index to declare them. Eventually, the sale expires though. The content is presumably still in the App Index, but it's now dead from the perspective of the app.
How does one deal with this? Is there a way to explicitly remove content from App Index? Are App Index entries automatically expired if not declared again within a given timeframe?
The app index entries won't get expired on their own. They will be always visible in the history.google.com of that particular user. So you have to create a mechanism to gracefully handle your case. You can check for the timing in the code that handles the deep-link and take action according to that.
I believe the main question was how to remove deep links from App Indexing in the cases that the Web URLs linked is no longer available due to be time sensitive.
Now regarding your deep links to stop appearing in Google Search results, there are a few options to handle these time-sensitive issues:
1- Use the "unavailable_after" robots meta tag as explained here https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag?hl=en / https://googleblog.blogspot.it/2007/07/robots-exclusion-protocol-now-with-even.html
2- Add a noindex robots meta tag and inform Google about the page-change via the sitemap file
3- Just remove the page (or add a noindex), and Google will recrawl it after a while automatically.
Apart from this, I would recommend you to implement an exception handling for the cases that the App can not obtain any content from the server. You probably can use the HTTP error 404 for that.
Currently we can use logcat or ask other testers to send logcat files. But What i want as to see logs when app is on play store. So let's say if any request contact us for some problem that he is facing. Then it would be easier for us to see that user's device logs and figure out the issue. Because some issues are not easily reproducible.
Is there a way I can get the logs of device which i don't have a physically access to using some tool when the app is on play store?
EDIT
I don't want use in a way where user has to upload logs files and manually send it to our team. It should display live log on a website or provider's console.
You can track logs with Google Analytics. Just send trackers to analytics on the places you usually send logs.(You must initialize tracker first. See link below)
Example :
Tracker defaultTracker = GoogleAnalytics.getInstance(this).getDefaultTracker();
defaultTracker.send(MapBuilder.createEvent("Logger", "Log_Tag",
"Log_msg", null).build());
And you will get a event group in the Behaviour section of google analytics called Logger that has list of Log_Tags that has List of Log_msg
It is pretty easy to implement. See this link on how to add Google Analytics to your app https://developers.google.com/analytics/devguides/collection/android/v3/
Hope this helps you.
You need a custom Log service to store the important logs/errors
From your app if any crashes or important Logs you send it Log server for future reference.
Click Here
You should try Crashlytics
Crashlytics for Android delivers real-time crash reporting across all devices. We perform a deep analysis of each stack trace to identify the most important frames and we break down every bug by device model and version so you can spend less time finding and more time fixing issues.
What if "NETWORK" is not available when your app crashed on users device to update/send a crash report to you.
For me,
1.) I will get Crash Reports when User hits "Report to developer" at the time of crash.
2.) I use Google Analytics, to get the description of the app with location(which line of code) of error from "Crashes and Exceptions" under "Behaviour" tab.
Also, by modifying/adding your Google Analytics Code, as mentioned here: Crashes & Exceptions
Try your Luck!
You can use Log4j library in android.
What is Log4j library?
It is an logger library in java. And it allow the application to write logs in to your file, email when caught exceptions and can send logs in background to your server or any else. So that you can see the logs of every individual device and track the issues.
download it from the below link:
Log4j for android
Hope it will help you.
Currently I'm using ACRA.
The official link contains all details you need and offers different way of "User interaction mode", "Reports destination" and "Reports content".
If you implement it very well on your app, you can have a full report of what is happening.
Keeping in mind few things u can do it :-
create log files.
store them in your applications private area and not in sdcard ( to avoid deletion by user
or if on sdcard then use . before directory to hide it from user )
keep a service running at the background.
start uploading the document after every hour or when app moves in the background or the
file size increase >10 kb etc... depends upon choice. and remember to upload all files
in this directory.
if uploads successfully delete dat file else leave it which will be uploaded next time.
try to implement zip to make single file if file count is gr8er then 5 suppose.
In a nutshell :-
a. record.
b. zip
c. upload
c. delete.
this is my view remember
Under the 'Accounts & Sync' settings graphical OS menu, there are listings of user-configured Google accounts.
Please could someone point me in the right direction to programmatically change the sync settings associated with one of these accounts?
Thanks
Those settings use the new AccountManager APIs. Here's some sample code that shows how to add a new account. I'd assume that you'd want to get the credentials of one of the existing accounts and simply modify the data.
Unfortunately, I haven't had a chance to try out those APIs yet.
Maybe ContentResolver#setIsSyncable() can do what you want.
Perhaps would be better to fire the android.provider.Settings.ACCOUNT_SYNC_SETTINGS intent with either the EXTRA_AUTHORITIES extra set to ["google.com"], or possibly put the extra named "account" as the Account object you got from AccountManager. Then your user can turn their sync on or off for themselves.
ContentResolver.setSyncAutomatically(account, authority, true/false): sets whether or not the provider is synced when it receives a network tickle.