AI2 companion for my apps stops suddenly without any error message

You shouldn't really use the Companion when testing BLE. Compile an APK and install it. However, first of all fix all of your unconnected Blocks (see the 'Show Warnings' bottom left of Blocks work area) and fix your ErrorOccurred Block to:

  1. Report all values and
  2. Set the values in a Label that you can Screenshot:

Bear in mind that Screen1 is the 'King' of the Screens.

Screen HOME: Button Start will create an additional Screen1 !

Just do this:
Snap1

Similar issue in the History Screen.

I note that you have no BLE permissions requested. What version of Android is the App on? What is the Bluetooth version number of your Smartphone? What is the Make and Model of your microcontroller? Seeed XIAO ??????

Has this file been compressed? I cannot load it to study the code.

okay i'll remember it. thank you :smile: :clap:

ahh i see, i build screen1 first coz that's the point to monitor data. but when I open the app, I want to make ScreenHOME the first thing that appears

That's perfectly fine - just make sure you transition between Screens properly.

EDIT: You could of course make Screen1 the home screen and that would be better. Build a new Project by copy-paste from the current project.

1 Like

Hi, I'm back sorry. I can't delete the data in the database as I want. Do I have to pay for the Google Sheets API service? I want to delete all data when clicking "reset"

Once you start using the AI2 Spreadsheet component to update sheets, you need to build and include a .json credentials file in the Media folder and in the Spreadsheet component attributes.

There are links to this procedure in

2 Likes

yeah, but I have to use a Google developer account, isn't it possible if I use a regular Google account and spreadsheets? Can you give me an example of what I should do. I don't have Google Developer account

I don't think I have a Google developer account.

They certainly don't have any credit card numbers for me.

But I do have a free gmail account.

That's all I have used, following this link:

1 Like

okay, i got my json keys. and ths is my block for reset my data. so which block should i use next? i must input my json keys?

image

Follow the AI2 setup near the end of

It has grown since I last saw it.

1 Like

This is more to the point:
http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/other/googlesheets-api-setup.html

1 Like

HOO thank you, it works :clap: :star_struck:

but sorry.. when i click "reset" in my apps, the data in spreadsheets will empty. but an error appears when I start retrieving the data and want to display it. iis it because i deleted my database? what should i do?


Show us where you do your math + operations.

i do my operation in arduino ide, and i send the result to database

image
image

this is my aia n code

Alicia_TinyML_DataLogger_ext.aia (411.3 KB)
NEW_XIAO_BLE_ACC_Data_Logger.ino (10.6 KB)


blocks

You had blanks in that column, and Ai2 math blocks hate blanks.

These draggable blocks should filter out the blanks.

what is NZ? what that mean? what should I enter there? I call columns on a spreadsheet

this is my database

NZ is a value procedure I just coded to take a value, check if it is a number, and return 0 if it is not a number.

I named it after a common spreadsheet function
https://www.google.com/search?q=nz%28%29

See
http://www.appinventor.org/bookChapters/chapter21.pdf
from the free book at
http://www.appinventor.org/book2

the application works fine in reading and displaying the previous "distance" value, but when I delete the value in the database. the function is different and there are errors. I think something went wrong when calling the data, after the value in the database was deleted. but idk what its is