Android installs additional apk s in the assets directory
In practical development, you may encounter other apk s packaged in your own application and installed together. Here are the steps:
First copy the test.apk to the main/assets directory and apply for read and write access to the memory card in the manifest file:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" ...
Posted on Wed, 06 May 2020 12:14:36 -0400 by solon
Android 7.0 take photos and upload
On Android 7.0 mobile phone, call the system camera with the old method to take photos and keep throwing. FileUriExposedException is abnormal. This is because Android 7.0 forces a policy called StrictMode to be enabled, and App cannot expose URI of file: / /. If you use Intent to open an external App with such a URI (for exampl ...
Posted on Thu, 26 Mar 2020 11:35:22 -0400 by Lexas
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