Extension: Notification, run application. Background. Foreground. Run other Thunkable app


#1

Hi friend,

this is a new extension about Notifications and run applications.
The Notifications work properly with the Services, App Inventor yet doesn’t works with Services but we can try Notifications.

In this extension we have several blocks:

NotificationApp (dataUri) —> We can trigger a Notification, touch on it when we receive it and run an Application.
NotificationAppInventor (activityPackage) --> We can trigger a Notification and run an installed “AppInventor” or Thunkable application.
Example: appinventor.ai_juananton1991.p193B_gif_animado
Example: com.thunkable.android.juananton1991.p193B_gif_animado

StartApp (dataUri) —> Run directly an installed application (without notification).
StartApp (dataUri = empty) —> Run an setting android app. Set Property Intent, example: android.settings.APPLICATION_SETTINGS
Example settings: http://kio4.com/appinventor/19C_activystarter_configuracion.htm
Example settings: https://developer.android.com/reference/android/provider/Settings.html
StartAppInventor (activityPackage) —> Run directly an installed ‘AppInventor’ or Thunkable application (without notification).
Example: appinventor.ai_juananton1991.p193B_gif_animado
Example: com.thunkable.android.juananton1991.p193B_gif_animado

ToBackground
ToForeground (works when app is installed) (if app is “very asleep” doesn’t trigger.)

ScreenOnAcquire.
ScreenOnRelease use this code: https://developer.android.com/training/scheduling/wakelock.html

PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, “MyWakelockTag”);
wakeLock.acquire();

Notification (signal) and NotificationSignal event:
Notification (signal) trigger an Notificacion, when touch on it, get signal (Example with Bluetooh)

extensionnotificacion6


extensionnotificacion
extensionnotificacion7

  • Hola amigos, aunque las Notificaciones funcionan principalmente con los Servicios y App Inventor aún no los admite, podemos utilizarlas y comprobar su funcionamiento.

  • En esta extensión vuelvo a utilizar el Temporizador para retrasar la aparición de la Notificación.

  • Mediante los bloques podemos lanzar Notificaciones y cuando el usuario la pulse ejecutar una aplicación que tengamos instalada en nuestro móvil. También podemos ejecutar aplicaciones de App inventor y Thunkable.

  • Hay otros bloques para ejecutar las aplicaciones sin necesidad de utilizar las Notificaciones.

  • También podemos lanzar aplicaciones del Android, como las que vemos en:
    http://kio4.com/appinventor/19C_activystarter_configuracion.htm

  • Hay otros bloques que podemos probar, para que funcione algunos de ellos es necesario instalar la aplicación: ToBackground, ToForegroun, ScreenOnAcquire, ScreenOnRelease

  • Puedes ver el tutorial completo en:
    http://kio4.com/appinventor/291B_extension_notificacion.htm

Aquí están los archivos:
com.KIO4_Notification.aix (17.1 KB)
p191B_notificacion_ejecutar.aia (25.9 KB)

Saludos.


Arduino - Bluetooth HC-06 - Notification. Messages
#2

Well Done bro. Nice and useful extention


#3

Great extension. However, after I install your aia tutorial and clicked on Button4, (Write number of seconds and this app will do a ToBackground and a ToForeground) this happend:


#4

Thank you for try Hassan.

ToForeground (works when app is installed) (if app is “very asleep” doesn’t trigger.)

I have try with Android 5.1 and works for me. Perhaps doesn’t work with others versions.

I have fixed code p191B_notificacion_ejecutar.aia


#5

App is install but ToBackground doesn’t work. (Runtime Error)
ToForeground works fine.

Device: honer 6x
Android Version: 7.0


#6

In this post I have put a tutorial on sending information between the Arduino and Android via Bluetooth. When a message arrives to Android, a Notification is issued. It uses blocks NotificationSignal.

https://community.thunkable.com/t/arduino-bluetooth-hc-06-notification-messages/14963

Others tutorials about Arduino and Bluetooth:
http://kio4.com/appinventor/index.htm#bluetooth


#7

Thanks for the tutorial.

I would like to have a custom notification icon and suppress sound.


#8

With this version you can suppress sound.
In Screen1 . Icon you can upload a icon image size 48x48
When you install app, Notification get that icon.

com.KIO4_NotificationS.aix (17.6 KB)

https://www.google.es/search?q=48x48+icon&biw=1164&bih=560&tbm=isch&source=lnt&tbs=isz:ex,iszw:48,iszh:48


#9

Me sale Error from Companion: Permission Denial: moveTaskToFront() from pid=27207, uid=10109 requires android.permission.REORDER_TASKS


#10

Try after building the app - not in companion. See if that error stops.


#11

@menfhis, como bien dice @mannankhanabdul, instala la aplicación para ver si funciona esos bloques. De todos modos algunos de esos bloques no funcionan en versiones recientes de Android.