Jetpack: Room database upgrade detailed actual combat!

Catalogue of series articles Related articles: Jetpack: Room super detailed use pit guide! Jetpack:Room+kotlin collaboration? Transaction problem analysis, detailed explanation of withTransaction API Jetpack:Room use error FAQ Jetpack:Room is optimized with LiveData/Flow, and Room+Flow uses principle analysis. Introduction to Room upg ...

Posted by falcon8253 on Sun, 19 Sep 2021 23:47:53 -0700

Essential skills for Android Architects - operating CAS for concurrent programming

Principle of CAS The full name of CAS is compare and swap. It is a mechanism for realizing synchronization function in multi-threaded environment. It is also lock free optimization, or spin, and adaptive spin. In jdk, CAS adds volatile keyword as the cornerstone of implementation and contracting. There will be no contract without CAS. java.ut ...

Posted by crazy/man on Sun, 19 Sep 2021 18:57:45 -0700

Use of Token in android

About the use of Token to realize user login in Android principle Token is generally used to realize user login in Android. At present, the most popular method is to use jwt. Let's talk about the implementation principle first: Step 1: when the user logs in for the first time, the client sends the user and password to the server, and the serv ...

Posted by delayedinsanity on Sun, 19 Sep 2021 01:05:57 -0700

Today's headline adaptation of screen adaptation (clear and simple logic)

Screen adaptation base icon drawable selector, shape label, frame animation list, density value, resolution density ratio Drawable LDPI low resolution directory 120 240320 0.75 formula density value divided by 160 Drawable MDPI medium resolution directory 160 320480 1 Drawable hdpi high resolution directory 240 480800 1.5 Drawable xhdpi ult ...

Posted by DigitalNinja on Sat, 18 Sep 2021 17:24:47 -0700

Flutter makes the Mid Autumn Festival guide page

Original address: https://juejin.cn/post/7007756651197366303 After reading it for a long time, everyone is true 🐂🍺, The moon has come out around the earth, so I'll also give you flowers ~ and then send you Mid Autumn Festival blessings: the moon is round and bright, the moon cakes are round and sweet, family reunion, everyone is happy and s ...

Posted by michaelnorth on Sat, 18 Sep 2021 06:42:26 -0700

Android memory leak nail reporting

"A small leak will sink a great ship." - Benjamin Franklin "The dike of thousands of miles collapses in the ant's nest." - Han Feizi · Yu Lao If the APP is like a big ship sailing in the sea, the memory leak is like a small leak under the big ship. When more and more loopholes are not repaired, the ship may sink. APP may als ...

Posted by hermand on Sat, 18 Sep 2021 04:16:51 -0700

Detailed explanation of Watchdog detection principle

Why do you need a watchdog? Watchdog, I first saw this word in the single chip microcomputer book of the University and talked about the watchdog timer. When the single chip microcomputer was just developed a long time ago, the single chip microcomputer was easy to be affected by external work, resulting in its own program running and flying. T ...

Posted by dmeade on Fri, 17 Sep 2021 23:28:49 -0700

ArrayMap and SparseArray -- better Map under Android

Comparison of three containers projectArrayMapSparseArrayHashMapconceptMemory optimized HashMapPerformance optimized ArrayMap with key intAccess O(1) Map with a large amount of memorydata structureTwo arrays: A Hash with Key Another Key and Value are storedTwo arrays: A stored Key Another save ValueArray + linked list / red black treeApplicati ...

Posted by afrim12 on Fri, 17 Sep 2021 22:14:18 -0700

Java: an implementation principle summary and use example of reading annotations

Write before: In the past, "XML" was the favorite of all major frameworks. It completed almost all the configurations in the framework in a loose coupling way. However, as the project became larger and larger, the content of "XML" became more and more complex and the maintenance cost became higher. Therefore, someone propo ...

Posted by chapm4 on Fri, 17 Sep 2021 20:15:34 -0700

Binder C++/JAVA implementation

Understand the principle of Binder mechanism: It is an inter process communication mode, CS architecture, user space and kernel space   C++: The message is handled by a subclass of BnInterface Send message:  status_t  transact(uint32_t code,const Parcel& data,Parcel* reply,uint32_t flags = 0); Process message: status_t onTransac ...

Posted by simonoc on Fri, 17 Sep 2021 06:57:46 -0700