Sunday, March 26, 2023
  • Home
  • contact us
  • About us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
360 Newstamil
  • Home
  • Latest News
  • Entertainment
  • Insurance
    • Financial Advisor
  • Tech
    • Mobiles
  • Healthy tips
    • Weight loss
    • Nutrition
    • Healthy food
    • Skin care
  • Kinds of Essays
    • How to Choose a Paper Writing Service
No Result
View All Result
  • Home
  • Latest News
  • Entertainment
  • Insurance
    • Financial Advisor
  • Tech
    • Mobiles
  • Healthy tips
    • Weight loss
    • Nutrition
    • Healthy food
    • Skin care
  • Kinds of Essays
    • How to Choose a Paper Writing Service
No Result
View All Result
360 Newstamil
No Result
View All Result
Home Latest Mobiles

API desugaring supporting Android 13 and java.nio

Sabari by Sabari
February 22, 2023
in Latest Mobiles
0
The primary developer preview of Android 14
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


The brand new model 2.0 launch is available in 3 flavors:

  • com.android.instruments:desugar_jdk_libs_nio:2.0.2 – the nio model consists of all of the desugaring accessible together with the java.nio, java.time, stream, and features APIs.
  • com.android.instruments:desugar_jdk_libs:2.0.2 – the default model consists of desugaring for the java.time, stream, and features APIs. It’s much like model 1.x API desugaring already accessible, however up to date with APIs added as much as Android 13.
  • com.android.instruments:desugar_jdk_libs_minimal:2.0.2 – the minimal model consists of solely the java.util.operate bundle and bug fixes on concurrent collections. It’s designed for minimal code dimension overhead.

Opting into extra desugaring options will result in a bigger influence in your app’s code dimension. The minimal specification has, as its title signifies, a minimal influence on the code dimension of the app. The nio specification has essentially the most influence.

The brand new java.nio APIs

The brand new java.nio APIs supported in API desugaring embrace:

  • All of the lessons and APIs in java.nio.file akin to BasicFileAttributes, file manipulation, or utilization of java.nio.file.Path.
  • Some extensions of java.nio.channels, such because the FileChannel#open strategies.
  • A number of utility strategies akin to File#toPath.

The next code snippet illustrates how one can now use the brand new java.nio APIs on all units, together with units operating Android 7 and decrease, by means of the strategies of kotlin.io.path which depend upon java.nio.file.Information. A temp file could be created, written into, learn, and its primary attributes and its existence could be queried utilizing the brand new java.nio APIs.

import android.util.Log
import java.nio.file.StandardOpenOption.APPEND
import kotlin.io.path.createTempDirectory
import kotlin.io.path.deleteIfExists
import kotlin.io.path.exists
import kotlin.io.path.fileSize
import kotlin.io.path.readLines
import kotlin.io.path.writeLines

...
val TAG = "java.nio Check"
val tempDirectory = createTempDirectory("tempFile")
val tempFile = tempDirectory.resolve("tempFile")
tempFile.writeLines(listOf("first"))
tempFile.writeLines(listOf("second"), choices = arrayOf(APPEND))
Log.d(TAG,"Content material: ${tempFile.readLines()}")
Log.d(TAG,"Dimension: ${tempFile.fileSize()}")
Log.d(TAG,"Exists (earlier than deletion): ${tempFile.exists()}")
tempFile.deleteIfExists()
Log.d(TAG,"Exists (after deletion): ${tempFile.exists()}")

// Ensuing logcat output.
Content material: first second
Dimension: 13
Exists (earlier than deletion): true
Exists (after deletion): false

A number of options nevertheless can’t be emulated for units operating Android 7 and decrease and as a substitute throw an occasion of UnsupportedOperationException or return null. They nonetheless work on units operating Android 8 or increased, so present code guarded by an API degree test ought to work because it used to. See the full listing of APIs accessible and the recognized limitations.

The code has been extensively examined, however we’re searching for further inputs from app builders.

Please check out the brand new model of API desugaring, and tell us the way it labored for you!

For added background see the publish Assist for newer Java language APIs from when API desugaring was launched.

Java and OpenJDK are logos or registered logos of Oracle and/or its associates.



Source_link

Previous Post

Gabbard, Dore, Paul Name for Finish to Ukraine Warfare

Next Post

How To Full a Dwelling Fireplace Extinguisher Inspection

Sabari

Sabari

Related Posts

Ideas customers spend 70% extra time utilizing the app on tablets than on telephones
Latest Mobiles

Ideas customers spend 70% extra time utilizing the app on tablets than on telephones

by Sabari
March 25, 2023
WWDC 2023: Find out how to watch and what to anticipate?
Latest Mobiles

WWDC 2023: Find out how to watch and what to anticipate?

by Sabari
March 25, 2023
A person’s take after three weeks
Latest Mobiles

A person’s take after three weeks

by Sabari
March 25, 2023
WhatsApp engaged on new brief video messages
Latest Mobiles

WhatsApp engaged on new brief video messages

by Sabari
March 25, 2023
Google Maps Immersive View lastly begins seems for some, bringing energetic 3D cities
Latest Mobiles

Google Maps Immersive View lastly begins seems for some, bringing energetic 3D cities

by Sabari
March 24, 2023
Next Post
How To Full a Dwelling Fireplace Extinguisher Inspection

How To Full a Dwelling Fireplace Extinguisher Inspection

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Premium Content

The Well being Advantages Of Inulin (Prebiotic)

The Well being Advantages Of Inulin (Prebiotic)

March 19, 2023
Advantages, Vitamin Reality, Facet Results & Recipes- HealthifyMe

Advantages, Vitamin Reality, Facet Results & Recipes- HealthifyMe

March 25, 2023
15 Of The Most Stunning Dwell TV Moments Ever

15 Of The Most Stunning Dwell TV Moments Ever

March 24, 2023

Browse by Category

  • Business
  • Entertainment
  • Financial Advisor
  • Health
  • Healthy food
  • Healthy tips
  • Insurance
  • Latest Mobiles
  • Latest New
  • Newsbeat
  • Nutrition
  • Science
  • Skin care
  • Sports
  • Stories
  • Tech
  • Weight loss
  • World

360 Newstamil

Here you will find the latest news and updates from our company. We try to write posts that are helpful and insightful, from time to time. To make sure you don’t miss anything, keep an eye out for our posts and be sure to follow us on Google+ so that you get the latest updates as they happen.

Categories

  • Business
  • Entertainment
  • Financial Advisor
  • Health
  • Healthy food
  • Healthy tips
  • Insurance
  • Latest Mobiles
  • Latest New
  • Newsbeat
  • Nutrition
  • Science
  • Skin care
  • Sports
  • Stories
  • Tech
  • Weight loss
  • World

Recent Post

  • Methods to Apologize—and Why You Ought to
  • Advantages of Charcoal Peel Off Masks for Pores and skin – The Pure Wash
  • Strawberry Balsamic Dressing (4 Elements)
  • Home
  • contact us
  • About us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

Copyright © 2023 360newstamil.com | All Rights Reserved.

No Result
View All Result
  • Home
  • Latest News
  • Entertainment
  • Insurance
    • Financial Advisor
  • Tech
    • Mobiles
  • Healthy tips
    • Weight loss
    • Nutrition
    • Healthy food
    • Skin care
  • Kinds of Essays
    • How to Choose a Paper Writing Service

Copyright © 2023 360newstamil.com | All Rights Reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?