Hello Lucasredpianos
Do you mean TinyDb?
It is too easy to tap a button more times than intended so you should design your App to save all data as required on one tap (click).
Tell us more about your Application:
- Total number of values to be stored?
- How does the User input the Values? Via a TextBox?
O app tem como função cadastrar clientes, estou usando uma lista para cadastrar seus nomes e dados pessoais e armazenando no AsteroidDb, como o tinywebdb é limitado e para testes estou usando o asteroid onde posso guardar meus dados no meu próprio banco do heroku. Os dados do clientes são inseridos através de caixas de texto, e posso visualizar os nomes cadastrados através do listview.
I see, AsteroidDb is an Extension based on TinyWebDb:
https://community.appinventor.mit.edu/t/asteroiddb-a-database-service-for-ai2-based-on-tinywebdb
It actually has the same limitations as TinyWebDb in terms of how the data is stored.
If you have a large amount of data to store (More than, say, 20 customers), it would be better to use a relational database. Your web server most likely already has a database service.
So the principle for your GUI should be:
- User enters data in TextBoxes
- User taps a Submit Button
- App checks that all required information has been entered (optional)
- If required information has not been entered, App pops-up a Notifier
- If required information has been entered, App saves to AsteroidDb
Your code can collect the data from each TextBox and save that value as a single tag whose title is the same as the TextBox, post-fixed with a unique customer number.
Example code (there are many ways to do the same thing):
Primeiramente obrigado pela atenção!
será que você poderia enviar o arquivo aia desse projeto que você fez? Para que eu possa analizar melhor!
Parace que é isso que eu quero, ele está armazenando quantos clientes em cada TAG?
Hi Lucas
SaveValuesToAsteroidDb.aia (4.7 KB)
In my example, each tag holds 1 data item. You could if you wish change that such that one tag holds one Customer Record, where one Customer Record consists of several data items as a String, separated by bar Characters (|). It all depends on how many records there needs to be. If more than around 20 records (20 Customers), using a real relational database would be much better. See Taifun's extension.
Não consegui extrair o que eu quero ainda. O AsteroidDb é separado em linha e coluna, TAG e valor, eu quero armazenar por exemplo 2 valores em cada TAG, isso me possibilitaria 20.000 registro ao invés de 10.000, certo?
Vou mandar aqui um projeto .aia, será que vc conseguiria analisar ele e ver o que pode ser feito para eu conseguir fazer meu armazenamento como descrito a cima? Desde já agradeço.
twdbdemoV11_revised.aia (1.6 MB)
Hi Lucas
You should have added this post to your original Forum Topic.....
In my opinion, AsteroidDb, which is a simple XML file, does not suit the purpose of your App. You can contact the developer of AsteroidDb and ask if it can perform the functions you need on 20,000 records. Since you have to host the database on a website/server, an SQL database might be a better choice.
Ah, I see your previous topics have been closed:
Tá certo chris, muito obrigado pela atenção.
Hi Lucas
Do you have a website/server? Usually a hosted website/server has other things as part of the package - often that includes support for a database.
My colleague TimAI2 is an expert in online storage solutions so I have asked him if he can help you.
Criei um conta no heroku, que é o servidor recomendado para o AsteroidDb. Aí nele tem a versão Premium caso deseja mais armazenamento.
O que o TimA12 respondeu?
OK. If the records are only text, even a large database does not need much storage space.
I expect Tim is asleep - it is 03:28 am in the UK
Kk, realmente, é sim, apenas texto, e uma imagem para cada cadastro.
10,000 images?
Extensive! If each person registered will provide a photo, that makes the database larger. So, I really urge you to show this to the AsteroidDb developer and ask them to confirm that everything you need to do (add, delete, search) with 10,000 records (10,000 people) can be done efficiently, securely and quickly.
SQL databases have been established for years and are used by millions......
Ok,eu vou procurar saber, muito
obrigado.