Edit: your original answer did not indicate that you want to do this at runtime. Below the line how to do it, before compiling. Regarding execution programmatically at runtime:
From this answer :
You cannot change a manifest or resource in an APK with a signature and a seal, with the exception of a software update.
But also, the accepted answer found out to “hack” or some kind of fraudulent way to do this (I suppose). I have not tested it, but there is a source for you.
Or, this link seems to describe how to do this using the widget approach.
So let's say your manifest was like this:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="yourPackage" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > ...
You would change the launch icon by placing images in your patches:
Project folder --> res --> all the drawables
Then you must change android:icon="@drawable/ic_launcher"
as android:icon="@drawable/whateverTheNameOfTheImageIsYouPutInTheDrawablesFolders"
To change the label:
Open the strings.xml
file, which is located:
Project folder --> res --> values --> strings.xml
Look for a line that looks like this:
<string name="app_name">Your App Name</string>
And just change Your App Name
to what you want the label to be.
Summary:
android:icon="@drawable/ic_launcher"
defines your launch icon, so just add images to the drop-down folders and change ic_launcher
so that the image name means you want to be an icon.
android:label="@string/app_name"
defines your "label", so just find app_name
(since the label refers to @string/app_name
) in your strings.xml
file and change the contents of app_name
.