Solve the problem of using Okhttp+Retrofit to send network request and get json is unicode
When we use Okhttp and Retrofit to send network requests, the man in the json we get is unicode code, as shown in the figure below
At this time, we need to set the network editor when Okhttp is initialized, and change the return value code to UTF-8
OKhttp previously set
HttpLoggingInterceptor logging = new HttpLogg ...
Posted by davidb on Fri, 03 Jan 2020 01:59:46 +0100
Mobile location in Android Development (record)
This blog mainly records how to locate the mobile phone to a certain city. At present, the third-party map parsing API of Baidu map is used here.
Baidu map open platform address: http://lbsyun.baidu.com/index.php?title=androidsdk/guide/key
The steps are as follows:
1. Use the positioning function of Android to get the longit ...
Posted by argh2xxx on Thu, 02 Jan 2020 21:50:03 +0100
The front end realizes image compression and upload (compatible with ios10 system)
Questions: in the near future, we need to make a demand for the front-end to obtain images and compress them, then upload them to the back-end server or upload them to oss, and then transfer the path to the back-end server. During compression, it is found that the system at or below IOS 10 is invalid. After verification, this i ...
Posted by alevsky on Wed, 01 Jan 2020 17:22:31 +0100
android network 3 okhttp (1) get / Post basic usage
Okhttp is a very excellent network framework, with the characteristics of searching on the network, so we will not go over it again. This article will see how to use okhttp
The download address of okhttp source code is: https://github.com/square/okhttp
Sample download address of this article: https://github.com/cmyeyi/NetFram ...
Posted by magicdanw on Wed, 01 Jan 2020 08:35:45 +0100
Imitating bootstrap tagsinput autocomplete function
Demand analysis:
1. Independent function, that is, a page can have multiple input boxes with the same function
2. There are various functional requirements, and there are differences in the maximum number and data form
3. After completion of input, data interaction with the background (pass id)
4. Click delete or delete to ...
Posted by iacataca on Wed, 01 Jan 2020 06:33:49 +0100
vue server rendering add cache
cache
Although the server-side rendering (SSR) of Vue is quite fast, due to the overhead of creating component instances and virtual DOM nodes, it cannot match the performance of pure string based templates. When SSR performance is critical, using cache strategy wisely can greatly improve response time and reduce server load.
vue service area ...
Posted by Gabriel_Haukness on Tue, 31 Dec 2019 08:48:38 +0100
vue 2.0 shopping cart function implementation details (according to MOOC video)
Train of thought:
Obtain the background data through VueResource, and check whether the debugging of browser console is successful. Use the hook function mounted to ensure that when all DOM are mounted on the page, request again
Write the layout of the page, set the interface, and render the page through v-for
Data format of ...
Posted by tinkertron on Fri, 27 Dec 2019 19:38:23 +0100
To realize the process of random draw and shuffle in card games (examples of several built-in methods in item Series)
To realize the process of random draw and shuffle in card games (examples of several built-in methods in item Series)
1,namedtuple:Named tuples can create a class with no methods but only propertiesfrom collections import namedtuple
card = namedtuple('card',['rank','suit']) # rank face size, suit face Decor
# card is actually a class create ...
Posted by bmdsherman on Fri, 27 Dec 2019 18:30:40 +0100
In the message sent by rabbitmq template, the Date type field is 8 hours later than the current time
Preface
The problem encountered in the previous development process is that the time in the message body is 8 hours less than the current time when the rabbitmq template is used to send messages. This is the time zone problem.
Let's talk about why it appears.
The previous configuration is as follows:
@Bean
public RabbitTemplate rabbitTempl ...
Posted by lanjoky on Fri, 27 Dec 2019 12:43:39 +0100
Elasticsearch series - Custom mapping
outline
This article continues with the previous one, focusing on customizing mapping, custom objects, and the underlying structure of array collection classes.
Custom mapping
The previous article described the automatic mapping of Elasticsearch. When creating an index, you can specify the mapping information first, or take the music index as a ...
Posted by phpgeek17 on Fri, 27 Dec 2019 01:17:26 +0100