- UrQA android client sdk which is changed project for Eclipse into Android Studio
- add profiling fuction(there are two profiling options, shallow and deep)
This is the client sdk for android application which is being tested automatically. While the android application is being tested, the sdk
- is gathering profiling data, and sends the profiling data to server after the test is finished.
- reports the crash to the server when the runtime exceptions or errors are occurred.
So, the developer can
- analyze potential problem for the resource usage of the application and optimize the resource usage of the application with profiling data
- analyze the crash and solve the problems
- test the multi devices at once and compare the test result of devices
- set the library version inside the below files
- update the variable of "SDKVersion" in "UrQA-Profiler-Client-Android/app/src/main/java/com/urqa/common/StateData.java"
2. click Gradle on the right side of the IDE window, then The Gradle tasks panel appears
3. double-click the "UrQA-Profile-Client-Android/app/Tasks/other/exportJar" task
4. the build generates an jar library file named "file name.jar" in the "UrQA-Profiler-Client-Android/app/release” directory
5. release the jar file
- define the APP_STL as "gnustl_static" in the "UrQA-Profiler-Client-Android/app/src/main/jni/Application.mk"
- click Gradle on the right side of the IDE window, then The Gradle tasks panel appears
- double-click the "UrQA-Profile-Client-Android/app/Tasks/other/ndkBuild" task
- the build generates two static library files below in the directory of "UrQA-Profile-Client-Android/app/src/main/obj/local"
- armeabi/liburqanative.a
- armeabi-v7a/liburqanative.a
- rename two static library files as below
- armeabi/liburqanative_gnustl.a
- armeabi-v7a/liburqanative_gnustl.a
- define the APP_STL as "stlport_static" in the "UrQA-Profiler-Client-Android/app/src/main/jni/Application.mk"
10. copy the directory of “UrQA-Profiler-Client-Android/app/src/main/jni/header” 11. delete *.cc files in the directory and and all levels of subdirectories 12. create a zip archive of the below directory - armeabi - armeabi-v7a - header
13. release the zip file
- download the lastest version of the UrQA client library
-
import the UrQA client library
- copy the library file in the libs folder. Make sure you are in the Project view mode (Top left corver of the Project window)
- Right click on the UrQA client library file and select the last option "Add as library" on the pop up window
-
Add the “Internet” permission to your manifest file to upload the profile data file to the server
- < uses-permission android:name="android.permission.INTERNET" />
-
write the code
-
import com.urqa.profile.BaseProfile;
-
create an instance for profile function
in case of Shallow Profile- BaseProfile.getInstance(getApplicationContext(), BaseProfile.PROFILE_TYPE_SHALLOW);
- gather the profiling data for memory, cpu, and power periodically ( the period of the profile is 1000 miliseconds or
- BaseProfile.getInstance(getApplicationContext(), BaseProfile.PROFILE_TYPE_SHALLOW , x);
- gather the profiling data for memory, cpu, and power per x miliseconds
in case of Deep profile
- BaseProfile.getInstance(getApplicationContext(), BaseProfile.PROFILE_TYPE_DEEP);
- gather the profiling data for memory, cpu, and power only when the method which is annotated is called.
- BaseProfile.getInstance(getApplicationContext(), BaseProfile.PROFILE_TYPE_SHALLOW);
-
in case of Deep Profile
mark with @AfterProfile, @BeforeProfile, @Profile annotation on the method which means you want to profile
warning) don’t mark with annotation on the method when it is Shallow Profile -
call the startReadProfileData() function of the BaseProfile instance
then it will start the profiling -
call the stopReadProfileData() function of the BaseProfile instance
then it will finish the profiling
-











