Android MySQL Retrofit Full Course – INSERT SELECT UPDATE DELETE SEARCH PAGINATION → Creating App Class – Camposha

Android MySQL Retrofit Full Course – INSERT SELECT UPDATE DELETE SEARCH PAGINATION

Creating App Class

Introduction

This is part of the Android Live Courses Season 1 series. In this season one we are looking at how to perform crud operations against mysql database backed by retrofit. In the process we are creating a full scientists app.

In this lesson we want to initialize Calligraphy, our custom font library.

App.java

Create a file called App.java in the root package of your project.

Add the following code:

package info.camposha.retrofitmysqlcrud;

import android.app.Application;

import io.github.inflationx.calligraphy3.CalligraphyConfig;
import io.github.inflationx.calligraphy3.CalligraphyInterceptor;
import io.github.inflationx.viewpump.ViewPump;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ViewPump.init(ViewPump.builder()
                .addInterceptor(new CalligraphyInterceptor(
                        new CalligraphyConfig.Builder()
                                .setDefaultFontPath("fonts/Roboto-Bold.ttf")
                                .setFontAttrId(R.attr.fontPath)
                                .build()))
                .build());
    }
}
//end

Let’s move to the next lesson.

Video Lesson(Recommended)

 

Conclusion

Now we’ve looked at the app class. That class is our Application class in that it derives from `android.app.Application`, which is an android component. It is this app class where we’ve loaded our custom fonts. We said we are using a library called Calligraphy as our font loading library.

 

Now move over to the next lesson.

 

(1) Comment

  • IOSTREAM17 September 13, 2019 @ 1:20 pm

    Good job.

    Reply

Leave a Reply

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

(2) Comments

  • IOSTREAM17 July 5, 2019 @ 6:55 am

    good job well done

    • Admin bar avatar
      Oclemy July 5, 2019 @ 7:08 am

      Thank you very much.

Comments are closed.

X