Home Blog Page 3

Android Builders Weblog: Saying Jetpack Navigation 3



Android Builders Weblog: Saying Jetpack Navigation 3

Posted by Don Turner – Developer Relations Engineer

Navigating between screens in your app needs to be easy, should not it? Nonetheless, constructing a sturdy, scalable, and pleasant navigation expertise is usually a problem. For years, the Jetpack Navigation library has been a key software for builders, however because the Android UI panorama has advanced, significantly with the rise of Jetpack Compose, we acknowledged the necessity for a brand new strategy.

At this time, we’re excited to introduce Jetpack Navigation 3, a brand new navigation library constructed from the bottom up particularly for Compose. For brevity, we’ll simply name it Nav3 any more. This library embraces the declarative programming mannequin and Compose state as elementary constructing blocks.

Why a brand new navigation library?

The unique Jetpack Navigation library (generally known as Nav2 because it’s on main model 2) was initially introduced again in 2018, earlier than AndroidX and earlier than Compose. Whereas it served its unique objectives properly, we heard from you that it had a number of limitations when working with trendy Compose patterns.

One key limitation was that the again stack state might solely be noticed not directly. This meant there might be two sources of fact, probably resulting in an inconsistent utility state. Additionally, Nav2’s NavHost was designed to show solely a single vacation spot – the topmost one on the again stack – filling the out there area. This made it tough to implement adaptive layouts that show a number of panes of content material concurrently, equivalent to a list-detail format on massive screens.

illustration of single pane and two-pane layouts showing list and detail features

Determine 1. Altering from single pane to multi-pane layouts can create navigational challenges

Founding ideas

Nav3 is constructed upon ideas designed to offer larger flexibility and developer management:

    • You personal the again stack: You, the developer, not the library, personal and management the again stack. It is a easy checklist which is backed by Compose state. Particularly, Nav3 expects your again stack to be SnapshotStateList the place T may be any sort you select. You possibly can navigate by including or eradicating objects (Ts), and state adjustments are noticed and mirrored by Nav3’s UI.
    • Get out of your means: We heard that you do not like a navigation library to be a black field with inaccessible inside parts and state. Nav3 is designed to be open and extensible, offering you with constructing blocks and useful defaults. If you need customized navigation habits you possibly can drop right down to decrease layers and create your personal parts and customizations.
    • Choose your constructing blocks: As a substitute of embedding all habits inside the library, Nav3 presents smaller parts you can mix to create extra complicated performance. We have additionally supplied a “recipes ebook” that reveals the way to mix parts to resolve frequent navigation challenges.

illustration of the Nav3 display observing changes to the developer-owned back stack

Determine 2. The Nav3 show observes adjustments to the developer-owned again stack.

Key options

    • Adaptive layouts: A versatile format API (named Scenes) lets you render a number of locations in the identical format (for instance, a list-detail format on massive display screen units). This makes it simple to change between single and multi-pane layouts.
    • Modularity: The API design permits navigation code to be break up throughout a number of modules. This improves construct instances and permits clear separation of obligations between characteristic modules.

      moving image demonstrating custom animations and predictive back features on a mobile device

      Determine 3. Customized animations and predictive again are simple to implement, and straightforward to override for particular person locations.

      Fundamental code instance

      To present you an concept of how Nav3 works, this is a brief code pattern.

      // Outline the routes in your app and any arguments.
      knowledge object Residence
      knowledge class Product(val id: String)
      
      // Create a again stack, specifying the route the app ought to begin with.
      val backStack = bear in mind { mutableStateListOf(Residence) }
      
      // A NavDisplay shows your again stack. Each time the again stack adjustments, the show updates.
      NavDisplay(
          backStack = backStack,
      
          // Specify what ought to occur when the person goes again
          onBack = { backStack.removeLastOrNull() },
      
          // An entry supplier converts a route right into a NavEntry which accommodates the content material for that route.
          entryProvider = { route ->
              when (route) {
                  is Residence -> NavEntry(route) {
                      Column {
                          Textual content("Welcome to Nav3")
                          Button(onClick = {
                              // To navigate to a brand new route, simply add that path to the again stack
                              backStack.add(Product("123"))
                          }) {
                              Textual content("Click on to navigate")
                          }
                      }
                  }
                  is Product -> NavEntry(route) {
                      Textual content("Product ${route.id} ")
                  }
                  else -> NavEntry(Unit) { Textual content("Unknown route: $route") }
              }
          }
      )
      

      Get began and supply suggestions

      To get began, take a look at the developer documentation, plus the recipes repository which offers examples for:

        • frequent navigation UI, equivalent to a navigation rail or bar
        • conditional navigation, equivalent to a login circulate
        • customized layouts utilizing Scenes

      We plan to offer code recipes, documentation and blogs for extra complicated use instances in future.

      Nav3 is at the moment in alpha, which signifies that the API is liable to alter primarily based on suggestions. In case you have any points, or want to present suggestions, please file a problem.

      Nav3 presents a versatile and highly effective basis for constructing trendy navigation in your Compose purposes. We’re actually excited to see what you construct with it.

      Discover this announcement and all Google I/O 2025 updates on io.google beginning Could 22.


How a Clone of the Sign Utility Compromised Official Customers’ Information


One of many greatest cyber scandals of the yr instantly entails the U.S. authorities. In early Could, investigative media outlet 404 Media revealed that sure U.S. federal businesses, together with U.S. Customs and Border Safety, have been utilizing a cloned and modified model of the Sign app.

Mojo and Constructing a CUDA Substitute with Chris Lattner


Python is the dominant language for AI and knowledge science purposes, but it surely lacks the efficiency and low-level management wanted to completely leverage GPU {hardware}. Consequently, builders typically depend on NVIDIA’s CUDA framework, which provides complexity and fragments the event stack.

Mojo is a brand new programming language designed to mix the simplicity of Python with the efficiency of C and the security of Rust. It additionally goals to supply a vendor-independent method to GPU programming. Mojo is being developed by Chris Lattner, a famend techniques engineer identified for his seminal contributions to pc science, together with LLVM, the Clang compiler, and the Swift programming language.

Chris is the CEO and Co-Founding father of Modular AI, the corporate behind Mojo. On this episode, he joins the present to debate his engineering journey and his present work on AI infrastructure and the Mojo language.

Kevin Ball or KBall, is the vp of engineering at Mento and an impartial coach for engineers and engineering leaders. He co-founded and served as CTO for 2 firms, based the San Diego JavaScript meetup, and organizes the AI inaction dialogue group by means of Latent House.

 

 

Please click on right here to see the transcript of this episode.

Sponsors

This episode of Software program Engineering Each day is dropped at you by Capital One.

How does Capital One stack? It begins with utilized analysis and leveraging knowledge to construct AI fashions. Their engineering groups use the ability of the cloud and platform standardization and automation to embed AI options all through the enterprise. Actual-time knowledge at scale permits these proprietary AI options to assist Capital One enhance the monetary lives of its clients. That’s know-how at Capital One.

Be taught extra about how Capital One’s trendy tech stack, knowledge ecosystem, and software of AI/ML are central to the enterprise by visiting www.capitalone.com/tech.

Chilly Sore Virus Linked to Alzheimer’s, Antivirals Might Decrease Threat – NanoApps Medical – Official web site


Abstract: A big research means that symptomatic an infection with herpes simplex virus 1 (HSV-1)—greatest recognized for inflicting chilly sores—might considerably elevate the danger of growing Alzheimer’s illness. Researchers discovered that folks with HSV-1 have been 80% extra more likely to have Alzheimer’s, whereas these handled with antiviral drugs had a 17% decrease threat.

The findings align with different proof that HSV-1 might set off irritation and amyloid-beta accumulation within the mind, hallmarks of Alzheimer’s pathology. Though the research is observational and might’t show causation, it highlights the potential for antiviral remedy as a protecting technique and urges better public well being deal with herpes virus prevention.

Key Info:

  • 80% Greater Threat: Individuals with HSV-1 have been considerably extra more likely to develop Alzheimer’s.
  • Antiviral Profit: HSV-1 sufferers who took antiviral medication had a 17% decrease Alzheimer’s threat.
  • Organic Hyperlink: HSV-1 might drive mind irritation and amyloid buildup, contributing to dementia.

Supply: BMJ

Symptomatic an infection with the virus liable for chilly sores across the mouth–herpes simplex 1, or HSV-1 for brief—might have a key position within the growth of Alzheimer’s illness, suggests a big pharma industry-funded US research revealed within the open entry journal BMJ Open.

However remedy with antiviral remedy appears to be linked to a decrease threat of this sort of dementia, suggesting that remedy to quell HSV-1 signs could also be protecting, the findings point out.

Presently, round 35.6 million individuals worldwide dwell with dementia, and seven.7million new circumstances are recognized yearly, say the researchers. Alzheimer’s illness contains 60%–80% of all dementias, with whole prices for its remedy reaching US$305 billion in 2020, they add.

Varied infectious brokers have been implicated within the growth of Alzheimer’s illness, and essentially the most studied of those is HSV-1, which affected greater than two-thirds of beneath 50s across the globe in 2016 alone.

To shed additional mild on the mooted position of HSV-1 in Alzheimer’s illness and the potential protecting results of antiherpetic medication, the researchers drew on a big set of US administrative claims information (IQVIA PharMetrics Plus) for the interval 2006-21.

Individuals recognized with Alzheimer’s illness have been matched for age, intercourse, geographical area, database entry 12 months, and variety of healthcare visits with these with none historical past of neurological illness, leading to a complete of 344,628 case–management pairs.

Practically two thirds (65%) of these with Alzheimer’s illness have been girls. Their common age was 73 and so they tended to have extra co-existing circumstances—all threat components.

In all, 1507 (just below 0.5%) individuals with Alzheimer’s illness had been recognized with HSV-1 (0.44%) in contrast with 823 (just below 0.25%) of these within the comparability (management) group.

Unsurprisingly, the danger of Alzheimer’s illness rose in tandem with age. However, total, the probability of an HSV-1 prognosis was 80% greater amongst these with Alzheimer’s illness, after adjusting for doubtlessly influential components.

Among the many 2330 individuals with a historical past of HSV-1 an infection, 931 (40%) used antiherpetic remedy after their prognosis. They usually have been 17% much less more likely to develop Alzheimer’s illness than those that didn’t use these remedies.

The researchers additionally seemed on the potential position of different herpes viruses, together with HSV-2, varicella zoster virus, and cytomegalovirus. Each HSV-2 and varicella zoster virus infections have been additionally related to a heightened threat of Alzheimer’s illness.

Precisely how HSV-1 and different neurotropic viruses may heighten the danger of dementia isn’t clear, level out the researchers.

“Nevertheless, research have proven that inflammatory alterations within the mind attributable to HSV an infection are pivotal in [Alzheimer’s disease] growth,” they clarify. “It has been reported that Aβ peptides are deposited in response to HSV an infection and shield host cells by blocking viral fusion with the plasma membrane, pointing to HSV as a possible threat issue for [Alzheimer’s disease]. Constantly, Aβ reveals antimicrobial properties in opposition to varied pathogens, together with HSV-1,” they add.

HSV-1 DNA can be discovered within the plaques attribute of Alzheimer’s illness, and folks carrying the ApoE ε4 allele, the most typical genetic threat issue for the illness, are extra vulnerable to HSV infections, they be aware.

That is an observational research, and as such, no agency conclusions could be drawn about trigger and impact. And the researchers acknowledge that HSV-1 infections earlier than the affected person’s inclusion within the database weren’t recognized, added to which many individuals with the an infection don’t have signs, whereas others won’t search remedy once they do–all components which may affect the findings.

However their findings are in keeping with these of different research. They usually recommend: “Whereas the molecular mechanisms stay to be absolutely elucidated, these outcomes are indicative of a attainable position for antiherpetic remedy in mitigating dementia threat.”

They usually conclude: “These findings place an excellent better emphasis on viewing the prevention of herpes viruses as a public well being precedence.

Interact customers on Google TV with glorious TV apps



Interact customers on Google TV with glorious TV apps

Posted by Shobana Radhakrishnan – Senior Director of Engineering, Google TV, and Paul Lammertsma – Developer Relations Engineer, Android

Over the previous yr, Google TV and Android TV achieved over 270 million month-to-month energetic gadgets, establishing one of many largest sensible TV OS footprints. Constructing on this momentum, we’re excited to share new platform options and developer instruments designed that can assist you enhance app engagement with our increasing consumer base.

Google TV with Gemini capabilities

Earlier this yr, we introduced that we’ll carry Gemini capabilities to Google TV, so customers can communicate extra naturally and conversationally to seek out what to observe and get solutions to advanced questions.

A user pulls up Gemini on a TV asking for kid-friendly movie recommendations similar to Jurassic Park. Gemini responds with several movie recommendations

After every film or present search, our new voice assistant will counsel related content material out of your apps, considerably rising the discoverability of your content material.

A user pulls up Gemini on a TV asking for help explaining the solar system to a first grader. Gemini responds with YouTube videos to help explain the solar system

Plus, customers can simply ask questions on subjects they’re interested in and obtain insightful solutions with supporting movies.

We’re so excited to carry this beneficial and pleasant expertise to customers this fall.

Video Discovery API

Right this moment, we’ve additionally opened companion enrollment for our Video Discovery API.

Video Discovery optimizes Resumption, Entitlements, and Suggestions throughout all Google TV kind components to boost the end-user expertise and increase app engagement.

    • Resumption: Companions can now simply show a consumer’s paused video inside the ‘Proceed Watching’ row from the house display screen. This row is a first-rate location that drives 60% of all consumer interactions on Google TV.
    • Entitlements: Video Discovery streamlines entitlement administration, which matches app content material to consumer eligibility. Customers recognize this as a result of they will get pleasure from personalised suggestions while not having to manually replace all their subscription particulars. This enables companions to attach with customers throughout a number of discovery factors on Google TV.
    • Suggestions: Video Discovery even highlights personalised content material suggestions based mostly on content material that customers watched inside apps.

Companions can start incorporating the Video Discovery API in the present day, beginning with resumption and entitlement integrations. Try g.co/television/vda to be taught extra.

Jetpack Compose for TV

Compose for TV 1.0 expands on the core and Material Compose libraries

Final yr, we launched Compose for TV 1.0 beta, which helps you to construct lovely, adaptive UIs throughout Android, together with Android TV OS.

Now, Compose for TV 1.0 is secure, and expands on the core and Materials Compose libraries. We’ve even seen how the most recent launch of Compose considerably improves app startup inside our inner benchmarking cellular pattern, with roughly a 20% enchancment in contrast with the March 2024 launch. As a result of Compose for TV builds upon these libraries, apps constructed with Compose for TV also needs to see higher app startup occasions.

New to constructing with Compose, and undecided the place to begin? Our up to date Jetcaster audio streaming app pattern demonstrates methods to use Compose throughout kind components. It features a devoted module for enjoying podcasts on TV by combining separate view fashions with shared enterprise logic.

Focus Administration Codelab

We perceive that focus administration might be difficult at occasions. That’s why we’ve printed a codelab that opinions methods to set preliminary focus, put together for surprising focus traversal, and effectively restore focus.

Reminiscence Optimization Information

We’ve launched a complete information on reminiscence optimization, together with reminiscence targets for low RAM gadgets as effectively. Mixed with Android Studio’s highly effective reminiscence profiler, this helps you perceive when your app exceeds these limits and why.

In-App Scores and Opinions

Ratings and reviews entry point forJetStream sample app on TV

Furthermore, app scores and opinions are important for builders, providing quantitative and qualitative suggestions on consumer experiences. Now, we’re extending the In-App Scores and Opinions API to TV to permit builders to immediate customers for scores and opinions instantly from Google TV. Try our current weblog put up detailing methods to simply combine the In-App Scores and Opinions API.

Android 16 for TV

Android 16 for TV

We’re excited to announce the upcoming launch of Android 16 for TV. Builders can start utilizing the most recent beta in the present day. With Android 16, TV builders can entry a number of nice options:

    • Platform assist for the Eclipsa Audio codec allows creators to make use of the IAMF spatial audio format. For ExoPlayer assist that features earlier platform variations, see ExoPlayer’s IAMF decoder module.
    • There are numerous enhancements to media playback velocity, consistency and effectivity, in addition to HDMI-CEC reliability and efficiency optimizations for 64-bit kernels.
    • Extra APIs and consumer experiences from Android 16 are additionally out there. We invite you to discover the whole record from the Android 16 for TV launch notes.

What’s subsequent

We’re extremely excited to see how these bulletins will optimize your growth journey, and stay up for seeing the unbelievable apps you may launch on the platform!

Discover this announcement and all Google I/O 2025 updates on io.google beginning Might 22.