Copy blocks to another screen MIT App Inventor
Asked Answered
G

3

7

I published my app that has many screens, but now I want to go back and add a new feature to those screens. Is there any way that I can just create the new blocks once as a template and paste it to the new screens?

Grane answered 21/7, 2014 at 16:37 Comment(1)
how many screens do you have?Kauffman
K
3

copy-paste of code blocks is not a good idea: instead of creating redundant code, you should think about a redesign of your app, see the following link for more details.

Building apps with many screens

If it seems that your app requires a large number of screens, you might think about redesigning it to not use so many. For example, suppose your app has to show several different screen images all with the same functionality but each image having a different background. One way to code this would be to use a different App Inventor screen for each image, each screen with its own background image. With that method, you’d need as many screens as there are images. But another way to code this is to have only a single screen and change the screen background. Similar ideas apply to other kinds of elements: If each screen image has a label with its own text message, then rather than having multiple screens, each with its own label, you could have a single screen and a single label, and just change label’s text.

In App Inventor, you only can copy a complete screen, see the following method

How to copy screens by Scott and a video by Hossein

EDIT: now there is the new backpack cut-and-paste system

The Backpack allows you to carry around blocks throughout your project repositories, allowing blocks to be transferred between projects and between screens. The contents of the Backpack persist throughout an App Inventor session. (NOTE:When you quit your App Inventor session or refresh the App Inventor page in the browser, the Backpack will be emptied -- i.e., re-initialized.)

Kauffman answered 21/7, 2014 at 16:50 Comment(1)
I already copied screens to make the app, but now that I've done that I can't copy screens again because I will lose all the rest of the work. Its unfortunate that you can't copy blocksGrane
H
1

It is not possible to copy objects (blocks, labels, pictures, lists, etc.) from one screen to another. See Issue 2076:

It would be nice to be able to copy objects (labels, pictures, lists, ect.) from one screen to another, theoretically the way it would function is: on the right side on the components list, you could right click on the component you would like to copy and press either copy/paste or you could right click and press send to screen Y. Any blocks related to these components on screen X would be sent with the copied components to screen Y. This would be very useful/helpful instead of trying to recreate multiple pages with the same layout and block structure multiple times.

Hagar answered 13/1, 2015 at 0:40 Comment(0)
O
0

Drag block to your bag, if you want to use, just check your bag

Oligosaccharide answered 18/5, 2018 at 18:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.