Ok, let’s do this: I’m going to try and make a Q&A with the extensions developers who can and want to answer super basic questions, just like “What is this?”
This is not just for me but for everyone who is not very knowledgeable in this subject. So even if I know something, I will ask it anyways to state it here and not skip anything for the ones who doesn’t know it. If you are willing to answer questions, please be prepared to explain in detail whatever you want to explain.
For an easier understanding, I will continue with the next questions after the current one is answered. So please if you have questions about something that is not being discussed yet, WAIT until we get there, so everyone is on the same page and has the same chance of learning.
The Code Editor.
By @Ken’s advice, We will use the AppyBuilder Code Editor, which I understand is all I need to start coding, instead of using Eclipse or something else. I also understand this doesn’t require for me to download the App Inventor source code. Is that right?
Do we need to create an account or the same account for AppyBuilder will log me in?
After you create a new AIX project, you have the template loaded and these are the first lines of the code you will see:
* Created with the AppyBuilder Code Editor.
* This is a template for basic Extension.
* Modify this template to customize your extension.
* **** NOTE: DO NOT use a package name.
* **** The package name will be created for you automatically.
* **** Adding a package name will cause a compile error
This is just a comment and doesn’t do anything. It only documents the code for other people who opens it.
You can create comments by starting the line with /* and ending it with */. Everything in between those will be ignored by the compiler.
My question here is What does it mean with DO NOT USE A PACKAGE NAME?
Adding to what @vknow360 said, one of the most common usages of package name is to prevent naming conflicts between different classes (for simpler understanding, think of classes to be extensions).
Imagine having two different extensions with the same name, say ‘MyExtension’. Now if you build your project containing both of these extensions, the build process will fail as the compiler won’t be able to resolve the conflicts that have been arisen because of the same name of the classes, or basically extensions. This is where package names help compilers distinguish between different classes having the same name.
Also, package names and the directory structure of your extensions’ source files are very closely related. For example, if your package name is com.company.myExtension (package names are usually written in the reverse domain name notation) then your directory structure must be like this:
src // This is the main source directory.
Thank you all for your replies. So let me see if I understand: in other editors you need to specify the package name in the code, like the example @bodymindpower showed us, but when we use the Appybuilder editor, that package name is generated when we get the aix file. Is that right?