Add an icon to the app drawer

Discussion in 'Tutorials' started by Eraste, Mar 25, 2013.

  1. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    As the title implies. I will show you how to add an icon to your app drawer that will take the user straight to the settings menu of your live wallpaper. I have read some reviews were users complain about having to push so many buttons to get to the settings menu. This will fix that issue!

    Remember this will only bring them to the settings menu not to were they can set the wallpaper.

    To do this simply modify the activity code in your AndroidManifest.xml file as follows:

    Code (text):
    <activity
                android:label="Heart Settings"
                android:name=".LiveWallpaperSettings"
                android:theme="@android:style/Theme.WallpaperSettings"
                android:exported="true"
                android:icon="@drawable/icon">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                 
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    This will set whatever icon you use in your drawable folder as the launcher "app" drawer icon.
    android:label is the text that will be displayed under the icon. So after you modify the activity lines in your AndroidManifest.xml to look like the above code you should now see the icon in app drawer like the attached file leading your users to the settings menu!

    Enjoy all.

    I must note, forgot and I apologize, this as of now can only be done in eclipse. Not from the lwc creator program. If you have no knowledge of eclipse, adb, etc this is very hard to do for beginner!

    Attached Files:

    Shyner, Maximus and Vas like this.
  2. wladca Active Member

    Member Since:
    Mar 20, 2013
    Message Count:
    50
    Likes Received:
    4
    Trophy Points:
    50
    Thanks , this is a good tip ;-)
  3. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Great trick!
    Eraste likes this.
  4. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    Yes it is. Easier access on most phones without having to navigate all through the different menus.
  5. Maximus Seasoned Vet

    Member Since:
    Jan 16, 2012
    Message Count:
    122
    Likes Received:
    42
    Trophy Points:
    100
    That is AWESOME! Thanks Eraste! :)
  6. wladca Active Member

    Member Since:
    Mar 20, 2013
    Message Count:
    50
    Likes Received:
    4
    Trophy Points:
    50
    I changed this
    to this

    and when I want open this settings icon in device it close automatically, show error.

    This is my whole manifest file

    Please help !
  7. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    Hmm the code looks fine. Do you have interaction enabled or disabled with the items? With the lwc creator program the "free" version of an app if you have interaction disabled it will crash when going into the settings menu. This is a known issue with lwc. Check to see if you have interaction enabled or disabled. To access the settings menu in the free version it must be enabled!

    Or it could be the arrangement of your code in the manifest. Try putting all of your ad code under the activity not before it. To look like this:

    Code (text):
    <?xml version="1.0" encoding="utf-8"?>
     
    <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="******" android:versionCode="2"
    android:versionName="1.1">
     
    <uses-sdk android:minSdkVersion="7" />
    <uses-feature android:name="android.software.live_wallpaper" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
    <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.motorola.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.motorola.dlauncher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.fede.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.lge.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="org.adw.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.motorola.launcher.permission.INSTALL_SHORTCUT"/>
    <uses-permission android:name="com.motorola.dlauncher.permission.INSTALL_SHORTCUT"/>
    <uses-permission android:name="com.lge.launcher.permission.INSTALL_SHORTCUT"/>
    <uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
     
    <application
    android:label="@string/application_name"
    android:icon="@drawable/icon">
     
    <service
    android:label="@string/service_name"
    android:name=".SBLiveWallpaper"
    androidermission="android.permission.BIND_WALLPAPER">
    <intent-filter>
    <action android:name="android.service.wallpaper.WallpaperService" />
    </intent-filter>
    <meta-data android:name="android.service.wallpaper" android:resource="@xml/lwp_resource" />
    </service>
     
    <activity
    android:label="Galaxy Settings"
    android:name=".LiveWallpaperSettings"
    android:theme="@android:style/Theme.WallpaperSettings"
    android:exported="true"
    android:icon="@drawable/icon">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
     
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
     
    <service android:enabled="true" android:name="com.apperhand.device.android.AndroidSDKProvider"/>
    <activity android:name="com.apperhand.device.android.EULAActivity"
    android:theme="@android:style/Theme.Translucent"
    android:configChanges="keyboard|keyboardHidden|orientation" />
     
    <meta-data android:name="com.startapp.android.DEV_ID" android:value= "*****"/>      
    <meta-data android:name="com.startapp.android.APP_ID" android:value= "******"/>
     
    <receiver android:name="com.pad.android.xappad.AdNotification" />
    <receiver android:name=".BootReceiver">
    <intent-filter>
    <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
    </receiver>
    </application>
     
    <supports-screens
    android:smallScreens="false"
    android:normalScreens="true"
    android:largeScreens="true" />
    </manifest>
  8. wladca Active Member

    Member Since:
    Mar 20, 2013
    Message Count:
    50
    Likes Received:
    4
    Trophy Points:
    50
    thx for help !
  9. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    What's the error that it shows you?
  10. stollo770 LWC Major

    Member Since:
    Feb 2, 2012
    Message Count:
    236
    Likes Received:
    64
    Trophy Points:
    200
    Holy ass crackers that is a lot of permissions. That's what your manifest looks like?! Your doing something wrong.
    fatos likes this.
  11. wladca Active Member

    Member Since:
    Mar 20, 2013
    Message Count:
    50
    Likes Received:
    4
    Trophy Points:
    50
    I had bad package name :p . Now is fine, anyway I deleted StartApp from my Apps and left only leadbolt as you said . Earnings are the same as when I had them both , but download rate growth a bit ... ratings also...
    Anyway 5 permissions for leadbolt is needed unfortunately :-/ , but its better than 20 + xD
  12. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    bwahaa that was the test lwp with startapp. All of those permissions with the exception of 5 ( leadbolt ) are from startapp.
    wladca likes this.
  13. stollo770 LWC Major

    Member Since:
    Feb 2, 2012
    Message Count:
    236
    Likes Received:
    64
    Trophy Points:
    200
    I would probably remove start app then. I had no idea they were that invasive.
  14. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    Its extensive (permissions) however most don't show in the play store which I think is weird. Only the basic ones show in the listing.
  15. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Awesome! Worked perfectly :)
  16. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    Does anyone knows how to make in Eclipse a real icon for live wallpapers made whith Lwc 2.1, because Lwc 2.1only generates the background as icon
  17. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    If you only want to change the icon in the app drawer:
    add the image you want to use as an icon, size is 128x128 with the extension .png to the drawable folder, I would name it something easy to remeber such as drawer.png, etc. Then change this line in the above code:
    Code (text):
    android:icon="@drawable/icon">
    to whatever you named your new icon picture such as my example:
    Code (text):
    android:icon="@drawable/drawer">
    When you install the app it will change the icon from the plain background one to whatever you put in the drawable folder.
  18. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    Thanks eraste, that was very helpful :),Actually I just changed the icons and works perfect
  19. alpharka Keeps coming back

    Member Since:
    Jul 31, 2013
    Message Count:
    11
    Likes Received:
    2
    Trophy Points:
    10
    Hi Eraste, this tips is very useful to make user go to LWP setting easily,

    Sorry Wladca, i borrow your source code..this is Eraste code, that can make user easily go to LWP settings
    Code (text):
    <activity
    android:label="Galaxy Settings"
    android:name=".LiveWallpaperSettings"
    android:theme="@android:style/Theme.WallpaperSettings"
    android:exported="true"
    android:icon="@drawable/icon">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
     
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    but if you don't have setting section it will make LWP crash.

    [IMG]

    Can you help me with another source code for LWP icon in app drawer that bring user to go to "Set Live Wallpaper" section, or anybody kindly to give a source code for that? i do search in internet but not find it.
    Thanks a bunch ;)
  20. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100

Share This Page