Tag:android

  • Summary of Android version and permission adaptation

    Time:2021-8-2

    catalogue Request storage permissions Version adaptation Before Android 7.0 After Android 7.0 Android 10.0 What is scope Take a chestnut Request storage permissions First, you need to declare permissions in the androidmanifest.xml file: <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /> Request user permissions in Code: //Permission request code private static final int PERMISSION_REQ_ID = 0; //Request permission private static […]

  • Android uses table layout to design the registration interface

    Time:2021-7-31

    Android uses table layout to design the registration interface for your reference. The specific contents are as follows The registration page includes: user name, password, confirmation password and verification code. The verification code is generated using an encapsulated tool class and can be used directly. The renderings are shown below. No event handling, just a […]

  • Transparent animation for Android

    Time:2021-7-28

    This example shares the specific code of Android transparent animation for your reference. The specific contents are as follows There is an activity on the home page public class AlphaAnimationActivity extends AppCompatActivity { private ImageView mImageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_frame_animation); //It’s just an ordinary picture mImageView = findViewById(R.id.imageview); … here are […]

  • How to write a character driver:)

    Time:2021-7-27

    This is the first time that a blogger has written an open-ended technical article. The purpose of writing this article is not only to summarize the knowledge learned, but also to help novices. Because in the process of learning, it is also oriented to a certain degree of programming, resulting in a lot of pits, […]

  • How to use ImageView in Android

    Time:2021-7-24

    Use of ImageView in Android: click the button to change the picture transparency and switch pictures The layout is three button components and one ImageView component <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”horizontal” android:gravity=”center”> <Button android:id=”@+id/addAlpha” android:layout_height=”wrap_content” android:layout_width=”wrap_content” Android: text = “increase picture transparency” /> <Button android:id=”@+id/downAlpha” android:layout_width=”wrap_content” android:layout_height=”wrap_content” Android: […]

  • Android text view textview to achieve chat room effect

    Time:2021-7-23

    This example shares the specific code of Android text view textview to realize chat room for your reference. The specific contents are as follows Math. Random() generates random numbers in the range of 0 to 1 Date time format NEW   SimpleDateFormat(“dd-MM-yyyy HH:mm:ss”); // Year month day hour: minute: Second  ; HH in words 24 […]

  • Parameters and special types and features in asp.net

    Time:2021-7-23

    1、 Optional and named parameters 1. Optional parameters            Grammar: [modifier] return type method name (required parameter 1… Required parameter n, optional parameter 1… Optional parameter n)            eg: static void BookList(string category,int pageIndex = 1) { //Operation } //Call static void Main(string[] args) { BookList(“C#”); // Use all default parameters Booklist (“C #”, 2) […]

  • Android image view ImageView to achieve image stretching effect

    Time:2021-7-22

    This example for you to share the Android image view ImageView image stretching effect of the specific code, for your reference, the specific content is as follows In the layout adjustment attribute SRC, specify the drawing source. Setscaletype in activity sets the drawing stretch type. MainActivity package com.example.junior; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import […]

  • Android text view textview to achieve the running lantern effect

    Time:2021-7-21

    This example for you to share the Android text view textview effect of the specific code, for your reference, the specific content is as follows MainActivity package com.example.junior; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import android.view.View; import android.widget.TextView; public class MarqueeActivity extends AppCompatActivity implements View.OnClickListener { private TextView tv_ marquee; // Declare a text view object private […]

  • Android combined with XML to realize frame animation

    Time:2021-7-17

    catalogue 1 create XML animation file 2 loading and using 3. Talk about animation drawable 3.1 using viewtreeobserver 3.2 using runanim 3.3 call in onWindowFocusChanged of Activity 1 create XML animation file Create an animation file in the drawable directory of the Android project, such as the loading.xml I created here <?xml version=”1.0″ encoding=”utf-8″?> <animation-list […]

  • Introduction to Android okhttp

    Time:2021-7-16

    catalogue to configure Create okhttpclient Synchronize get requests Asynchronous get request Synchronize post requests Asynchronous post request Upload file Form submission The following are the features of okhttp given on the official website: Support HTTP / 2, http / 2 supports concurrency on a single TCP connection by using multiplexing technology, and sends or receives […]

  • The script cleans some Linux files regularly

    Time:2021-7-16

    method 1. New script_ Name. Sh, the file cleaning command is as follows #!/bin/sh find /var/mqm/errors/ -name ‘*.py’ -exec rm -rf {} \; If there are multiple files to be cleared, *. Py should be enclosed with single quotation marks; And; There must be no space in the middle, here is the function of escape; […]