[Android third-party library] OneDrive module development summary (2) — performance and other problem solutions VIC

2022-12-26   ES  

Following the previous partOneDrive module development summary (1) — Get the email at the time of login

After http://blog.csdn.net/vic_fang/article/details/23282311, do another phase of summary

1. About synchronization methods and asynchronous methods

The Demon project of

OneDrive provides two methods of APIs to obtain file details as an example: get (string id), getasync (string id, liveoperativeListener Listener).Get (String ID) method is pure asynchronous,Getasync (String ID, LiveOperationListener Listener) requires users to realize the callback interface in Listener. The callback function is in the UI thread, so you can do things where UI control is directly controlled here.

2. About inputStream for obtaining files

If you need to get in your needs

InputStream of thefile, you need to use DOWNLOAD (String Upload_Location) interface. OneDrive provides two URLs in the data structure, a link of one UPLOAD_LOCATION, although you can directly use these two URLs to build HTTPURLCONNECTION, but OneDRIVE has internal internal. In this way, the INPUTSTREAM cannot be obtained.DOWNLOAD (String Upload_Location) interface Return to LiveDownloadOperation object, which provides the getStream method for the getStream method

3. About OneDrive requires frequent access to the network, how to improve performance (efficiency)


project provides a cache mechanism to build a small database. When accessing OneDrive access the network, some files and folders are stored. When you need to obtain relevant data next time, you can find the database. Take the data and save it in the database. When there is a need to visit the OneDrive network frequently in the demand, it can effectively improve the efficiency


Random Posts

Macos Big Sur (Software Article): Redis installation

[Composition Composition Principle (second edition)] (Tang Shuofei) Chapter 3 of the Question Answers-bus

jmeter4.0 Performance Test Tool Install PSEUDO

javajdbc Basic Notes 13 Database Connection (DAO)

Ansible tools to implement LAMP cluster environment automation construction