I'm using this nb6 example . I want to add a custom vibration to "Notification with Custom Sound".
I only got the custom sound without vibration. Could someone kindly tell me what went wrong?
B4X:
Sub Notification_WithCustomSound
Dim rp As RuntimePermissions
Dim folder As String = rp.GetSafeDirDefaultExternal("shared")
Dim FileName As String = "shotgun.mp3"
'copy the file to the shared folder
File.Copy(File.DirAssets, FileName, folder, FileName)
Dim n As NB6
n.Initialize("custom sound", Application.LabelName, "DEFAULT")
n.SmallIcon(LoadBitmapResize(File.DirAssets, "smiley.png", 32dip, 32dip, True))
'disable the default sound
[COLOR=rgb(226, 80, 65)]n.SetDefaults(False, True, False)[/COLOR] 'last parameter changed from True to False
'set custom sound
n.CustomSound(CreateFileProviderUri(folder, FileName))
[COLOR=rgb(235, 107, 86)]n.CustomVibrate(Array As Long(0, 1000, 1000, 1000)) 'line added'[/COLOR]
Dim Notification As Notification = n.Build("Notification with custom sound", "...", "", Me)
Notification.Notify(3)
End Sub
I only got the custom sound without vibration. Could someone kindly tell me what went wrong?
Logger connected to: samsung SM-T560NU
--------- beginning of main
SS_ART_lib : permission is absent: /data/app/b4x.example-1/base.apk
SS_ART_lib : access to SS denied
SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=b4x.example
ClassLoader referenced unknown path: /data/app/b4x.example-1/lib/arm
Class androidx.core.content.FileProvider failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
Class androidx.core.content.ContextCompat failed lock verification and will run slower.
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
common created.
Starting remote logger. Port: 32633
ThreadedRenderer.create() translucent=false
Input channel constructed: fd=59
setView = DecorView@c86f1ff[main] touchMode=true
dispatchAttachedToWindow
Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][800,1280] result=0x27 surface={isValid=true -1513101312} surfaceGenerationChanged=true
mHardwareRenderer.initialize() mSurface={isValid=true -1513101312} hwInitialized=true
<qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8916_32_LA.BR.1.2.9_RB1__release_AU (I750f7f2fa6)
OpenGL ES Shader Compiler Version: XE031.09.00.03
Build Date: 02/18/17 Sat
Local Branch:
Remote Branch: quic/LA.BR.1.2.9_rb1.12
Local Patches: NONE
Reconstruct Branch: NOTHING
Initialized EGL, version 1.4
Swap behavior 1
<qeglDrvAPI_eglCreateContext:2475>: EGL_BAD_ATTRIBUTE
KHR Debugger is Disabled - EGL_BAD_ATTRIBUTE
*** Debugger waiting for connection (0) ***
MSG_RESIZED_REPORT: frame=Rect(0, 0 - 800, 1280) ci=Rect(0, 24 - 0, 0) vi=Rect(0, 24 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -1513101312}
Starting input: tba=android.view.inputmethod.EditorInfo@440f8b8 nm : b4x.example ic=null
startInputInner - mService.startInputOrWindowGainedFocus
Input channel constructed: fd=64
Input channel constructed: fd=65
setView = android.widget.LinearLayout{c90c9f6 V.E...... ......I. 0,0-0,0} touchMode=true
Text: Xait in android.widget.Toast$TN@17321f7
Starting input: tba=android.view.inputmethod.EditorInfo@e68e864 nm : b4x.example ic=null
dispatchAttachedToWindow
After accept
Relayout returned: oldFrame=[0,0][0,0] newFrame=[256,1172][543,1216] result=0x27 surface={isValid=true -1808089088} surfaceGenerationChanged=true
MSG_RESIZED_REPORT: frame=Rect(256, 1172 - 543, 1216) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
*** Debugger waiting for connection (1) ***
Copying updated assets files (4)
*** Service (starter) Create ***
** Service (starter) Start **
dispatchDetachedFromWindow
Input channel destroyed: fd=65
** Activity (main) Create, isFirst = true **
setTypeface with style : 0
initGoToTop
** Activity (main) Resume **
Relayout returned: oldFrame=[0,0][800,1280] newFrame=[0,0][800,1280] result=0x1 surface={isValid=true -1513101312} surfaceGenerationChanged=false
onsize change changed
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
Background sticky concurrent mark sweep GC freed 67698(2MB) AllocSpace objects, 4(80KB) LOS objects, 81% free, 2MB/14MB, paused 5.862ms total 70.882ms
--------- beginning of main
SS_ART_lib : permission is absent: /data/app/b4x.example-1/base.apk
SS_ART_lib : access to SS denied
SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=b4x.example
ClassLoader referenced unknown path: /data/app/b4x.example-1/lib/arm
Class androidx.core.content.FileProvider failed lock verification and will run slower.
Common causes for lock verification issues are non-optimized dex code
and incorrect proguard optimizations.
Class androidx.core.content.ContextCompat failed lock verification and will run slower.
Class anywheresoftware.b4a.BA failed lock verification and will run slower.
common created.
Starting remote logger. Port: 32633
ThreadedRenderer.create() translucent=false
Input channel constructed: fd=59
setView = DecorView@c86f1ff[main] touchMode=true
dispatchAttachedToWindow
Relayout returned: oldFrame=[0,0][0,0] newFrame=[0,0][800,1280] result=0x27 surface={isValid=true -1513101312} surfaceGenerationChanged=true
mHardwareRenderer.initialize() mSurface={isValid=true -1513101312} hwInitialized=true
<qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8916_32_LA.BR.1.2.9_RB1__release_AU (I750f7f2fa6)
OpenGL ES Shader Compiler Version: XE031.09.00.03
Build Date: 02/18/17 Sat
Local Branch:
Remote Branch: quic/LA.BR.1.2.9_rb1.12
Local Patches: NONE
Reconstruct Branch: NOTHING
Initialized EGL, version 1.4
Swap behavior 1
<qeglDrvAPI_eglCreateContext:2475>: EGL_BAD_ATTRIBUTE
KHR Debugger is Disabled - EGL_BAD_ATTRIBUTE
*** Debugger waiting for connection (0) ***
MSG_RESIZED_REPORT: frame=Rect(0, 0 - 800, 1280) ci=Rect(0, 24 - 0, 0) vi=Rect(0, 24 - 0, 0) or=1
MSG_WINDOW_FOCUS_CHANGED 1
mHardwareRenderer.initializeIfNeeded()#2 mSurface={isValid=true -1513101312}
Starting input: tba=android.view.inputmethod.EditorInfo@440f8b8 nm : b4x.example ic=null
startInputInner - mService.startInputOrWindowGainedFocus
Input channel constructed: fd=64
Input channel constructed: fd=65
setView = android.widget.LinearLayout{c90c9f6 V.E...... ......I. 0,0-0,0} touchMode=true
Text: Xait in android.widget.Toast$TN@17321f7
Starting input: tba=android.view.inputmethod.EditorInfo@e68e864 nm : b4x.example ic=null
dispatchAttachedToWindow
After accept
Relayout returned: oldFrame=[0,0][0,0] newFrame=[256,1172][543,1216] result=0x27 surface={isValid=true -1808089088} surfaceGenerationChanged=true
MSG_RESIZED_REPORT: frame=Rect(256, 1172 - 543, 1216) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1
*** Debugger waiting for connection (1) ***
Copying updated assets files (4)
*** Service (starter) Create ***
** Service (starter) Start **
dispatchDetachedFromWindow
Input channel destroyed: fd=65
** Activity (main) Create, isFirst = true **
setTypeface with style : 0
initGoToTop
** Activity (main) Resume **
Relayout returned: oldFrame=[0,0][800,1280] newFrame=[0,0][800,1280] result=0x1 surface={isValid=true -1513101312} surfaceGenerationChanged=false
onsize change changed
ViewPostImeInputStage processPointer 0
ViewPostImeInputStage processPointer 1
Background sticky concurrent mark sweep GC freed 67698(2MB) AllocSpace objects, 4(80KB) LOS objects, 81% free, 2MB/14MB, paused 5.862ms total 70.882ms