Posts

Latest

Android Versions details

Android Version Name / API Level Released Date Released Features 1 Android Alpha - API 1 Sep 23, 2008   1.1 Android Beta – API 2 Feb 9, 2009 Support for third party keyboards Video Recording Playback 1.5 Cupcake – API 3 Apr 27, 2009 Android version get a desert nickname 1.6 Donut – API 4 Sep 15, 2009 Support for CDMA technology Support for different screen sizes Battery usage indicator 2 Eclairs – API 5 to 7 Oct 26, 2009 Improved UI with search bar on the top Support for HTML5 2.2 Froyo – API 8 May 20, 2010 Improved performance than Eclairs 2.3 Gingerbread – API 9 to 10 Dec 6, 2010 Supports VOIP and NFC4 3 Honeycomb – API 11 to 13 Feb 22, 2011 Supports for Android tablets 4 Ice Cream Sandwich – API 14 to 15 Oct 18, 2011 Sup

English - Formal and Informal words

 The following English words could be used when you are in official discussion with your customer or supervisors. This is for quick reference.  Informal to Formal  Give - replaced with Provide Can you provide more information?  Childish -  replaced with  Immature Maybe  -  replaced with  Perhaps Hungry -  replaced with  Famished Problems -  replaced with  Challenges Good -  replaced with  Positive Danger -  replaced with  Peril Stubborn -  replaced with  Obstinate Put off -  replaced with  Postpone Here -  replaced with  Present Help  -  replaced with  Assist Start  -  replaced with Commence Mad  -  replaced with Insane Go up  -  replaced with Increase Tough  -  replaced with Difficult Book  -  replaced with Reserve

Android - Adding libraries to gradle file - quick reference

        The following lines of codes, which helps you to add the Gradle dependencies for your project quickly. I have listed out the widely used Gradle dependencies. Please let me know in the comment section if you like to add any other libraries. Let's check.. //Constraint Layout implementation 'androidx.constraintlayout:constraintlayout:1.1.3' //Material Design implementation 'com.google.android.material:material:1.3.0-alpha02' //Kotlin Coroutines implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8" //Retrofit - for async API calls implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' //Lifecycle  implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' //Kodein - Dependency Injection framework implementation 'com.eygraber:kodein-di-generic-jvm:5.2.1' implemen

Edit text with clear button in Android app

This simple example would help you to create a edit text with clear button EditText editText = (EditText) findViewById(R.id.Editdob); drawable created to assign in edit text (in Activity/Fragment) final Drawable drawable = getResources().getDrawable( R.drawable.clear_edit_text); drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); editText.setCompoundDrawables(null, null, drawable, null); ImageView crossImageView = new ImageView(this); crossImageView.setImageDrawable(drawable); On touch listener for edit text (in Activity/Fragment) editText.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View arg0, MotionEvent arg1) { if (arg1.getX() > editText.getWidth() - drawable.getIntrinsicWidth() - 10) editText.setText(""); } return false; } });

Java Synchronized Keyword

The synchronized is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the synchronized keyword indicates the following :   ** The synchronized keyword may be applied to statement block or to a method. **  The synchronized keyword provides the protection for the crucial sections   that are required only to be executed by a single thread once at a time. **   The synchronized keyword avoids a critical code from being executed by more than one thread at a time. Its restricts other threads to concurrently access a resource. ** If   the synchronized keyword is applied to a static method, as we will show it with a class having a method SyncStaticMethod through an example below, the entire class get locked while the method under execution and control of a one thread at a time. **   When the synchronized keyword is applied to an instance method, as w