Tingyun App Android SDK supports Android 2.3 above system, also supports Ant, Eclipse, Maven and Gradle(Android Studio)four compilation modes. iOS SDK supports iOS 6.0 above system, also supports CocoaPods.
Uncertain. Key string is mainly used to distinguish data and App’s different versions use the same key. The data and reports from the versions will be mixed together. We generally recommend creating different App key on Android and iOS platforms to have a more accurate analysis.
Tingyun SDK package, compressed package size is 300K or so, after decompression to join the development environment is about 1M. It will increase about 100k on App after compilation.
All protocols based on HTTP and HTTPS.
Once you sign in to Tingyun App, you can download the latest version of SDK package at any time and upgrade installation according to the latest installation documentation. Not upgrading the SDK, it will not affect the original data collection and reports but can not use the system new features.
As long as to delete the target App at the Home “App List”, it will not longer collet data. You can also follow the instruction”Uninstall Documentation” to remove Tingyun App codes in the App specified file then achieve a complete uninstall.
Application session lifetime: Start with application launch or switch to the foreground, end by exit application or switch to the background. The time running on the foreground is named “Session Lifetime”, meanwhile it counts the network traffic generated by the session.
HTTP request-target URL/IP
HTTP status codes
First package time(iOS only): From the start of a request to the receipt of the first response byte, including DNS and build time.
Response time: From the start of a request to the receipt of all response content is complete.
Content-Length: Exclude the header contents of the response and its number of bytes
Response header: Only logged when the response to the request errors, including the header contents of the response and its number of bytes
System error codes for network failure(failed HTTP request)
Device name, manufacturer name, operating system name and version
The unique identification code for the device
iOS and Android operating mechanisms determine that the application layer is not able to directly access the network device, so it can not obtain network layer performance indicators from inside application.
View by: Tingyun SDK deployment documentation offers two ways to view, sigh in on Tingyun system:
https://report.tingyun.com/mobile/overview
(1) Click “Overview” -> Click”New APP“ -> ”Enter APP Name“ -> Click ”Save" to view the deployment documentation
(2) Click “Overview” -> “App List” -> “Action” -> Click “Modify Settings"
Under ‘App Name’, click ‘View Installation Steps’ to view the deployment documentation
(3) Click “Help” tab in the upper right corner of Tingyun system home page
or Or go to the bottom of the page “Help Center”-> “Install”, you can view the deployment of the document, select “Terminology” to see the performance metrics
(1) Open the “AndroidManifest.xml” file in the root directory of the App project
(2) There may be multiple activities in the Manifest.xml file, the activity with the only and one android:name=”android.intent.action.MAIN” in <intent-‐filter> tags is the Main Activity.
For network requests occur before the Main Activity initialized, codes need to be embedded in the onCreate method of the Application.
Command to view the log mode to verify whether the installation is successful.
a)Command:adb logcat –v time –s NBSAgent:V
b)Log of successful installation is shown below
NBSAgent start
:
NBSAgent enabled NBSAgent V1.1.3 connect success
:
(1)Tingyun reports to verify whether the installation is successful:
a)Run the embedded App::
b)Make a regular operation (network request required):
c)Login Tingyun system after 10 minutes:
http://lens.networkbench.com/overview
d)Select the monitored App name in APP list to see if there is any data or not
e)The data means installation is successful.
Several possibilities:
(1)Tingyun SDK installation failed
(2) The monitored APP dose not have network access(HTTP request and HTTPs request)
(3) Network latency, or other network failure
The current Tingyun SDK supports both Ant and Eclipse, please select the compilation method you need.For deployment details, see the deployment documentation.
Note: Installing apk only applies to one compiled mode, it is not supposed to use both compilation methods for packaging.
E.g: Using ant to achieve compilation then use eclipse to run installation program
Result: Run the apk generated by Eclipse, you can see "connect success!” but there is no data in report. Installation failed.
Error report:
Buildfile: build.xml does not exist!
Build failed
Check your steps:
(1) Verify that “build.xml” file in the root directory of the APP program exists
(2) If “build.xml” exists, please rename it and then generate a new file
(3) If “build.xml” doesn’t exist, use a command to generate “build.xml” file
Error report:
NBSAgent: NBSAgent start
NBSAgent: com.networkbench.agent.impl.NBSAppAgent not enabled
Check your steps:
Verify the “nbs.newlens.agent.jar” package has been successfully imported into the “libs” directory. If there is no “libs” directory, you can build one. If it has been successfully imported, “clean” and try again
Error report:
-post-build: release:
BUILD SUCCESSFUL
Total time: 9 seconds
Error report:
NBSAgent: NBSAgent start
NBSAgent: com.networkbench.agent.impl.NBSAppAgent not enabled
Check your steps:
Whether the ANT_OPTS environment variable is in effect
(1) Mac OS, Linux environment:
Export ANT_OPTS=“-javaagent:/path/to/nbs-android-agent-latest/li b/class.rewrite.jar”
(2) Windows environment:
SET ANT_OPTS=“-javaagent:\path\to\nbs-android-agent-latest\li b\class.rewrite.jar”
Note:
Please do not set the environment variable (ANT_OPTS) permanently to a user or system environment variables, or it will affect other Android projects that do not need embedded.It is recommended that you set the environment variable temporarily on a command-line basis for single compilation.
Error report:
-compile:
[javac]Compiling 107 source files to
D:*Project\android-lib\bin\classes
[javac]
D:*Project\android-lib\src\com*\lottery\lib\utils\Util.
java:1: Illegal characters :\65279
[javac] ?package com.jd.lottery.lib.utils;
[javac] ^
[javac] 1 Error
Solution: Chang encoding format.
Check your steps:
(1)Enter “/sdk/tools/ant”
(2) Open “build.xml” file,find<javac>
label
(3) Modify the encoding attribute to change the encoding format,E.g:encoding=“UTF-‐8”
After modification, save and recompile App
Solution:
(1) Multiple inherited App application has to execute Android command in the embedded application root directory to generate build.xml file, then use ant command compiler.
(2) The project embedded SDK codes must be application, can not be lib project.
Error report:
Solution:
According to the error message, check whether there is build.xml file in the current directory
If multiple lib projects exist, build.xml needs to be generated under each lib project
(1) Write a nbs-‐build.cmd batch file
(2) Put the set ANT_OPTS and the ant command in the file
(3) Ensure that the path to ANT_OPTS is the same as the path on the publishing machine
(4) Submit build.xml also need to put in the same directory
Login Tingyun system:
http://lens.networkbench.com/overview
APP Name List -> select the configuration APP -> “Settings” -> “APP settings”
(1)Configure URL filtering
a)Whitelist policy can set whitelist filtering
E.g. The current configuration is /www.baidu.com/, the request access URL is www.baidu.com and www.qq.com. Because of whitelist, only the URLs that match the configuration information are collected, so information collected from www.baidu.com
b)Blacklist policy can set blacklist filtering
E.g. The current configuration is /www.baidu.com/, the request access URL is www.baidu.com and www.qq.com. Because of blacklist, the URLs that match the configuration information won’t be collected, so information collected from www.qq.com
(2)Configure HTTP errors filter Open HTTP Error filter
a) URL filtering conditions
Configuration conditions:/baidu/ (URL filtering needs to be configured along with error response codes)
b)Configure error response codes
Configuration conditions: 401,402,403,901 only filter the URL contains /baidu/ If the reported error contains the URL for filtering information error:401 and 902, only collect 902 error, not 401 error
c)Create rules after the setting complete
d)Delete HTTP error filtering options
Tingyun system is able to set to collect the location information to reflect the app application use of geographical users and display it on the report in the form of China map. Location switch:
withLocationServiceEnabled(true/false)
Collect location information:
NewLens.withApplicationToken(“AppID”).withLocationService
Enabled(true).start(this.getApplication());
Collect location information
As App crash and application performance issue is closely related, we strongly recommend that when you use Tingyun SDK, you would better collect App crash logs(it is set up by default to choose the option of collecting crash logs) to have a more comprehensive performance monitoring data analytics in Tingyun unified platform provided for App R&D and operation personnel.
If you want a third-party SDK to collect your App crash logs, you can disable the function to collect crash logs in Tingyun SDK.
(1) Tingyun iOS SDK How to turn off the collection of crash logs?
If you need to disable the collection of crash logs in Tingyun iOS SDK, please invoke [NBSAppAgent setCrashCollectFlg:NO] method before initializing Tingyun SDK
[NBSAppAgent setCrashCollectFlg:NO];
[NBSAppAgent startWithAppID:@“YOUR_APP_ID”];
(2)Tingyun Android SDK How to turn off the collection of crash logs?
If you need to disable the collection of crash logs in Tingyun Android SDK, please invoke withCrashReportEnabled(false) method before initializing Tingyun SDK
Crash switch :
withCrashReportEnabled(true/false)
withCrashReportEnabled(true/false)
Turn Crash off (default on):
NewLens.withApplicationToken("AppID”).withCrashReportEnab led(false).start(this.getApplication());
NewLens.withApplicationToken("AppID”).withCrashReportEnab led(false).start(this.getApplication());
When you use NetworkBench Tingyun to collect the performance data of all your App users(called all sample data collection), our system is able to accurately calculate the actual number of active users of your App (or the number of active devices).
NetworkBench is always concerned about the safety of users’ data, we are legally and technically guarantee that all user data, including active users (active devices), performance data, etc., will not be disclosed to any third-party.
If you want NetworkBench Tingyun system not to collect the actual number of active users (or the number of active devices)of your App, you can use the sampling method to start Tingyun App agent(called sampling data collection). When your App users amount large enough, sampling data collection dose not affect the accuracy of performance data, it just makes Tingyun system not able to provide the statistical data of actual number of active devices.
(1) Tingyun iOS SDK How to carry out sampling monitoring
If you need to perform sampling monitoring in Tingyun iOS agent, please use NBSAppAgent startWithAppID: rateOfLaunch: method to initialize the agent.E.g
[NBSAppAgent startWithAppID:@“YOUR_APP_ID” rateOfLaunch:0.5];
This will only have a 50% chance to start Tingyun agent, which means sampling 50% of the users(devices), and the value of parameter rateOfLaunch will not be transferred to NetworkBench Tingyun system. The value of the parameter rateOfLaunch is (0, 1).
[NBSAppAgent startWithAppID:@“YOUR_APP_ID” rateOfLaunch:0.5];
(2) Tingyun Android SDK How to carry out sampling monitoring
If you need to perform sampling monitoring in Tingyun Android agent, please invoke withSampleRatio() method before initializing Tingyun SDK
withSampleRatio(int ratio)
Agent Start frequency switch
Set the agent start frequency (default is 100):
NewLens.withApplicationToken("AppID”).withSampleRatio(50).start(this.getApplication());
This will only have a 50% chance to start Tingyun agent, which means sampling 50% of the users(devices), and the parameter of withSampleRatio() will not be transferred to NetworkBench Tingyun system. The value of the parameter is (0, 100).
Error report:
(1)Solution:
a)Right-click “Eclipse.exe” file and select Properties
b)Click “Shortcut” → “Target”
c) Add “-consoleLog” after “target”
d)OK to start “Eclipse.exe” pop-up Log window
View the log
(2)Check steps:
a) Check whether the JAVA_HOME environment variable is set correctly,Plug-ins need to find
JAVA_HOME\lib\tools.jar
JAVA_HOME \ lib \ tools.jar
b)Check eclipse installation details:help –> About Eclipse –> Installation Details Check whether the version of Eclipse is the latest version
c) Go to the directory eclipse\configuration\org.eclipse.osgi\bundles Find the folder with the largest directory name, click to see whether there is the following directory
d)View the contents of the file ECLIPSE_HOME \ eclipse \ eclipse.ini, and check the JDK path for spaces
Add the parameter -vm to the previous line of -vmargs
Such as:-vm D:\Java\jdk1.6.0_13\bin\javaw
Support the following protocol library: URLConnection, Android HttpClient, Apache HttpClient, Volley, OkHttp1.0 and OkHttp2.0.
Application interaction performance data: interaction performance data is divided into seven categories
Internet interaction performance data: support the following protocol library URLConnection, Android HttpClient, Apache HttpClient, Volley, OkHttp1.0 and OkHttp2.0. Offer to collect DNS time, TCP time, SSL time, first packet time, response time, throughput, network errors, HTTP errors and other information.
Yes.
Short connection.
We provide the function of closing HTTP network module acquisition, user interaction module acquisition, crash module acquisition and Web View module acquisition.
How to close: App Console - Overview - App Settings - Modify Settings - Enable/Disable the modules.