Android操作excel功能实例代码

  

学习的应用对excel的读写控制

  

<强> 1。界面设计

        & lt; & # 63; xml version=" 1.0 " encoding=" utf - 8 " & # 63;比;   & lt; RelativeLayout xmlns: android=" http://schemas.android.com/apk/res/android "   xmlns:工具=" 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”   工具:上下文=癱om.npmaster.myexcel.MainActivity”比;   LinearLayout & lt;   android:取向=按怪薄?   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 "比;   & lt; TableLayout   android: layout_width=" match_parent "   android: layout_height=" wrap_content "   android:背景=" # ffcccccc”   android: layout_margin=? dp”比;   & lt; !——line1祝辞   & lt; TableRow   android: layout_width=" match_parent "   android: layout_height=" 20 dp”   android:背景=" # ffcccccc”   android: layout_margin=?.5 dp”比;   & lt; TextView   android: layout_width=" 0.0 dp "   android: layout_height=" wrap_content "   android: layout_weight=" 1 "   android:文本="工参数据导入”   android: id=癅 + id/tvtip”/比;   & lt; TextView   android:文本="默认路径”   android: layout_width=" 0.0 dp "   android: layout_height=" wrap_content "   android: layout_weight=" 2 "   android: id=癅 + id/tvpath”/比;   & lt;/TableRow>   & lt; !——比;   & lt; TableRow   android: layout_width="宽和"   android: layout_height=" wrap_content "   android:背景=" # ffffcc99”   android: layout_margin=?.5 dp”比;   & lt;按钮   android:文本="导入数据”   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: id=癅 + id/btImport”   android: textSize=" 12 dp "   android: layout_weight=" 1 "/比;   & lt;按钮   android:文本="清理数据”   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: id=癅 + id/btClear”   android: textSize=" 12 dp "   android: layout_weight=" 1 "/比;   & lt;/TableRow>   & lt;/TableLayout>   & lt; android.support.v7.widget.RecyclerView   android:滚动条=按怪薄?   android: layout_width=" match_parent "   android: layout_height=" wrap_content "   android:分频器=" # ffff0000”   android: dividerHeight=" 10 dp”   android: id=癅 + id/rcvEngineerParameters”/比;   & lt;/LinearLayout>   & lt;/RelativeLayout>            & lt; & # 63; xml version=" 1.0 " encoding=" utf - 8 " & # 63;比;   & lt; LinearLayout xmlns: android=" http://schemas.android.com/apk/res/android "   xmlns:应用=" http://schemas.android.com/apk/res-auto "   android:取向=按怪薄?   android: layout_width=" match_parent "   android: layout_height=皐rap_content”比;   & lt; TableLayout   android: layout_width=" match_parent "   android: layout_height=" wrap_content "   android:背景=" # ffcccccc”   android: layout_margin=" 0 dp”比;   & lt; TableRow   android: layout_width="宽和"   android: layout_height=" wrap_content "   android:背景=" # ffffcc99”   android: layout_margin=?.5 dp”比;   & lt; TextView   android:文本="词"   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: layout_weight=" 1 "   android: textSize=" 12 dp "   android: id=癅 + id/tvCid”/比;   & lt; TextView   android:文本=" CellName:“   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: layout_weight=" 1 "   android: textSize=" 12 dp "   android: id=癅 + id/tvCellName”/比;   & lt; TextView   android:文本=" Longtitude "   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: layout_weight=" 1 "   android: textSize=" 12 dp "   android: id=癅 + id/tvLongtitude”/比;   & lt; TextView   android:文本=钡奶?“   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: layout_weight=" 1 "   android: textSize=" 12 dp "   android: id=癅 + id/tvAttitude”/比;   & lt; TextView   android:文本="方位:“   android: layout_width=" 0.0 dp "   android: layout_height=" match_parent "   android: layout_weight=" 1 "   android: textSize=" 12 dp "   android: id=癅 + id/tvAzimuth”/比;   & lt;/TableRow>   & lt;/TableLayout>   & lt;/LinearLayout>

Android操作excel功能实例代码