Spanish Alternativa a Log (Library)

carlos7000

Well-Known Member
Licensed User
Longtime User
Hola a todos

No sé si a otras personas les sucede, pero a mi la función 'log' no me funciona. Razon por la cual desarrolle mi propia librería.

Su uso es muy simple, solo debe Incluirla en su proyecto, inicializarla, guardar los datos y Listo!

La librería crea un archivo con el nombre que ud le asigne. El archivo se guarda en
Android/{nombreDelPaquete}/files

Adjunto encontrará un Zip que contiene la librería

En la carpeta 'Lib' encuentra los archivos de la librería que debe copiar a la carpeta:
C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries

Ejemplo de uso

B4X:
#Region  Project Attributes
    #ApplicationLabel: SaveLog Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim sl As SaveLog
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    sl.Initialize("log.txt", True)
    sl.ClearLog 'Eliminamos el archivo si ya existe. Es Opcional
End Sub

Sub Activity_Resume
    'Guardamos un registro en el log
    sl.Record("Este es UN registro")
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    'Guardamos otro registro en el log
    sl.Record("Este es OTRO registro")
End Sub

Saludos
 

Attachments

  • Lib.zip
    2.9 KB · Views: 309
Last edited:

bgsoft

Well-Known Member
Licensed User
Longtime User
Gracias por el aporte
 
Top