Xiaomi Open source File Manager micodefileexplorer-Source Research (9)-Import analysis

Source: Internet
Author: User

Androidmanifest.xml is the most important configuration file for Android applications.


Entry files and Intent-filter
<application        android:icon= "@drawable/icon"        android:label= "@string/app_name"        android:theme= "@ Android:style/theme.holo.light "        android:uioptions=" Splitactionbarwhennarrow ">        <activity            Android:name= "net.micode.fileexplorer.FileExplorerTabActivity"            android:configchanges= "screensize| Keyboardhidden "            android:screenorientation=" sensor "            android:uioptions=" Splitactionbarwhennarrow ">            <intent-filter >                <action android:name= "Android.intent.action.MAIN"/>                <category Android:name= "Android.intent.category.DEFAULT"/>                <category android:name= " Android.intent.category.LAUNCHER "/>            </intent-filter>              </activity></application>




Intent and Intentfilter, yesterday only reviewed the next, the general meaning is: intent intention, as a programming mode, to realize the program decoupling,
and Intentfilter can filter intent.
Android.intent.action.MAIN indicates "entrance",
Android.intent.category.LAUNCHER indicates "Determines whether the application appears in the program list."


2 activity and one service are also configured.
<activity android:name= ". Searchactivity "></activity> <activity            android:label=" @string/menu_setting "            android: Launchmode= "Singletop"            android:name= ". Fileexplorerpreferenceactivity "            android:theme=" @android: Style/theme.holo.light.noactionbar ">        </ Activity><service android:name= ". Ftpserverservice "/>






After the program starts, enter the Fileexplorertabactivity interface.
OnCreate function, complete the construction of Viewpager and TabsAdapter2 key objects.
The most important thing is tabsadapter.


Or use your own understanding to express this problem ~
Fileexplorertabactivity This activity is the controller.
Viewpager This view is the view.
Tabsadapter is model, providing data ~


Mtabsadapter = new Tabsadapter (this, mviewpager); Mtabsadapter.addtab (Bar.newtab (). SetText (R.string.tab_category), Filecategoryactivity.class, NULL); Mtabsadapter.addtab (Bar.newtab (). SetText (R.STRING.TAB_SD), Fileviewactivity.class, NULL); Mtabsadapter.addtab (Bar.newtab (). SetText (R.string.tab_remote), Servercontrolactivity.class, NULL); Bar.setselectednavigationitem (Preferencemanager.getdefaultsharedpreferences ( This). GetInt (Instancestate_tab,util.category_tab_index));




tab type of adapter, added 3 options, namely filecategoryactivity category browsing,
fileviewactivity file management, servercontrolactivity remote management.
The first 2 are mainly Xiaomi's own implementation, the latter 1 used the newly configured Ftpservice, the main code is another open source product swiftp.


Then is the related event binding and switching, tab switching by tabactivity itself response, other related events by filecategoryactivity and other responses.


Summarize
Android, Swing, Windows, Web, visual interface development GUI type application development, the process is similar.
1. Do the program configuration ~
. XML,. Properties,. conf,. INI, etc.
2. Start the process, initialize ~
One type of application, the startup process is basically fixed ~
Standards tend to be strong for a company to set up ~
As a programmer, we can only follow the standard step-by-Step Oh ~
3. Display interface
Android: Mobile
WINDOWS/SWING:PC End
Web:web
4. Responding to Events
Web-side: URL hyperlink Click, JS button, etc.
android/windows/swing : button click etc




Resources:
1.http://liuzhichao.com/p/506.html
2.http://zhidao.baidu.com/link?url=vkigann8r2s5-scbqytl1pgjxmtojtjxcp97rfbq8arjo9gmworfsfbfqw06jj6qfkwgvzgsnqn3cni5zyqyhk

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Xiaomi Open source File Manager micodefileexplorer-Source Research (9)-Import analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.