• Tidak ada hasil yang ditemukan

Save Project Locally

Dalam dokumen Android Apps with App Inventor (Halaman 60-63)

As soon as you have finished developing your AI project, you should immediately save it. As described earlier in the context of the AI IDE, AI saves your project automatically on the provider’s servers each time you close the AI IDE. This ensures that you always see the most recent version of your project when opening the AI IDE. You also have the option of saving the current project stage in AI Designer via three buttons—Save, Save As, and Checkpoint—on the provider’s servers in the previously described varia- tions. These saved versions of your project are available only online within your personal account in the AI IDE, however, and using them requires that the provider’s servers be functioning without errors. If you want to use your AI projects under other accounts or make them available to third parties—for example, as a didactic model, for discussing pos- sible solutions or as a basis for their own projects—then it makes sense to save the project on your local hard disk. You also reduce the risk of losing your projects when you main- tain a backup copy in your own sphere of influence.

To save one or more projects together with all components and block structures in the AI Designer and Blocks Editor, you need to go to the project view of AI Designer by clicking the My Projects button. There you can mark the projects to be saved locally with a green check mark. For now, check the LaughBag project, as shown in Figure 3.21, and then click the More Actions button and select the menu item “Download Source” below it.

Figure 3.21 Downloading the marked project to hard disk

This series of steps opens the download window shown in Figure 3.21, which asks what you would like to do with the generated project file LaughBag.zip. Choose the option “Save File,” click OK, and enter the desired location on your hard disk where you want to save the project. Now the project file is safe and sound on your local hard disk.

Downloading All of Your Projects at Once

At the end of 2011, an additional button labeled “Download All Projects” was added to the Google AI’s My Projects overview menu. With it, all projects created by a user can be down- loaded at once and saved locally as one large ZIP file. The resulting file, all-projects.

zip, contains all projects in turn as individual ZIP files. After downloading and unzipping the collective file all-projects.zip to the local hard disk, you can then upload the individual project ZIP files one by one to the development environment of another AI pro- vider (for example, MIT AI) and process them further as part of your project.

Project Files from This Book on the Companion Website in the /PROJECT Directory

You can find all project files from this book on the companion website in the /PROJECT directory (see the link in the Introduction). The website also includes the current file LaughBag.zip. You can upload all of the AI projects described in this book directly into the AI IDE after downloading them from the companion website, without having to input the interface components and block structures yourself. Nevertheless, you should not underes- timate the benefit of the learning experience you achieve when you recreate the app step by step.

In case the block structures we develop later in this book become so big that they cannot be adequately printed in this book, be aware that you can access the companion website and upload the block structures from the project files into your own AI Blocks Editor. You can then study them in their entirety and develop them further for your own purposes if you wish.

If you should wish to edit the project later under a different account, you can upload it to the corresponding provider’s server. Once more, uploading projects in AI happens

Developing App Functionality 105

via the More Options button in AI Designer. Click on the option “Upload Source,” and then click on “Choose File” and select the desired local project file with the extension

.zip in the file manager. Click OK, as shown in Figure 3.22, to upload the project from your hard disk to the provider’s servers and open it as the current project.

Figure 3.22 Uploading a locally saved project in AI

In this way, you can make your project files available to other AI developers as well, so that they can upload your project to their AI IDE for their own use. It is common prac- tice for AI developers to share their projects and swap opinions on block structures, dif- ficult problems, and common solutions. This cooperative attitude makes it also possible to offer tried and tested block structure functions to other users, which other developers can then use in their own projects as ready-made building blocks.

The file extension .zip indicates that the project file is not a single file, but rather a file archive. Surely you have a program installed on your computer that can extract zip files, such as WinRAR (www.win-rar.com). Double-click on the project file

LaughBag.zip in your File Manager and take a look at the contents of the project archive.

Figure 3.23 Directory and files in project archive LaughBag.zip

In Figure 3.23, you can see the directories and projects of the project archive

LaughBag.zip. The actual source code with the system-specific description of the interface design and functionality of your app is hidden away in three files in the sub- directory /src/appinventor/ai_YourAccount/LaughBag, although on your com- puter the name of your actual Google account will appear instead of the placeholder

ai_YourAccount. The directory /assets contains all of the media files used in your project and shown in Figure 3.23. You can’t really do much with these individual files outside of the AI IDE, but the directory structure gives you an additional impression of how AI internally manages your app projects.

Dalam dokumen Android Apps with App Inventor (Halaman 60-63)

Dokumen terkait