Glide4. + pit to load rounded image

1. When using glide to load a rounded image, you can write as follows after version 4.0: Glide.with(this) .setDefaultRequestOptions(new RequestOptions().optionalTransform(new RoundedCorners(ScreenUtils.dip2px(this, 20)))) .load(avatarUrl).into(ivAvatar4); The rounded corner of this picture is realize ...

Added by [ArcanE] on Sun, 03 May 2020 10:55:50 +0300

How to use Lifecycle components

2017/5/18 Google IO Android Architecture Components: a new collection of libraries that can easily manage the UI component life cycle and handle data persistence. Help you design robust, testable, and maintainable applications. In the following, the life cycle of components such as Fragment and Activity directly uses ...

Added by nodi on Sun, 03 May 2020 09:45:43 +0300

Android Road 36 - Android network operation

Guide reading 1. Basic knowledge of network operation 2. Basic knowledge of JSON 3. Request data and analysis from the server Basic knowledge of network operation Basic knowledge of JSON A bracket represents a collection, and a curly bracket represents an object Request data from server and parse JSON me ...

Added by rIkLuNd on Sun, 03 May 2020 03:18:50 +0300

Android: reading files under assets directory (1)

In Android development, resource files are generally divided into two types: 1. The resource file that can be compiled is placed in res directory, such as layout file. This resource file system will automatically generate the ID of the resource file in R.java, which can be accessed directly through R.X.ID. 2. Keep the original file format of ...

Added by aaadispatch on Sun, 03 May 2020 00:02:26 +0300

Android basic web communication

1, History of development 1G analog mobile phone, voice only2G digital mobile phone, adding functions such as receiving data3G smart phone has become a new generation of mobile communication system that integrates voice communication and multimedia communication, and includes value-added services such as image, music, web browsing, conference ...

Added by tonbah on Sat, 02 May 2020 19:11:32 +0300

android realizes the function of manual signature after consumption of UnionPay card machine

A few days ago, I went to the property management office to pay the property fee. The property management staff said that the community introduced high-tech products. After using the bank card for consumption, I didn't need to sign on the UnionPay machine with a pen. I directly touched with my finger to sign the consumption. At that time, I tho ...

Added by steviewdr on Sat, 02 May 2020 12:26:48 +0300

Notes for Android Beginners (2): the simplest code for mobile phone vibration

Beginners are most likely to be confused by the code when they first touch the code, so they should give the minimum generation of core code for beginners, first make clear the core code, and then expand the knowledge, so that the learning effect will be better. There are a lot of codes on the Internet, which make begi ...

Added by my800stuff on Sat, 02 May 2020 06:25:55 +0300

Animation custom animation track of android

Let's use the following example to show how to use this Animation custom Animation. In the figure, we can see that the small ball is rolling downward with the track, and the splicing between the track and the track is realized by the second-order Bezier curve. The small ball simulates the gravity effect and the acceleration rolling downward. ...

Added by cello on Fri, 01 May 2020 21:40:43 +0300

Soft and hard decoding implementation of android ffmpeg (ffmpeg 3.3.4)

1. Soft decoding implementation: JNIEXPORT int JNICALL Java_h264_Native_PlayLocalVideo(JNIEnv *env, jobject obj,jstring inputFilePath_,jobject surface) { const char *path = env->GetStringUTFChars(inputFilePath_, 0); av_log_set_callback(ffmpeg_android_log_callback); av_register_all(); int ret; AVFormatContext *fmt_ctx ...

Added by ericorx on Fri, 01 May 2020 21:12:02 +0300

Custom sprinkled beans

First on the renderings The effect of sprinkling beans, a whim, thought the animation was very interesting, so I took the time to write a play Drawing process: Define 6 "beans". Each bean has its own attributes, size, throwing speed, etc. then control the direction and state of each bean. The rebound effect uses the differencing devi ...

Added by klaibert26 on Fri, 01 May 2020 20:33:28 +0300