Proyecto con TinyDB no carga el aplicativo .apk en el celular ni tablet

Saludos, tengo un proyecto que es básicamente guardar los datos de unos campos de texto, al momento de ejecutarlos en la web funciona normal, pero cuando genero el .apk y lo instalo en el celular o la table queda procesando y no se carga, es un programa bastante pequeño para registrar las densidades del suelo.

Agradezco mucho su ayuda. :+1:

densidades_pedro.aia (9.7 KB)

Welcome!

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun

This type of construct does not work well in AI2:

Global variable initialization only happens before the text boxes have had a chance to be filled, so that would cause a divide by zero or a math error, depending on what you had left in them in the Designer.

Instead of a global init variable, use a value function with that same name, that you can call at run time. Add Is A Number checks to run before attempting any math, and zero checks before attempting division. Use Notifiers to announce bad inputs.

This version works on my emulator, after cleaning up the global inits.
densidades_pedro.aia (9.6 KB)

Why does the limpiar(?) button delete everything from TinyDB, while you have no button just to clear all the input fields?

If you still have a problem running this built on a fresh device, you might need help with file permissions.

1 Like

Gracias ABG!!!!! :+1: esa era la solución, les dejo un poco más de detalle para los que les pase igual: cuando probaba la aplicación en el emulador de mi celular conectado a la página funcionaba normal, pero cuando lo instalaba en mi celular con apk quedaba la pantalla en gris, es decir, no iniciaba.
Para lo que dice ABG del botón para limpiar es porque estaba probando, pero ese botón lo voy a modificar para que solo me borre los cuadros de texto y me deje la base son modificaciones.

Otro problema que tengo y que quiero solucionar es que mi celular no guarda en /dados.csv, el guarda en /android/data/edi.mit.appinventor.aicompanion3/datos.cvs aunque ya le especifiqué que me lo guarde en /datos.csv, estuve leyendo en el foro y veo que hay otros con el mismo problema, pero no le dan solución, solo dicen que es la versión de android, en mi caso lo use en el celular y en la table, en el celular no pude acceder al directorio, y en la tablet si, yo solo quiero distribuir la aplicación gratuitamente, pero el fuerte es poder exportar los datos, pues es para ahorrarle tiempo al que los procesa.

Igual se le agredace a ABG por su ayuda, excelente.

Android file permissions ae aggravating.

I like the sharing component for exporting text files to other applications without their feet touching the ground.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun