Android application: realize network loading of product data [OKHttp, Glide, Gson]

Implement the function of loading product data over the network: 1. Declare network permissions in AndroidManifest.xml; 2. Add necessary third-party libraries such as okhttp, glide, gson, etc. to app/build.gradle; 3. Connect to the given Web service through OkHttpClient in MainActivity to obtain product data; the corresponding json data is a local json file named goods_list_data.json; […]

Gson FastJson Jackson comes out Date LocalDate LocalDateTime date type JSON format string

Gson FastJson Jackson processes Date LocalDate LocalDateTime date type JSON format string Gson processes Date LocalDate LocalDateTime date type JSON format string When using the Gson library to serialize and deserialize objects whose properties are Date, LocalDate and LocalDateTime, You can use annotations to specify how dates are formatted. The Gson library supports the @SerializedName […]

Android Retrofit custom GsonConverterFactory

During project development, the format returned by the background does not have a unified return format (the return formats of success and failure are inconsistent). Case description: Login business json (when successful) { “code”: 0, “message”: “Login successful”, “data”: { “name”: “admin”, “token”: “ad987810544564310” } } Login business json (when failed) { “code”: 0, “message”: […]

GsonUtils and strings

Article directory 1. GsonUtils 2. String itself can add log information 3. Json and Map conversion 4. Convert Date to Json string 5. Json and List conversion 6. Compare the differences between two JSON strings 7. String filling: Filling in when generating document number 8. Use of String.format() 9. Truncate string 10.split The difference between […]

57. springboot XML-based RESTful service—XML format RESTful response and replacement of the default JSON library (support for three JSON libraries: Json, Gson, JSON-B, all Json parsers)

XML format RESTful response and replacing the default JSON library Spring Boot has built-in support for the following three JSON libraries: – Jackson (default, included in the spring-boot-starter-web package, and dependent on jackson) – Gson (Google) -JSON-B They are all Json parsers, and their functions are to convert data into json format. They are all […]

Win11 uses QEMU to configure Loongson 3A5000 virtual environment

01 Download resources Resources used in this experiment: Open source simulator qemu download address, qemu-w64-setup-20230822.exe loongarch firmware download: QEMU_EFI_8.0.fd Loongarch basic image download: archlinux-loong64.iso qemu is installed in D:\install\qemu: D:\install\qemu>dir | findstr “qemu-system-loongarch” 2023-08-23 02:05 10,648,816 qemu-system-loongarch64.exe 2023-08-23 02:00 10,648,816 qemu-system-loongarch64w.exe More download resources: Firmware download address Peking University download mirror QEMU_EFI_7.1.fd QEMU_EFI_7.2.fd QEMU_EFI_8.0.fd Documentation: […]

Loongson opens dma post code

code diff –git a/pmon/arch/mips/ls7a/ht.h b/pmon/arch/mips/ls7a/ht.h index 7bddf501..099d630a 100644 — a/pmon/arch/mips/ls7a/ht.h + + + b/pmon/arch/mips/ls7a/ht.h @@ -64,6 + 64,8 @@ #define LS3A_HT_RX_UNCACHE_WIN0_OFFSET 0xF0 #define LS3A_HT_RX_UNCACHE_WIN1_OFFSET 0xF8 #define LS3A_HT_RX_UNCACHE_WIN2_OFFSET 0x168 + #define LS3A_HT_TX_POST_WIN0_OFFSET 0x170 + #define LS3A_HT_TX_POST_WIN1_OFFSET 0x178 #define LS7A_HT_RX_WIN0_OFFSET 0x140 #define LS7A_HT_RX_WIN1_OFFSET 0x148 diff –git a/pmon/arch/mips/ls7a/ls3a7a_ht_init.S b/pmon/arch/mips/ls7a/ls3a7a_ht_init.S index a24ac816..a0dfb31f 100644 — a/pmon/arch/mips/ls7a/ls3a7a_ht_init.S + + + b/pmon/arch/mips/ls7a/ls3a7a_ht_init.S […]

Dr. Li Yingsong’s Binocular Stereo Matching-Code Practice-2 Cost Calculation_Source Code Display

Dr. Li Yingsong’s Binocular Stereo Matching-Code Practice-2 Cost Calculation_Source Code Display Beginner’s thoughts Code entry 1.SemiGlobalMatching.h file 2. Next is the SemiGlobalMatching.cpp file, which mainly implements the methods in the SemiGlobalMatching.h file 3. There are relatively few sgm_util.h functions here. I won’t explain too much. You can copy and paste them directly: 4. Next is […]

Springboot integrates Json (Jackson, Gson, FastJson)

Article directory There are three ways to integrate json with springboot. Springboot uses jackson by default. If you want to use the other two, you need to exclude jackson 1.springboot integrates jackson 1.1 pom.xml 1.2 Entity classes, the use of jackson annotations 1.3 controller 1.4 jackson global configuration 2. springboot integrates gson 2.1 pom.xml 2.2 […]

Android uses network technology, usage of WebView, usage of OkHttp, parsing XML format data (Pull, SAX), parsing JSON format data (JSONObject, GSON)

1. Usage of WebView <WebView android:id=”@ + id/Web_view” android:layout_width=”wrap_content” android:layout_height=”wrap_content” tools:layout_editor_absoluteX=”165dp” tools:layout_editor_absoluteY=”58dp” /> public class MainActivity extends AppCompatActivity {<!– –> @Override protected void onCreate(Bundle savedInstanceState) {<!– –> super.onCreate(savedInstanceState); setContentView(R. layout. activity_main); WebView webView = findViewById(R.id.Web_view); Button button = findViewById(R.id.button); //Let WebView support js script webView.getSettings().setJavaScriptEnabled(true); //When it is necessary to jump from one webpage to […]