File corrupted when downloading it to the phone

I do not speeak French but when I download apk with Chrome's latest update I get below image and I simply ignore it and click download anyway

2 Likes

I do the same when I get a message about "The file can be harmful" because this message is displayed for any program file. But the message I get now is different, and says "The file may be corrupted" ... But well, I must admit that the MessageBox is very similar to yours, except for the message itself.

1 Like

No. Uninstall the app. Restart your device and try again.

They could still be included in the APK.

Is this App only for your own personal use or is it going to be distributed? If it's on Android 9 and isn't going to be on Android 10+, you may be able to access the log with the File functions (need to know the file path of course).

2 Likes

I made some cleaning, changed global variables to locals, uninstalled the app, restarted the phone and reinstalled the application but got the same message. At the end, the application is running correctly; but I still have the message when downloading it to the phone.

If you upload your Project File (.aia) I can take a look at the underlying files to see if there is anything obviously untoward.

Before you started making changes (global to local), did you make a Backup? Ideally need to see the Project as it was when the warning first appeared.

Also - what happens when you run the App via the Companion?

1 Like

Sorry, I don't have a backup. Here is the aia file. I have to say the software architecture is not so good but I am new at using this platform, and did not had a lot of time to spend on this project.
According to the websites where I downloaded the extensions I use, using them via the Companion is not possible.
DernierAppel (1).aia (42.4 KB)

Download aia, compiled it as apk and when I download I only get .. Note that I test it in Xiaomi MI A1 android 9

3 Likes

Thank you for trying it. So may be the "Corrupted" message in french is just a bad traduction from the english "File might be harmful" ?

Temporarily change phone's lanquage from French to English (Unites States) in order to check it

1 Like

Well, you know how to export your Project, so please get into the habit of saving backups frequently - it will save your hair from going gray :upside_down_face:

1 Like

As suggested, I turned my phone to US English, and got only the "file might be harmful" message when downloading the application. So it seems that the problem only comes from a bad translation of messages. Thank you to anybody that helped me on this point.

1 Like

For a newbie to the software you have done well - if you continue to use App Inventor, there are some very good guides on the forum and three of the Power Users have websites with tons of handy stuff.

Tip: Set the Screen Orientation.

Tip: The number of Blocks in Screen Initialize should be kept to a minimum. Most can be put in a Procedure and called from Screen Initialize (last task in the Initialize Block).

2 Likes

That is indeed sometimes the case (The Companion is an App in itself) but often extensions do work with the Companion. On the other side of the coin, extensions often do not work in the Emulator.

Thank you. In fact, I am a computer engineer and I work with C#, but in App Inventor I did not find immediatly how to use local variables. That's why I mostly used globals which is not recommended. I am something new at App Inventor but I like it, and try to create useful programs.

There is no harm in using Globals in App Inventor - in fact, it is easier to debug the code as Globals work with 'Do It'. There are times when you may have a lot of individual pre-set values. For these, use a Block List (roughly the equivalent of C#'s List<T>).

1 Like

Yes but using globals means that they can be modified in several procedures and it's often better to use locals so they can only be modified in one procedure and are no more available in the other ones.

What I would like to find in App Inventor is something like object programming. In my App, where reading the Call Log, I find for each call :

  • Call Number
    -Call Type
    Call Duration ...
    So I would like to be able to create a Call object with Number, Type, Duration etc. as properties, so I could be able to store the information in my own objects, and not to have to use Lists of Lists and other tricks like that ... But I guess it is not so easy to represent this by blocks like those we have in App Inventor.

... that can be a bad thing, but also a good thing - depends on the purpose of the variable and the wisdom of the developer.

1 Like

It doesn't have to be a List of Lists - it can be a List where each item consists of all values for one phone number, separated with a comma or other char that would never be in a value. When an items contents need to be displayed, it can be split into a temporary use List (with the Text Split function) and from there a simple loop can display the values in Labels.