Design mode Observer mode Observer

Observer mode, also known as publish / subscribe mode, defines 1-to-many one-way dependency between objects, so that when the target object changes, the observer object can receive messages and process them immediately. One, four elements 1. Target object interface 2. Target object 3. Observer interface 4. Observer object II. Core ...

Posted by jswinkelman on Thu, 05 Dec 2019 06:52:55 -0800

Mobile Gesture Event (Multi-finger Operation)

In mobile development, existing gesture events are only supported by browsers on IOS, so browser gesture events on other devices must be upgraded on touchstart, toucmove, touchend events on the mobile side. Below is a description of the gesture events on the mobile side upgraded. Mobile Touch Events (Basic Events) Touch start - Touch start Tou ...

Posted by Frozenlight777 on Thu, 05 Dec 2019 02:34:43 -0800

The principle and implementation of Android multithread breakpoint Download

During this time, I looked at the download components of the studio's tool library and found some problems: 1. There is a bug in the download core logic, and there is a probability that the download cannot be completed successfully when the download is suspended or fails.2. Although the original design adopts the design of multi-threaded brea ...

Posted by ogge1 on Wed, 04 Dec 2019 21:53:57 -0800

The realization of a chat interface

The layout adopts the FrameLayout layout, which can ensure that the input box is pushed upward without being overwritten when the soft keyboard pops up. The layout file is as follows: < FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"   xmlns:tools="http://schemas.android.com/tools"   android:layout_width= ...

Posted by anurag2003 on Wed, 04 Dec 2019 11:15:13 -0800

android: map of gaud

Divided into map, location and search (I haven't done navigation yet) gradle integration is recommended Add dependency Add jcenter's warehouse address under the project/build.gradle file allprojects { repositories { jcenter() // Or Maven central () } } Add dependency under app/build.gradle android { defaultConfig { ...

Posted by Operandi on Wed, 04 Dec 2019 09:03:05 -0800

[DesignPattern]Builder Design Pattern

Definition of pattern Separate the construction of a complex object from its representation, so that the same construction process can create different representations. Usage scenarios of patterns The same method, different execution order, and different event results; Multiple components or parts can be assembled into one object, but the resu ...

Posted by suttercain on Tue, 03 Dec 2019 19:10:13 -0800

Bluetooth headset judgment problem

When debugging the program, I always wonder why the Bluetooth headset does not follow the judgment process of the Bluetooth headset, but only the headset process. After repeated attempts at the interruption point, it was found that Android thought that the Bluetooth headset was a headset, so it was necessary to judge the Bluetoo ...

Posted by edking1 on Tue, 03 Dec 2019 18:49:24 -0800

Reread the Handler source with your hands and chat about those you don't know.

As you should all know, Android's messaging mechanism is based on Handler.Remember that I read several blogs a year ago and thought I knew Handler, Looper and MessageQueue.However, in fact, slowly during the process of looking at the source code, you will find that the contents of Handler are more than this, such as synchronization barrier, b ...

Posted by miancu on Tue, 03 Dec 2019 16:11:42 -0800

Start the Activity process

Preface This is Android 9.0 AOSP series Let's review the general contents of the previous articles. Pangu and Nuwa in Java World -- Zygote This paper mainly introduces the starting process of Zygote, the first Java process in Android world. Register server socket to respond to client requests Various preloading operations, classes, resources ...

Posted by Nymphetamine on Tue, 03 Dec 2019 15:47:28 -0800

Remember account number and password of login page

First, configure the login xml file, and set two EditText, a Button and a CheckBox; The configuration code is as follows: <?xml version="1.0" encoding="utf-8"?> <EditText android:id="@+id/et_userName" android:layout_width="300dp" android:layout_height="wrap_content" /> </Li ...

Posted by anoopmail on Tue, 03 Dec 2019 08:13:44 -0800