Go to file
Mikhail Chabanov bd114aef26 Gradle version updated 2015-01-29 16:37:06 +03:00
gradle/wrapper Gradle version updated 2015-01-29 16:37:06 +03:00
screenshots 1.0 2013-11-15 21:49:25 +08:00
src/main New configuration added to build project using gradle build system 2014-10-09 19:51:48 +04:00
target 1.0 2013-11-17 21:56:39 +08:00
.gitignore New configuration added to build project using gradle build system 2014-10-09 19:51:48 +04:00
LICENSE Modify LICENSE 2014-06-12 09:54:28 +08:00
README.md New configuration added to build project using gradle build system 2014-10-09 19:51:48 +04:00
ShortcutBadger.iml Add Lincense 2014-06-12 09:51:56 +08:00
build.gradle Gradle version updated 2015-01-29 16:37:06 +03:00
gradlew New configuration added to build project using gradle build system 2014-10-09 19:51:48 +04:00
gradlew.bat New configuration added to build project using gradle build system 2014-10-09 19:51:48 +04:00
pom.xml 1.0 2013-11-15 20:33:52 +08:00
proguard-rules.pro Gradle version updated 2015-01-29 16:37:06 +03:00

README.md

ShortcutBadger:

The ShortcutBadger makes your Android App showing the count of unread messages as a badge on your App shortcut!

Currently support launchers:

Android native Launcher
ScreenShot

Sony Home Launcher
ScreenShot

Samsung Touchwiz
ScreenShot

LG Launcher
ScreenShot

HOW TO ASSEMBLE

Run 'gradlew assemble' to get ShortcutBadger.aar in directory ./build/outputs/aar

Run 'gradlew jarRelease' to get ShortcutBadger.jar in directory ./build/libs

HOW TO USE


1. Download the jar file named ShortcutBadger-X.X.jar in the target folder.
2. Add the jar file into the folder "lib" in your Android project.
3. Do not forget to add these permissions to your Androidmanifest.xml.

    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
    <uses-permission android:name="com.htc.launcher.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
    <uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
    <uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>


4. Add the codes below:

    int badgeCount = 1;
    try {
        ShortcutBadger.setBadge(getApplicationContext(), badgeCount);
    } catch (ShortcutBadgeException e) {
        //handle the Exception
    }


5. If you want to remove the badge, just set the badgeCount as 0.



LICENSE


    Copyright 2014 Leo Lin
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

Email: leolin310148@gmail.com