tengo un android samsung galaxy a32 quisiera saber si los telefonos android tienen…
- User
tengo un android samsung galaxy a32 quisiera saber si los telefonos android tienen funciones que permitan leer en voz alta cada vez que se recibe una notificacion
- Assistant
¡Claro que sí! Los teléfonos Android, incluidos los Samsung Galaxy como tu Galaxy A32, tienen funciones que pueden leer en voz alta las notificaciones cuando las recibes. Esto es especialmente útil si necesitas manos libres o tienes algún problema visual. Te explico las diferentes formas de activar estas funciones:
- User
usando kotlin y jetpack compose quiero escuchar las notificaciones de una applicacion especifica y luego usar sintesis de voz de google para reproducir solo una parte del texto contenidod
- Assistant
- User
Puedo hacer todo eso sin usar una ui es decir solo que funcione en segundo plano escuchar la notificacion , luego extraer el text y ese texto reproducirlo con text to speech syntesis de voz de google
- Assistant
- User
Al crear el proyecto en android studio puedo usar "empy activity" o "no activity" cual me sugieres
- Assistant
- User
para pedir permisos al usuario no es necesario la ui?
- Assistant
- User
como configuro mi manifest:
- Assistant
- User
es necesario poner también esto, por qué me subraya en rojo:
- Assistant
- User
fun requestNotificationAccess(context: Context) { val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK context.startActivity(intent) }
ese codigo lo puedo poner en el oncreate?
- Assistant
- User
al ejecutar mi app desde android studio, sale este error Activity not found
- Assistant
- User
como hacer que la notificacion persista mientras mi servicio esté activo y que tenga una opcion para detener el servicio
- Assistant
- User
este error: To call Service. startForeground(), the element of manifest file must have the foregroundServiceType attribute specified More... (Ctrl+F1) Inspection info: For targetSdkVersion >= 34, to call Service. startForeground(), the element in the manifest file must have the foregroundServiceType attribute specified.
- Assistant
- User
error other
- Assistant
El error relacionado con el valor
otherpara el atributoforegroundServiceTypeocurre cuando usas un valor incorrecto o no autorizado según la funcionalidad que tu servicio en primer plano está llevando a cabo. A partir detargetSdkVersion 34(Android 14), Android espera que definas claramente el tipo de tarea que tu foreground service realiza, y "other" no sirve como catch-all en esta versión.Este problema es una restricción que introduce Android 14 para restringir el uso inadmisible de servicios en primer plano.
Solution Workflow para Resolver Error ‘Other’
** Puedes repick flexible types knopclarify norettihautton
- User
puedo dejarlo en vacio ""
- Assistant
- User
que dice este error
- Assistant
- User
- Assistant
- User
estará bien mi manifest:
<!-- Filtrar tipos específicos de notificaciones --> <meta-data android:name="android.service.notification.default_filter_types" android:value="conversations|alerting" /> <meta-data android:name="android.service.notification.disabled_filter_types" android:value="ongoing|silent" /> </service> <service android:name=".MyForegroundService" android:permission="android.permission.FOREGROUND_SERVICE" android:exported="false"> </service> </application> - Assistant
- User
- Assistant
- User
no veo la notificacion persistente este es el Activitymain package com.myapp.yapespeak
import android.app.Activity import android.content.Intent import android.os.Bundle import android.provider.Settings
class MainActivity: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
val intent2 = Intent(this, MyForegroundService::class.java) startForegroundService(intent2) // Redirigir al usuario al menú de configuración de accesos a notificaciones val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS) startActivity(intent) // Una vez redirigido, cierra esta actividad finish() }}
- Assistant
- User
este es mi MyforegrounServce clase: package com.myapp.yapespeak
- Assistant
- User
startForeground me subraya de rojo
- Assistant
- User
al añadir android:foregroundServiceType="dataSync" todo el servicio se subraya de rojo
- Assistant
- User
foregroundServiceType:dataSync requires permission:[android. permission. FOREGROUND_SERVICE_DATA_SYNC] More... (Ctrl+F1) Inspection info: For targetSdkVersion >= 34, each foregroundServiceType listed in the element requires specific sets of permissions to be declared in the manifest. If permissions are missing, then when the foreground service is started with a foregroundServiceType that has missing permissions, a SecurityException will be thrown.
- Assistant
- User
2024-12-10 04:02:42.043 1058-1058 audit auditd E type=1400 audit(1733821362.039:166814): avc: granted { execute } for pid=20333 comm="myapp.yapespeak" path="/data/data/com.myapp.yapespeak/code_cache/startup_agents/c811a9f9-agent.so" dev="dm-47" ino=476377 scontext=u:r:untrusted_app:s0:c163,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c163,c258,c512,c768 tclass=file SEPF_SM-A325M_12_0001 audit_filtered
- Assistant
- User
setWindowBackground: isPopOver=false color=ff121212 d=android.graphics.drawable.ColorDrawable@2d76494 2024-12-10 04:03:52.012 1615-1673 NotificationService system_server E Suppressing notification from package com.myapp.yapespeak by user request.
- Assistant
- User
- Assistant
- User
desde donde llamo a redirectToNotificationSettings: este es mi mainActivity principal: package com.myapp.yapespeak
import android.app.Activity import android.content.Intent import android.os.Bundle import android.provider.Settings
class MainActivity: Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
val intent2 = Intent(this, MyForegroundService::class.java) startForegroundService(intent2) // Redirigir al usuario al menú de configuración de accesos a notificaciones val intent = Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS) startActivity(intent) // Una vez redirigido, cierra esta actividad finish() }}
- Assistant
- User
- Assistant
- User
- Assistant