How do I perform math using TinyDB? (App Inventor 2) - app-inventor

I am trying to use TinyDB in order to store a value on one screen and display it on another. On the second screen, I want to add 1 to the number stored with TinyDB on the first screen. However, when I try to do this, nothing happens. What am I doing wrong?
Here's my code for the two screens.
Screen1
Screen2

You already loaded the available computers in Screen2.Initialize into label computersAvail.Text. Therefore in the Button1.Click event first add 1 like this
set computersAvail.Text to get computersAvail.Text + 1
and to store the updated available computers in TinyDB then use the following block
TinyDB.StoreValue "Computers"
get computersAvail.Text
btw. it helps to first do the tutorials to learn the basics of App Inventor...
also see this link for "the lost souls"...

Related

Nativescript - Add to favorites/featured

I´m in that point on my app where i need to give the user the ability to save to favorites. To be more specific, let´s say that he´s seeing a list-view and then presses one of the listitems which takes him to the detail of that item...here i have a star icon that when pressed it should save that item and then if he navigates to the favorites page, he will see another listview with all of the favorites.
but i´m stuck on how to accomplish this, the only thing that comes to my mind is the application settings...it should be a dynamic array that always exists and then keeps adding or deleting objects(favorites).
Any thougts on this? can anyone suggest me an approach? maybe a better one?
Regards
You may use the nativescript-localstorage plugin which internally uses file system only and takes care of reading / updating JSON file as needed.

Xcode Need guidelines on invented draft for photo gallery manager

For this question, I don't require a full explanation of all code, but helping me get insight into the process for achieving this result would be very helpful! Some information sources that will lead me to where I want to be.
Don't hesitate to give your opinion or make suggestions on how you would make it better in case you have better ideas - We just want to jump off the regular photo album system.
In the added screenshot I have added a painted image that makes the purpose clear.
Albums are created by tapping the "+" sign. (This shows a popup window in which the user can tag a bar/event to which the picture applies; the bar/event profile picture will appear on the album cover).
Newly taken pictures should appear in a separate band on the screen. They will float there until the user drags and drops them into an album. Note that the picture is also taken from within the app (using the native camera of the smartphone).
When the user added them to an album that was tagged, they will also be displayed automatically in the gallery of the tagged bar/event profile. (Of course in the app, personal profiles will be available as well).
Which technologies / workflow would you advise me?
What I need to create now is just an empty shell for the app that demonstrates the visual workflow (the data flows are not important at this point).
I have read about some libraries such as three20 or UIImagePicker, I don't know if they are easy to customize towards our needs.
Thanks!
I cannot comment on the likes of Three20 as I have never actually used them.
One method I can suggest, is using a number of scrollviews. Based on your example, you would require 2 individual scrollviews. (For ease lets call them AlbumsSV and PicturesSV).
The AlbumsSV would dynamically load content, based on your backing store. One approach I have used in the past, is to load custom views into a scroll view, as this allows for maximum control, you can specify any requirements as properties of the view (i.e Primary key etc), also you can load a 'preview image' based on the data held in your data store.
Assuming you always want the ability to add new items to be last element added to the AlbumsSV, then you can simply add another custom view to the AlbumsSV after all other items have processed.
PicturesSV would simply load content based upon what is in the users camera roll. Again I would recommend using a custom view, as you can set properties such as FileURL etc on the custom view, this will aid when it comes to dragging items into a specific album.
Hope this helps :)

Edit onClipEvent Actionscript

I am a beginner so please take it easy. First some history, I am trying to modify a flash movie (not created by me) that has 4 images in it.
I have to now add 2 more images (pic5.png and pic6.jpg) to the "slideshow" as shown in the attachment, I have added the 2 images to the library. The problem I am having (as I understand, I may be incorrect) is that _root.count = 4 causes the movie to jump back to the first image after it displays the 4th one which does not display the 5th & 6th image.
My question, how do I edit the value of _root.count to 6, so that it will show all the 6 images. Additionally how do I create a hyperlink on each image.
Please can someone guide me.
Many thanks.
Looking at your screen shot, Layer 2 (which contains the slideshow movieclip) is locked. If you unlock the layer by clicking on the padlock icon you should then be able to edit the script.
To edit the script double-click on the script in the Movie Explorer panel and the Actions panel should open. You can edit the script here.
The second part of your question - how to create a hyperlink - is very broad and there are many different ways to approach it. The most elegant approach would depend on how your project was structured.
The simplest way might be to define a variable to hold the path to the current image and add another onClipEvent handler.
So in the existing onLoad you would add…
this.path_to_image = http://your-domain.com/images/your-first-big-image.jpg;
Then add the new event handler
onClipEvent(mouseUp){
getURL (this.path_to_image);
}
You would then have to update the path_to_image variable whenever the image changed.
slideshow.path_to_image = http://your-domain.com/images/your-next-big-image.jpg;

Creating real-time monitor window of an application

I want to create a window that can display the current content of an application, say Powerpoint or Adobe Reader.
When I run my application, I would first select which of the currently running application I need to monitor in realtime. Once done, I need to get the current content of the selected application and display it. Since my application is going to be realtime, it will need to capture the contents of the selected application as and when they change (with minimal lag), and then display it.
As I understand, this broadly comprise of the following steps:
1. Selecting an application that I want to monitor
2. Get 'notification' when the content of that applicaion (client area) has changed
3. Capture the new content and display it
The steps [1] and [3] are quite easy and I find several methods here to perform them. However, for the stage [2] I am still clueless. Can anybody throw some light on how to acheive this?
Cheers.
You might take a look at UltraVNC, which does exactly what you are trying to do (it has a single window mode as well as full-screen). It has no less than four ways to accomplish your step #2.
The one obvious approach I can think of is to periodically take snapshots of the app's window and compare it to the previous one for changes.

How can I print to a label printer from a web page

I have an e-commerce web application and I'd some how like to make that print to a label printer for the back end stuff
I have two questions
1) I can't print from a normal webpage straight to the printer (A zedbra LP2844 i think) it just throws out junk
2) I want to be able to print labels to the label printer, but all other printing, such as invoices would go to the default printer - a laser, so need someway of selecting the right printer
It will all happen at a fixed location, so I can insist on for example using Firefox with a specific (custom?) plugin installed (already using firefox so this would be a neat way)
Does anybody know if this is possible, is a firefox extention a possible and/or good way of doing this?
Anybody out there that can write ff plugins?
I would presume this must have been done before surely, but cannot find anything on google
Thanks for any help
Dave
Surely the label printer comes with a Windows driver? Then it might be enough to produce pages with the right dimensions in the browser using CSS or, if that won't work out, a PDF.
You can use "cm" or "in" units in your CSS for the label printer; you should be able to set page dimensions and orientation in Firefox's print dialog .
As much as I can see there are Windows drivers for this particular printer. Printing shouldn't be a problem after you install them.
Thanks for your comments people, I've actually come up with a different solution which comes at the problem from a different angle as selecting the correct printer would likely always be an issue
At the moment we have a windows program that we enter the order number into, it then draws a label and prints it out, but its not pretty and getting changes done to the layout is difficult but more than anything I want the ability to print from the webpage
So what I'm planning is this -
Update the program so it sits in the background and polls the database for a list of orders to be printed, for each order it finds, request an image from the server and print that image to the label
On the server, an image is created on the fly using ASPJpeg which gives me full control over how the label looks
From the webapp, I then have a button on the order to print, this adds the order to a print table... I can then have an interface to the print table which shows whats waiting to print, whats been printed etc, and I can clear the print queue or delete individual items from it just as if it were the windows print queue
Only problem I'm worried about is polling often enough that staff aren't waiting for labels to print and not polling too often that too much bandwidth is being used up
I might make it so that when they hit despatch it sends the label to be printed, or some other existing function that ties into the order process

Resources