Quote:
Originally Posted by sergejsp4
To Morkl
Hi!
I use rupor's modification of shell for sony prs t-1 (russian).
With this there is couple programs very useful for Me. Isilo and Alreader and Total Commander instead rootexplorer.
All of them I would like have like soft button on home screen on my device.
I have download end install your home screen, but I can't understand how I can set up those programs. I don't understand what I need write in xml file. Can you explain that really clear?
|
I'll try to explain, with Total Commander as an example
Apps are started by launching "intents", and every app has a "manifest" that describes, among other things, what intents that app can respond to.
For example, after extracting (I use
apktool for all my APK extracting and editing) the Total Commander APK, I locate the following segments in the AndroidManifest.xml file:
Code:
<manifest
android:label="@string/app_name" android:versionCode="22"
android:versionName="1.03" android:installLocation="auto
package="com.ghisler.android.TotalCommander"
xmlns:android="http://schemas.android.com/apk/res/android">
This is the
package name of the app.
And then:
Code:
<activity
android:label="@string/app_name"
android:name=".TotalCommander"
android:launchMode="singleTask"
android:configChanges="locale|keyboardHidden|orientation|screenSize|smallestScreenSize" android:windowSoftInputMode="adjustPan">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
I am looking for the
(class) name of the
activity that has a "android.intent.category.LAUNCHER"
intent-filter -- android.intent.category.LAUNCHER is used to signal that the activity can be started from the app launcher, so it is probably the activity we want to start when the button is pressed.
In the homemod.xml file, this corresponds to:
Code:
<customAppDefinition name="app_totalcommander" title="Total Commander">
<iconNormal>ic_totalcommander.png</iconNormal>
<iconPressed>ic_totalcommander_pressed.png</iconPressed>
<componentName package="com.ghisler.android.TotalCommander" class="com.ghisler.android.TotalCommander.TotalCommander" />
<intentAction>android.intent.action.MAIN</intentAction>
<intentCategory>android.intent.category.LAUNCHER</intentCategory>
</customAppDefinition>
N.B.: When the class name begins with a dot, as in this case, the package name must be prepended to it in the componentName class attribute, e.g. ".TotalCommander" => "com.ghisler.android.TotalCommander.TotalCommander "
Was that clear enough?