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