Coder Social home page Coder Social logo

as's Introduction

as

Cau 4: ông copy từ đây nha:

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity">

    <EditText
        android:id="@+id/editText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Username" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Password" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="horizontal">

        <CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Remember me" />
    </LinearLayout>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="login" />
</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

Cau 3:

class PhanSo(private var tuso: Float,private var mauso: Float) { init { if (mauso == 0f) { tuso = 1f mauso = 1f } } fun printl() { println("Phan so la $tuso/$mauso") } fun add(phanSo: PhanSo) : PhanSo{ val tuso = this.tuso* phanSo.mauso + this.mauso +phanSo.tuso val mauso = this.mauso * phanSo.mauso return PhanSo(tuso, mauso) } }

private void saveText(String text, String name) throws IOException { OutputStream fos = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { ContentValues contentValues = new ContentValues(); contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, name + ".txt"); contentValues.put(MediaStore.MediaColumns.MIME_TYPE, "text/plain"); contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS + "/text/"); Uri uri = getContentResolver().insert(MediaStore.Files.getContentUri("external"), contentValues); fos = getContentResolver().openOutputStream(uri); fos.write(text.getBytes()); } else { if (checkPermission()) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { String textDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).toString(); File textFile = new File(textDir, name+ ".txt"); fos = new FileOutputStream(textFile); final PrintStream printStream = new PrintStream(fos); printStream.print(text); printStream.close(); } } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions(new String[]{android.Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE},111); } } fos.close(); } }

https://flexiple.com/android/android-workmanager-tutorial-getting-started/

https://stackoverflow.com/questions/50279364/android-workmanager-vs-jobscheduler

https://medium.com/androiddevelopers/introducing-workmanager-2083bcfc4712

https://blog.mindorks.com/integrating-work-manager-in-android

https://viblo.asia/p/android-jetpack-series-chapter-1-workmanager-6J3ZgmqL5mB

https://viblo.asia/p/tim-hieu-ve-workmanager-trong-android-jetpack-Az45bWbQKxY

https://medium.com/android-news/how-scheduling-work-with-new-android-jetpack-component-workmanager-852163f4825b

https://www.simplifiedcoding.net/android-workmanager-tutorial/

https://www.raywenderlich.com/20689637-scheduling-tasks-with-android-workmanager#toc-anchor-020

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.