1. manifests
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.npsmaster.phoneinfo"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" > </uses-permission> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" > </uses-permission> </manifest>
2.main
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.npsmaster.phoneinfo.MainActivity"> <!--start--> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/childlayout" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true"> <TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffcccccc" android:layout_margin="1dp"> <!-- line1 --> <TableRow android:layout_width="match_parent" android:layout_height="20dp" android:background="#ffcccccc" android:layout_margin="0.5dp"> <TextView android:text="General Information" android:layout_marginTop="5dp" android:layout_width="0.0dp" android:layout_height="20dp" android:layout_weight="1" android:id="@+id/tvStaticInfoLable"> </TextView> <TextView android:text="Time:" android:layout_marginTop="5dp" android:layout_width="0.0dp" android:layout_height="20dp" android:layout_weight="1" android:id="@+id/tvTimeleaps"> </TextView> </TableRow> <!--line2--> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"