Hi....
I'm trying to use Badge counter in my app (show number above the application icon), But I've a problem with Sony Z Ultra ...
In Samsung devices I used this code ( work perfectly):
For Sony I tried this code : (actually I tried to convert it to B4A but without success)
https://stackoverflow.com/questions...nt-to-application-icon-on-sony-xperia-devices
Test 1 :
Test 2 :
Permissions :
AddPermission("com.sec.android.provider.badge.permission.READ")
AddPermission("com.sec.android.provider.badge.permission.WRITE")
AddPermission("com.sonyericsson.home.permission.BROADCAST_BADGE")
AddPermission("com.sonyericsson.home.permission.RECEIVE_BADGE")
But did not succeed .
So Where is wrong ?
Thank you .
I'm trying to use Badge counter in my app (show number above the application icon), But I've a problem with Sony Z Ultra ...
In Samsung devices I used this code ( work perfectly):
B4X:
Try
Dim cv As ContentValues
cv.Initialize
cv.PutString("package", Application.PackageName)
cv.PutString("class", Application.PackageName & ".main")
cv.PutInteger("badgecount", count)
Dim u As Uri
u.Parse("content://com.sec.badge/apps")
cr.Insert(u, cv)
Catch
End Try
For Sony I tried this code : (actually I tried to convert it to B4A but without success)
https://stackoverflow.com/questions...nt-to-application-icon-on-sony-xperia-devices
Test 1 :
B4X:
Dim intent As Intent
Try
Dim u As Uri
u.Parse("content://com.sec.badge/apps")
intent.Initialize("com.sonyericsson.home.action.UPDATE_BADGE","")
'intent.Initialize(intent.ACTION_APPWIDGET_UPDATE,"") (test it too)
intent.Action = "com.sonyericsson.home.action.UPDATE_BADGE"
intent.putExtra("com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME", Application.PackageName & ".MainActivity")
intent.putExtra("com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE", True)
intent.putExtra("com.sonyericsson.home.intent.extra.badge.MESSAGE", "11")
intent.putExtra("com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME", Application.PackageName)
StartActivity(intent)
'Dim jo As JavaObject
'jo.InitializeContext
'jo.RunMethod("sendBroadcast", Array(intent)) (test it too)
Catch
End Try
Test 2 :
B4X:
Try
Dim cv As ContentValues
cv.Initialize
cv.PutString ("com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME" , Application.PackageName)
cv.PutString ("com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME", Application.PackageName & ".MainActivity")
cv.PutString("com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE" , True)
cv.PutString("com.sonyericsson.home.intent.extra.badge.MESSAGE", "10")
Dim u As Uri
u.Parse("content://com.sec.badge/apps")
cr.Insert(u, cv)
Catch
End Try
Permissions :
AddPermission("com.sec.android.provider.badge.permission.READ")
AddPermission("com.sec.android.provider.badge.permission.WRITE")
AddPermission("com.sonyericsson.home.permission.BROADCAST_BADGE")
AddPermission("com.sonyericsson.home.permission.RECEIVE_BADGE")
But did not succeed .
So Where is wrong ?
Thank you .