I know how to extend the Application class from my main project, but currently i am extending also from a library project (to uncouple code), so i perform in this way:
1- public class MyMainApplication extends LibraryApp {...
2- public class LibraryApp extends Application {...
And my manifest:
<application
android:name="com.something.MyMainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyMainAppTheme">
In fact all works well, but i want to know if this coding could be breaking something in the Android architecture or whatever.
That will work fine, if you are sure that you call super.xx() in all the methods you override in your LibraryApp class.
Though, using the Application class basically limits your users quite alot. Many libraries use their own Application class (like you), and since there can only be 1 Application class, and you can only extend 1 class in Java, that limits the user to 1 library that use the Application class.
Do you really need to extend the Application class?
It would be better to create a singleton initializer class that takes the application context as a parameter. Then you still have access to the context, and can register whatever you want. And then the user isn't limited to extending your Application class.