I am currently working on an Android project. And now I want to complete the task: analyze the xml file with the name AndroidManifest.xml and get some attribute from it. And set some values in vim.
Here is the AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.base.module.callhistory" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <application android:label="@string/app_name" android:theme="@android:style/Theme.Light.NoTitleBar" android:icon="@drawable/call_history"> <activity android:name="HistoryMainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="HistoryListActivity"> <intent-filter> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name="DetailListActivity"> <intent-filter> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>
I want to parse package="com.base.module.callhistory" and HistoryListActivity into <activity android:name="HistoryMainActivity" . Then I can use these two values to make a command to launch my application automatically. I just set these values manually. But I think that if vim can analyze this file and set these values automatically, it should be very cool.
source share