AppDevs: Use MiLaunchers NotificationCircles

Discussion in 'Mi General' started by M1cha, Jul 7, 2013.

  1. Miui Launcher has these red notification circles at the icons which shows a number.
    Apps like Updater or Messaging use this to inform u about the amount of notification they have for u.

    I reverse engineered the code and found out that u can implement this in your App very easily:
    Code:
    Intent i = new Intent("android.intent.action.APPLICATION_MESSAGE_UPDATE");
    i.putExtra("android.intent.extra.update_application_component_name", "com.launchertest/.MainActivity");
    i.putExtra("android.intent.extra.update_application_message_text", "5");
    this.sendBroadcast(i);
    "android.intent.extra.update_application_component_name" gets the LauncherActivity in the format "package/.activity"
    "android.intent.extra.update_application_message_text" contains the text which will be displayed inside the red circle. Yes it's a string not a number u can write to it whatever you want but it's size is limited(to 3 as far as I know, he will automatically cut it).

    You can use this code even if your app isn't for MIUI only because Broadcasts do not raise exceptions. If there is noone to receive them it doesn't matter.

    Thx to Medina for the idea :)
     
    Pukos, DeepSpace, Tiltowait and 6 others like this.
  2. Medina

    MedinaMembers

    Dec 27, 2011
    245
    216
    65
    I saw him do it and He is a master! This guy is insane!!
    I'm glad we have you my friend.
     
    MSephiroth and M1cha like this.
  3. hadron

    hadronMembers

    Sep 23, 2012
    640
    169
    82
    Male
    It's great man. Thanks

    Sent from my MI 2 using Tapatalk 4 Beta
     
  4. Coldbird

    ColdbirdMembers

    Mar 1, 2013
    347
    100
    65
    Male
    Awesome discovery. Will put it to good use.

    Gesendet von meinem MI 2 mit Tapatalk 4 Beta
     
  5. xeGox

    xeGoxMembers

    Feb 26, 2013
    387
    47
    60
    Male
    I searched this for a long time...
    But... How could we do for famous app like playstore, whatsapp, Facebook, Skype, hangout, etcetc?

    Sent from Xiaomi Mi-4g ( the "g" is for graveyard not for great )...with tapatalk 26°
     
  6. Coldbird

    ColdbirdMembers

    Mar 1, 2013
    347
    100
    65
    Male
    Best way to get this into apps like Facebook is via xposed framework or wsm.

    Sent from my GT-I9505 using Tapatalk
     
    xeGox likes this.
  7. DeepSpace

    DeepSpaceMembers

    Nov 30, 2013
    236
    36
    50
    Male
    Damn M1cha. Nice find! Thanks man.
     
  8. xeGox

    xeGoxMembers

    Feb 26, 2013
    387
    47
    60
    Male
    Hoping to be useful for @BurgerZ

    Sent from Xiaomi Mi-4g ( the "g" is for graveyard not for great )...with tapatalk 26°
     
  9. Hieron

    HieronMembers

    Aug 11, 2013
    88
    15
    18
    Male
    #9Hieron,Feb 26, 2014
    Last edited: Jul 28, 2014
    .
     

Share Our Site