I want to integrate AppSpeed Parameter in my Android Application, for that I have used the following code:
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);
// Build and send timing.
t.send(new HitBuilders.TimingBuilder()
.setCategory(getTimingCategory())
.setValue(getTimingInterval())
.setVariable(getTimingName())
.setLabel(getTimingLabel())
.build());
and called the above sendmethod with appropriate methods, but App Speed section of my portal is still blank. How it will show the data ??
Thanks
Use this:
t.sendTiming(loadTime, "resources", "high_scores", null);
To have in mind that the tracks of timing (App speed) sometimes are not refresh immediately like Events and Screenviews in Google Analytics Console. In my case, I had to wait a few hours to see the results. Also check to have in AndroidManifest.xml the following:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Related
I am trying to integrate Awareness API on a new project and I am stuck with an error saying: ACL_ACCESS_DENIED Status Code: 7503.
I have integrated Awareness API on other projects as well, but the last time I encountered that error, it was due to the lack of declaration on a needed permission, for the DetectedActivity feature to work.
This time though, I am just using the Location feature of the Awareness API.
I have also tried to change API keys, regenerate them and even enable/disable the API itself, from Google API Console, but without any luck.
I also have a proper Google Services JSON file and the version of Play Services I am using is: 10.0.0
compile 'com.google.android.gms:play-services-awareness:10.0.0'
Below is the code I am using:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data
android:name="com.google.android.awareness.API_KEY"
android:value="MY_API_KEY"/>
this.googleApiClient = GoogleApiClient.Builder(this)
.addApi(Awareness.API)
.addConnectionCallbacks(this)
.enableAutoManage(this, this)
.build()
Awareness
.SnapshotApi
.getLocation(googleApiClient)
.setResultCallback {
handleLocationResult(it)
}
I have done a lot of Google searching as well, but no hints other than a SO post talking about the same error on Emulators. I am not trying it on an Emulator. I am using a real device to test it.
If anyone has any ideas, I would be grateful!
Thanks in advance!
Apparently, AwarenessAPI does return such an error for different cases.
The Status Code: 7503 will be returned even if you:
Missing a Permission from your Manifest, such as the one for DetectedActivity
Have the Location setting off when requesting a Location snapshot (it does not cause the Location Settings dialog to pop-up)
I will leave it here, in case someone else stumbles upon such a case, in the future!
I have decided to include the Firebase Crash API 9.0.1 into my Android app.
At the moment everything is working fine. Now I want to give my users the opportunity to disable, that Firebase is sending the Crash reports automatically.
Firebase Analytics can be disabled with this code snippet
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(false);
Does anyone of you know a similar way to disable crash reporting?
Many thanks
Sorry for short answer but currently there is no official support for this.
EDIT: 30/10/2017
Now it is possible to enable/disable at build time adding in the AndroidManifest.xml:
<meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
or runtime using:
FirebaseCrash.enableCrash(true|false);
More info here.
Yes it is possible now. Check this,
Disable Crash Reporting
Simply add the below line to your code in the first activity or even better in the Application class.
FirebaseCrash.setCrashCollectionEnabled(false);
To enable,
FirebaseCrash.setCrashCollectionEnabled(true);
This is really helpful when we have multiple build types such as Debug, Release etc.
You can find the instructions on the page:
https://firebase.google.com/support/guides/disable-analytics
Disable Analytics collection on Android
Temporarily disable collection
If you wish to temporarily disable Analytics collection, such as to get end-user consent before collecting data, you can set the value of firebase_analytics_collection_enabled to false in your app's AndroidManifest.xml in the application tag. For example:
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
To re-enable collection, such as after an end-user provides consent, call the setAnalyticsCollectionEnabled() method of the FirebaseAnalytics class. For example:
setAnalyticsCollectionEnabled(true);
If you need to suspend collection again for any reason, you can call
setAnalyticsCollectionEnabled(false);
and collection is suspended until you re-enable it.
Permanently deactivate collection
If you need to deactivate Analytics collection permanently in a version of your app, set firebase_analytics_collection_deactivated to true in your app's AndroidManifest.xml in the application tag. For example:
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
I use crittercism for my app. Here is what i do to initialize Crittercism:
I only use the following permission:
<uses-permission android:name="android.permission.INTERNET"/>
and i initialize Crittercism like the following:
Crittercism.initialize(getApplicationContext(), "MY_APP_ID");
I do nothing else.
I can see some information about app installs etc, but i cannot see crash reports. I do the following when i click a button in my app and deliberately crash the app:
public void onClick(){
Integer i = null;
i++;
}
But i cannot see the crash report of this situation. Can anyone tell me why? Do i need to add mappings.txt file etc.?
Thanks
As the official Crittercism documentation says, you need more permissions.
Add the following permissions to your app’s AndroidManifest.xml file.
INTERNET
Required. Used to report data to Crittercism.
ACCESS_NETWORK_STATE
Optional. Allows providing network connectivity information such as carrier and network type.
READ_LOGS
Optional. Allows collecting logcat data to be attached to crashes and handled exceptions.
GET_TASKS
Optional. Allows augmenting crash reports with information on the activity running during a crash.
Documentation
You probably need "GET_TASKS" in order to have crash reports.
I found the problem.
It seems that in the developer console, the platform was set to IOS, i changed it to Android and i can see crash reports now.
When i integrated the RevMob into my application, it shows me the following error :
No ads for this device/country right now
Is there a way to solve that issue ?
Do you give permition in manifest<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
It means what it says. Revmob doesn't have any publisher for your country. Revmob has invested much in gaining developers rather than advertisers, thus they have lack of ads sometimes.
Just to check if you have done everything fine, try using VPN on your device for UK or US. They normally have ads for those countries.
To check the implementation you can use the test mode:
EnvironmentConfig.setTestingMode(true);
This is described on the sdk documentation http://sdk.revmob.com/android
It can be a temporary outage of campaigns for your device/country etc. It must be solved in the server/sales side automatically. But you can check your implementation using the testing mode, like Diogo said.
In the newest versions, you must use the following code:
RevMob revmob = RevMob.start(this, APPLICATION_ID);
revmob.setTestingMode(RevMobTestingMode.WITH_ADS);
I am trying to integrate Google Analytics on my Activities.
As per the google docs I read up on EasyTracker and added EasyTracker.jar to my libs and referenced the same, extended my Activities from "TrackedActivity" / "TrackedListActivity"
Also made an entry in the strings.xml file located under values
<string name="ga_api_key">UA-xxxxxxxx-x</string>
But whenever I log into Google Analytics I don't see any tracking displayed there.
Where have I gone wrong?
Add another string:
<bool name="ga_debug">true</bool>
And then check logcat to see any information from the Analytics library.
Google Analytic 1st time appear on website after about 24-48 hours. So if you are waiting for analytic after implementation then just wait for 48 hours.
did you give the following uses permission.
<uses-permission android:name="android.permission.INTERNET" />
GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();
tracker.start("your analytics code", this.con);
tracker.setCustomVar(1, "Medium", "Mobile App");
tracker.trackPageView("ur activity name");
tracker.dispatch();
tracker.stop();