Android uses Service+OKHttp to implement application background detection and update

Import OkHttp dependency implementation 'com.squareup.okhttp3:okhttp:3.14.4' implementation 'com.squareup.okio:okio:1.17.2' Jurisdiction <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> ...

Posted on Wed, 05 Feb 2020 10:46:03 -0500 by jonybhi

Using okhttp in Android to realize automatic program update

There are two steps to realize automatic program update: 1. Download apk program to local; 2. Install the downloaded apk programFor the implementation of automatic program update server-side operations, please refer to Spring Boot realizes file upload and download 1. Check update service public class ...

Posted on Sun, 26 Jan 2020 09:15:51 -0500 by gva482

The use of Matisse picture selector in Android

Preface: In most of our projects, we will use the function of image or video selection. Give an example: Upload the avatar when registering. Choose a background picture Photo selection when sending friends Next, I will introduce the use of a convenient open source library Matisse (below is a personal demo case)   Do ...

Posted on Sat, 04 Jan 2020 03:03:30 -0500 by okuto1973

android studio calls camera to take photos and demonstrates the specific steps

Demonstrate the function of the code, call the camera to take photos, and display the photos if successful. The first step is to define a button for calling the camera to take photos, and ImageView is used to store and display the photos taken. <Button android:id="@+id/take_photo" android:layout_width="wrap ...

Posted on Tue, 31 Dec 2019 19:40:28 -0500 by PC Nerd

Interaction between Android Q Private Directory and Public Directory Files (Read, Copy, Save, etc.) - Pittkai

Android Q is about to launch its official version. This article is based on beta 6, which is close to the final version of Q. It would be better if it would be helpful to the people who read this article.         Private directories of Android Q The private directory here is the App-specific director ...

Posted on Thu, 03 Oct 2019 17:22:37 -0400 by scarabee

Implementation of C#Cache

Cache implementation Instead of caching third-party implementations such as Redis, we do some environment variables based on C# to facilitate project use. 1. System Global Variables Many times, at the beginning of the system operation, the system operation parameters need to be saved for global use. The code is as follows: public class ...

Posted on Sun, 22 Sep 2019 12:43:27 -0400 by dipenmistry

Android comes with picture clipping (7.0, 8.0, and a millet phone)

A while ago I wrote how to get albums and photos after taking them and display and upload them. This time I made circular images. People who often read my notes will know that I am lazy.Then I'm lazy and self-defined, and the current needs are just as good as the original, the wheel of the Great God, which I'll recommend later.T ...

Posted on Fri, 10 May 2019 13:08:50 -0400 by ifubad

Android 7.0 Call System Camera Error Caused by: android.os.FileUriExposedException

Reason: Android N revokes access to files. According to Android N's requirements, to share files between applications, you should send a content://URI and grant temporary access to URI.   The simplest way to do this is to use the FileProvider class. Solution: 1. Define FileProvider in manifest <provider android:autho ...

Posted on Tue, 05 Feb 2019 15:15:16 -0500 by barrygar

Detailed Use of Android Thermal Repair (Tencent Bugly)

Uncheck this before using it Gradle of Engineering buildscript { repositories { jcenter() } dependencies { // The tinkersupport plug-in, where lastest.release refers to pulling up the latest version, can also specify a specific version number, such as 1.0.4 classpath "com.tencent.bugly:tink ...

Posted on Thu, 24 Jan 2019 22:12:14 -0500 by lisa99

Android 7.0-8.0 app update

When you want to go online, you have to update the interface when you make an app. First of all, you need to pack when doing validation, uninstall the AS installation, and then install the packaged apk. 7.0 and 8.0 require permissions <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> Add in ...

Posted on Thu, 24 Jan 2019 05:54:13 -0500 by ChessclubFriend