I don’t think you can work like Meteor in the scheme at Android, but Android has layouts that can be used by include, for example:
Its Main Layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/app_bg"
android:gravity="center_horizontal">
<include android:id="@+id/news_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/title" />
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:padding="10dp" />
</LinearLayout>
Its reusable/reusable layout:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/titlebar_bg">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gafricalogo" />
</FrameLayout>
Read about in:
There are also Fragments, but they are a very specific case https://developer.android.com/guide/components/fragments.html
About the "Reponsibility"
Basically you will have to create a Layout for each size, this is not necessarily "responsive", but works well, you can create a layout for each screen so:
res/layout/my_layout.xml // telas normais (por defeito/por padrão)
res/layout-large/my_layout.xml // telas largas
res/layout-xlarge/my_layout.xml // telas muito largas
res/layout-xlarge-land/my_layout.xml // telas muito largas e em landscape
More details on: https://developer.android.com/guide/practices/screens_support.html
Or you can try the tip of this reply on Soen, if you need to do something with custom sizes you want, an example if the screen is larger than 600:
Configuration config = getResources().getConfiguration();
if (config.smallestScreenWidthDp >= 600) {
setContentView(R.layout.main_activity_tablet); //activity para tablets
} else {
setContentView(R.layout.main_activity); //activity normal
}
Webview as an app
There is also the possibility to use WebView
to create a Webapp, but it really doesn’t always pay off (it will depend a lot on the case), however if you want to use the Meteor, Bootstrap and related can try this answer:
Nothing better than reading the documentation: Compatibility with multiple screens, Support for different screen sizes and How to Design for Multiple Screens
– ramaral