Tuesday, October 12, 2021

Square Logcat implementation in Java

There is no any steps for java implementation and some java developer want's to implement this library so here is the steps

Add Dependency in your gradle file

implementation 'com.squareup.logcat:logcat:0.1' 

First step 

Install AndroidLogcatLogger in Application's onCreate() method

import android.app.Application;
import logcat.AndroidLogcatLogger;
import logcat.LogPriority;

public class ExampleApplication extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    AndroidLogcatLogger.Companion.installOnDebuggableApp(this,  LogPriority.VERBOSE);
  }
}

Now you can use this library in your any class

 
LogcatKt.logcat("MyFirstTag", LogPriority.ERROR, () -> "Add your log here");

Or if we want to print any exception then try below code.
   
LogcatKt.logcat("MyOtherTag", LogPriority.ERROR, () -> ThrowablesKt.asLog(new RuntimeException("Hello world")));

If Square developer want's then they can provide good java implementation also I have create one PR for it to easily java implementation.

Here is the github link of this library : https://github.com/square/logcat

Best of luck...

Sunday, November 1, 2015

Android material design in api 10

Hi friends today I share with you one other most important things. Yes it's about material design.
Now material design is sooooooooo cool things. and it's start with android api 21. But if we want to support with api 10 then here is the steps.

  1. First add library or dependency in project (Support library v7)
  2. Create your xml and use the material color.
  3. extends AppCompactActivity in the java file.
  4. use Theme.AppCompact in the Android Manifest/styles.xml
That's done....

Thursday, October 1, 2015

Android Studio 1.4 Stable Realese

Google release android studio 1.4 on stable channel (30/09/2015). With this android studio introduce special feature like VECTOR ASSETS, Theme Editor and more update of project template, performance monitor.

For use vector assets we set minimal SDK version is less then 21. With this gradle introduce 1.4.0-beta3 for android.

VECTOR ASSETS:
we can use new Vector Asset Studio by right-clicking the res/drawable folder in our project and selecting NEW - Vector Asset from the content menu.



THEME EDITOR:
This  first version of the Theme Editor id focused on editing and updating the material theme colors (color.xml) in our project. In future version they will provide more theme and style files. To open this editor click Tool - Android - Theme Editor.

Project Templates:
At the start of new project this all option is given with floating action button. if we want to use floating button then we have to add appcompect support library 22.1 to our project.
 Update android studio:
Windows / Linux : Help - Check For Update
MAC : Android Studio - Check For Updates

Friday, September 25, 2015

Welcome

Hi friends here i post my some interesting android experience...Be ready for this...