Well, it's been several versions since the installer has been offered that way, for example, if someone wanted to use the package offered by mit, they would only have to put it in this field.
Is it possible to customize the com.ai2offline.username in our activities an such to be the same a the PackageName flag?
Thus if you set your package name to jm.com.linuxras, main would become jm.com.linuxras.Screen1
I know that would require that you collect the package name at the same time you collect the Project name. The way Koduler does it. I would be willing to make it happen with some pointers to where to look.
Last edit: Andrew Williams 2022-11-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Kodular uses io.kodular.email.appname in its activities.
Niotron uses com.niotron.email.appname in its activities.
AI2Offline uses com.ai2offline.email.appname in its activities.
Why do it differently?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I understand that many people wont care but some would certainly want their own org based package id for throughout their own app.
When you call an activity from google ie: com.google.mail.SEND or whatever that represents them not the IDE they coded the app with.
Just makes sense to me and I would want that.
The code is below and I will maintain it as patches or github, the choice is yours.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After much code diving in the system this is what I have come up with so far.
This seems to all happen in/from the NewYoungAndroidProjectWizard.java dialog box.
Added checkbox under "Project Name:" with label "Use Default Package" checked by default if left checked it will proceed as usual.
Added TextBox under "Use Default Package" with label "App Package" if Use Default is unchecked you are required to set a valid Android package id there, it is of course validated and should catch most of the invalid ones.
With this patch you should be able to just leave the old AppPackage empty and it would just the one set when the project is created.
Example: jm.com.linuxras
Would make Screen1 resolve tp jm.com.linuxras.Screen1 etc etc....
TODO: add the new messages to the rest of the translations (would need contribution here)
My internet is acting up and I am unable to download the appinventor sub modules to do a full build and test but I know what part builds fine.
Ramiro please try this patch and let me know how it goes, you may need to increase the height of the dialog however it looks like it could hold two fields :)
Morning all,
After some more digging last night I found that while this patch will work just fine for creating projects the moment you export, copy or import a project it will revert to the internal one.
This tells me that a default package id needs to be set at the user settings level that way the stupid server-side code can grab it just like the userId and userEmail.
I don't know about you guys but I absolutely hate seeing a program as dynamic as this with hard coded values, frankly the system should prompt you for a package id vs overwriting whatever I had in my file with its own just to be lazy.
Ramiro if you are willing to add the changes I will get this all coded up with the least effect on normal operation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for high-jacking this thread but since I started here I will continue if you guys don't mind.
The patch I sent earlier would set the Custom package for the new project but not when you export/import the project.
Attached in a comprehensive patch to allow you to always set a package when you:
1. Create new Project
2. Copy Project via "Save Project as"
3. Import Project from computer via *.aia files
This patch affects both client and servlet side of the code and I have tried to make it easy to maintain.
NOTE: The system expects the last octet of the package to be the Project Name so remember to add that to what you type (I thought that a better option that appending it and giving you results you cant see). Removing the Project Name octet is just how the system works and is not part of this patch.
Example Usage: Project Name "Chat"
packageName: com.example.Chat
activity: com.example.Screen1
package: com.example
these changes work fine when creating a new project, however when using a custom package in copy project(save as) and import project the apk doesn't open.
I don't have the bandwidth right now to pull another copy to diff against.
Edit: git diff to the rescue the attached patch is changes since the last so apply over the old.
I'll be making fixes only on Github going forward, better tools there than sf
That works when importing a project, but I still get the error on Save project as.
copy a project to save project as, build the apk and check that it works, whether i change the package or not.
greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ramiro That works here.
I have a project open I do File-Save Project As, I give it a name hit OK, new project opens Then I click Build->Android App (apk). Build just fine: sdb install filename.apk to my phone loads just fine too.
One thing I did run into when I Import a project file you need to save before trying to build, but unless that's an existing but I can't see what I did to cause that behavior.
Last edit: Andrew Williams 2022-12-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Where did the Custom Package Name function go during installation ? How can I change the package name now?
Well, it's been several versions since the installer has been offered that way, for example, if someone wanted to use the package offered by mit, they would only have to put it in this field.
Is it possible to customize the com.ai2offline.username in our activities an such to be the same a the PackageName flag?
Thus if you set your package name to jm.com.linuxras, main would become jm.com.linuxras.Screen1
I know that would require that you collect the package name at the same time you collect the Project name. The way Koduler does it. I would be willing to make it happen with some pointers to where to look.
Last edit: Andrew Williams 2022-11-27
Kodular uses io.kodular.email.appname in its activities.
Niotron uses com.niotron.email.appname in its activities.
AI2Offline uses com.ai2offline.email.appname in its activities.
Why do it differently?
I understand that many people wont care but some would certainly want their own org based package id for throughout their own app.
When you call an activity from google ie: com.google.mail.SEND or whatever that represents them not the IDE they coded the app with.
Just makes sense to me and I would want that.
The code is below and I will maintain it as patches or github, the choice is yours.
Can I get a yay or nay or implementing this, I'm most the way there already just need some pointers to your changes.
After much code diving in the system this is what I have come up with so far.
This seems to all happen in/from the NewYoungAndroidProjectWizard.java dialog box.
Added checkbox under "Project Name:" with label "Use Default Package" checked by default if left checked it will proceed as usual.
Added TextBox under "Use Default Package" with label "App Package" if Use Default is unchecked you are required to set a valid Android package id there, it is of course validated and should catch most of the invalid ones.
With this patch you should be able to just leave the old AppPackage empty and it would just the one set when the project is created.
Example: jm.com.linuxras
Would make Screen1 resolve tp jm.com.linuxras.Screen1 etc etc....
TODO: add the new messages to the rest of the translations (would need contribution here)
My internet is acting up and I am unable to download the appinventor sub modules to do a full build and test but I know what part builds fine.
Ramiro please try this patch and let me know how it goes, you may need to increase the height of the dialog however it looks like it could hold two fields :)
Morning all,
After some more digging last night I found that while this patch will work just fine for creating projects the moment you export, copy or import a project it will revert to the internal one.
This tells me that a default package id needs to be set at the user settings level that way the stupid server-side code can grab it just like the userId and userEmail.
I don't know about you guys but I absolutely hate seeing a program as dynamic as this with hard coded values, frankly the system should prompt you for a package id vs overwriting whatever I had in my file with its own just to be lazy.
Ramiro if you are willing to add the changes I will get this all coded up with the least effect on normal operation.
Sorry for high-jacking this thread but since I started here I will continue if you guys don't mind.
The patch I sent earlier would set the Custom package for the new project but not when you export/import the project.
Attached in a comprehensive patch to allow you to always set a package when you:
1. Create new Project
2. Copy Project via "Save Project as"
3. Import Project from computer via *.aia files
This patch affects both client and servlet side of the code and I have tried to make it easy to maintain.
NOTE: The system expects the last octet of the package to be the Project Name so remember to add that to what you type (I thought that a better option that appending it and giving you results you cant see). Removing the Project Name octet is just how the system works and is not part of this patch.
Example Usage: Project Name "Chat"
packageName: com.example.Chat
activity: com.example.Screen1
package: com.example
Last edit: Andrew Williams 2022-12-03
these changes work fine when creating a new project, however when using a custom package in copy project(save as) and import project the apk doesn't open.
Last edit: Ramiro Prieto Alvarez 2022-12-11
Good catch there, its been fixed.
I have my changes in a fork on github now please check there.
https://github.com/linuxras/appinventor-sources
I don't have the bandwidth right now to pull another copy to diff against.
Edit: git diff to the rescue the attached patch is changes since the last so apply over the old.
I'll be making fixes only on Github going forward, better tools there than sf
Last edit: Andrew Williams 2022-12-11
That works when importing a project, but I still get the error on Save project as.
copy a project to save project as, build the apk and check that it works, whether i change the package or not.
greetings
Ramiro That works here.
I have a project open I do File-Save Project As, I give it a name hit OK, new project opens Then I click Build->Android App (apk). Build just fine: sdb install filename.apk to my phone loads just fine too.
One thing I did run into when I Import a project file you need to save before trying to build, but unless that's an existing but I can't see what I did to cause that behavior.
Last edit: Andrew Williams 2022-12-11
the changes were applied to the latest version of ai2offline.