Skip to main content

Posts

Now in Android

Android Studio 4.2 discharged to steady channel   Android Studio 4.2 is now available in the stable release channel. Read the blog for detailed information on what’s new, including a new tool to help migrate your project to the latest Android Gradle Plugin version. We’ve also enhanced lots of stuff such as Database Inspector , System Trace , SafeArgs support, Apply Changes, and the new project wizard. As always, download here and file issues here .           Hilt is stable and ready for production Manuel Vivo wrote about the stable release of Hilt , Android Jetpack’s recommended dependency injection (DI) solution for Android apps. Hilt is a simpler, more opinionated way to leverage the power of the Dagger DI library, eliminating boilerplate and reducing errors. It provides direct injection support for popular Jetpack libraries such as ViewModel, WorkManager, Navigation, and Compose. ( DI Basics , Documentation )   Google Play updates   Google Play announced upcoming polic
Recent posts

Showing a Progress Dialog

     One normal UI highlight in an Android gadget is the "Please wait" exchange that you ordinarily observe when an application is playing out a long-running errand. For instance, the application may be signing in to a worker before the client is permitted to utilize it, or it very well may be doing a computation prior to showing the outcome to the client. In such cases, it is useful to show a discourse, known as a progress dialog , with the goal that the client is kept on top of it.   Displaying a Progress Dialog (Please Wait):-   1.Manifest File <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.jfdimarzio.activity101">      <application          android:allowBackup="true"           android:icon="@mipmap/ic_launcher"           android:label="@string/app_name&qu

Displaying a Dialog Window

There are times when you need to display a dialog window to get a confirmation from the user. In this case , you can override the onCreateDialog() protected method defined in the Activity base class to display a dialog window. The following Try It Out shows you how. 1. Using Android Studio , create a new Android project and name it Dialog. When presented with the option , name the main activity DialogActivity. 2.Add the following theme in bold to the AndroidMainfest.xml file. Be sure to change all instances of "com.android" to whatever package name your project is using. <?xml version="1.0" encoding="utd-8"?> <manifest xmlns:android"http://schemas.android.com/apk/res/android" package="com.android.dialog">      <application           android:allowBackup="true"           android:icon:="@mipmap/ic_launcher"           android:label="@String/app_name"           android:supportRtl=&quo

Hiding the Activity Title

You can also hide the title of an activity if desired ( Such as when you just want to display a status update to the user). To do so , use the requestWindowFeature() method and pass it the window .FEATURE_NO_TITLE constant, like This : import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Window; public class MainActivity extends AppCompatActivity{            @Override            protected void onCreate ( Bundle savedInstanceState )            {                         super.onCreate (savedInstanceState );                         setContentView (R.layout.activity_main);                         requestWindowFeature(Window.FEATURE_NO_TITLE);             } } Now you need change the theme in the AndoirdManifest.xml to a theme that has no title bar. Be sure to change all instances of "com.android" to whatever.package name your project is using. package com.android.activity101; <?xml version="1.0" encoding=