2016년 11월 18일 금요일

app to market download link!!


please share with google drive

ben diğer bulut sitelerine giremiyorum (I can not get into other cloud sites)

-- 
for questions about AppToMarket please ask here https://groups.google.com/forum/#!forum/apptomarket
Taifun


-- 

Integer compare !


I would like to compare two numbers. If the integer is two, I need to set in another field.  As in excel sample:     =IF(INT(B14)=B14;B14;"")                               
Thanks is  advance..

-- 
By your example, you only have one input.

See attached.

ABG

 Clipbord01.png



-- 

Can't retreive Firebase child nodes



  • Level 0 (Firebase root)
    • Level 1
      • Level 2
        • Level 3 data1
        • Level 3 data2
However, I'm unable to retreive the stored data at Level 3, using this as the tag : Level 1/Level 2/Level 3 data1

I get the text value stored in "valueIfTagNotThere". But the tag IS there and if I use a fake tag, nothing at all will be returned.

Has anyone experienced this?
-- 
It would really help if you provided a screenshot of your relevant blocks including Do it results, so we can see what you are trying to do, and where the problem may be.

Taifun

-- 
@John

Is there a forward-slash at the end of your firebase path; e.g. jdoe.firebaseio.com/   ?
If not, try adding it it and let us know how it goes.

  


-- 

Sorry Taifun, I replied in Gmail instead of this group by mistake. Here are two images, the first with the code saving the data, the second with a bunch of blocks just trying to get back the data. I also noticed that when trying to get the list of tags, I only get the "words" tag although I have a few others, but they don't have child nodes. Normal?



-- 
When I took a look, my FirebaseDB1 had the trailing "/", but my had DEFAULT in the field although I had changed it when I created it! After putting the proper URL, the code returns the full tag list, so perhaps I'll be able to get the data I wasn't able too. I'll confirm when I find out, THANKS!

-- 
It works! So that was the problem... the Firebase URL was reset to DEFAULT some how. Thanks! I was about to switch to another method for storing data... :/

-- 

Turn off tablet


I have to create an app that requires that by pressing a button, turn off the tablet.

How can I do?
-- 
try the activity starter and this solution http://stackoverflow.com/a/24700240/1545993
Taifun

-- 
How to do with app inventor 2?

-- 
as already said, use the activity starter
now it's your turn

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun


-- 

Is Canvas Compatibility Possible Across Multiple Resolutions?


When making games using the canvas I'm running into some difficulties.  I have the canvas on fill so that it fills the rest of the screen like so: https://gyazo.com/22d90d5176efece916bcc36e01f2782f.  The problem is that the resolution keeps changing per phone so I can't get any reliable variables.  The sizes, positions, and speeds of the objects act different on every device since they are on different sized canvases!  Is there anyway I can just automatically scale everything so it's just like it is in the app maker client?  This is starting to drive me crazy.  Thanks for getting through the post, any help is greatly appreciated.


--
Yes, it is possible to apply that tutorial in your app, you can do it with the canvas. It is right that you will have some problems in different ratio with different devices. But you can adjust that by varying the size of minor sprites, like in your picture, you can make the water level deeper or vice versa.
If you want the whole canvas to be the same ratio, use four border labels or imagea around the canvas, put all inside the arrangement. Then you could only change the thickness of the surrounding labels and leave the canvas with the same ratio you want.


--
You have probably read some of the chapters in Dr. Wolber's free online book (   http://www.appinventor.org/book2      ). You certainly read chapter 17..Creating Animated Apps  (  http://www.appinventor.org/bookChapters/chapter17.pdf  ) and found a very concise description of 'how the Canvas object is designed.'    Knowing that and the official MITdescription of the Canvas object (  http://ai2.appinventor.mit.edu/reference/components/animation.html#Canvas  ) will allow you to design an app using Canvas for multiple screen sizes.    

Follow Min Zarni Aung's suggestions.  Also consider the 'cheap' solution:  Set the Canvas pixel height and width using code. Do not allow the Canvas to FillParent.   Uh oh, 
this may mean the Canvas will display 'small' on large tablets. Alternatively, scaling, and a lot of code, is the solution using if..then coding blocks (  http://www.appinventor.org/bookChapters/chapter18.pdf ).  The links here may provide additional insight:  https://groups.google.com/forum/#!searchin/mitappinventortest/scale$20Canvas%7Csort:relevance  

Scaling objects is not only problematical with AI2,  the issue is complex and you would encounter similar issues if you used the professional compilers like EclipseAndroid Studio 2, B4A etc.  AI2, and  B4A, use techniques to 'automatically' scale the screens using built-in capabilitites.  Nice feature in a tool that is mainly intended as a teaching tool and not a commercial software game development tool.  Eclipseand Android Studio apps are more complicated..they maintain multiple sets of images etc. in a support folder (a simplification).   Less than perfect scaling is the price one pays for a relatively simple development platform versus the professional 'precise' tools.

When you achieve a solution you are satisfied with,the community might appreciate your posting an example of how you solved your scaling issue.

Regards,
Steve 

-- 

After Filling out a fields on a webpage... Is it possible to press Submit button


Reference this topic:   
How to automatically fill fields in a web page's form (when loaded in a webview)

Located here:

WOW!!! Taifun, You are awesome!!!!!!  I've been trying to do something like this for a long time but I was not even close.  This will also work for logging in to websites.  You can fill your LoginID and Password to the website using AppInventor.

Now I have a question....

Is it possible to press the Submit button for the form with a Button ID = "Submit"

I can do it if I place the script below in the form part of HTML, but I don't know how with AppInventor.  Is there a way to add this text (or similar) to the solution you have above.  

I would like to fill the form with the solution above and then press the submit button to AutoLogin to the website

Thanks 

<script type="text/javascript"> document.getElementById("Submit").click(); 
</script>

-- 
thank you, I'm glad that you like it...
well, somehow I already was waiting for that question...

-- 
You are Freaking AWESOME!!!

I don't know how you figure this out.

I hope you have time for one more question... :)

Once I'm logged in I would like to fill another form and press another Button, "Find".

The problem is the "Find" button doesn't have an ID...
Is there a way to run the "javascript:findCodes(); in the following text?

I'm able to fill the text input field "Location" but I don't know how to press the "Find" button.

<input type="text" id="Location"/>
<input type="button" value="Find" onclick="javascript:findCodes();" />


Thanks again for all of your help!!!

-- 
I hope you have time for one more question

well, I guess probably I will find some time next year to look at this...
but probably there is an JavaScript expert around, who can answer this...

Taifun

-- 

Thanks Taifun,  No need to worry about next year ,YET!   :)

Well I got lucky!!!

I was able to get a solution for my problem.

I was trying to figure out how to click this button without an ID.


<input type="text" id="Location"/>
<input type="button" value="Find" onclick="javascript:findCodes();" />



Instead I thought about not pushing the button but calling the function that the Button was calling on click...

Earlier in the HTML code I have this...  function findCodes()

I was able to call the Function with this...



Hope others may be able to use....


-- 
great! thank you for letting us know!
the simple solutions are the best! 

Taifun


-- 

Error 2101: the file could not be found


I looked to all thread regarding this but I'm still in trouble.
I've made an app than should read a csv file (picking it from internal memory) and import his content in a database.

I'm not able to reach this step cause every time it ends with "Error 2101: the file //storage/emulated/0/download/test.csv could not be found". But it exist, I've personally put it there!
I've tried everything (one slash, two slash, "file:///". "mnt/sdcard/") and nothing works, I can't go on.

Please help me to find out why. 
P.S. I have to put all that text replacement because AfterActivity.ResultURI it return a very strange string, here the code and what it returns:


-- 

 I have to put all that text replacement because AfterActivity.ResultURI it return a very strange string
how does that "strange string look like exactly?
to convert a content uri into a file, you can try to use the GetFileName method from the file extension https://puravidaapps.com/file.php



Error 2101: the file //storage/emulated/0/download/test.csv could not be found

why are there 2 slashes? there should be only one... probably that's the problem?

Taifun

-- 
Here's the answer:

The "Strange string":


With your extension:





With just one slash:



-- 
the file component expects a relative path, which is in your case 
/Download/test.csv


ReadFrom(text fileName)
Reads text from a file in storage. Prefix the filename with / to read from a specific file on the SD card (for example, /myFile.txt will read the file /sdcard/myFile.txt). To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes). If a filename does not start with a slash, it will be read from the application's private storage (for packaged apps) and from /sdcard/AppInventor/data for the Companion.

my method can't provide something reasonable for that content uri
Taifun


-- 
Ok many thanks for your answer, Taifun (and very compliments for your extension!)

However it seems that in MIT APP Inventor there is no way to pick a file from a path (that isn't specified before) and read it

-- 
you could use my file extension to get a list of available files of a given path
and use a listpicker to pick a file

you also could build your own file manager using the blocks from the file extension
there are also blocks to get a list of directories etc.

Taifun

-- 
Ok I'm getting crazy.
I've tried what you suggest:


And I get the same result:


-- 
as already said
the file component expects a relative path, which is in your case 
/Download/test.csv


Taifun

-- 

changing the screen when lives hit 0


How Do you change the screen when lives hit 0
-- 
Use the IF block.
IF lives = 0 then OPEN ANOTHER SCREEN

-- 
Take a look to my example snippet:
-- 
Looks like you have a duplicated block that you forgot to delete. 


-- 
Oh, thanks for the advice :)

-- 

retrieve data from previous screen


i have a screen in which i insert a lot of data


when i add tags, i can see them in another screen, than i can return on this screen to compile the rest

i have two question

1) is there any rapid way to retrieve the value that i insert when i go to the tag screen and back to this screen? or i have to save every textbox and label and call with a db?
2) the list of tag, is a part of the contact i store. Now, since i can go to the tags screen (so i can see the tags of the contact i'm storing), how can i manage it? there is no problem with the first contact cause there's only the tags of it in the tag "tags", when i store a second contact, it's tags are added to every other tag. Should i clear the tag "tags" when i save my contact so the new contact i store has an empty slot for its tag?

--
i know it's a bit odd as topic, but no one has some ideas?

-- 
Did you try not going to a different screen and making a "virtual screen" with a layout that is turned visible and invisible?
The way you formulated your question 2 is a little too complicated. Can you please be a little more clear?

-- 
This question sounds like the old Who's On First? comedy routine.

Could you please rephrase it using the term optional additional contact attribute name/value instead of tag,
which is easily confused with TinyDB tag ?

ABG

-- 


, when i store a second contact, it's tags are added to every other tag.


Blocks?

ABG 

-- 
great solution

other question is no more relevant with this solution.

however you're right, i often write when i'm making something else, or when i'm in train :-D

it's really easy.

I have a contact that's a list: name, surname etc and other variable that are lists, like "tags" (the tag of tinydb formed by a "tag name" and "tag value" joined with a ":").....
One contact has a lot of tags.
so, i add tags before i save a contact, and i can see the tags added til the moment in another screen
now, for this two values (tag name:tagvalue) that i call "tags", i use a tag in tinydb called with the same name, "tag"

since i open another screen, i need to get the tag "tags" with the tinydb....the problem is when i add the second contact, if i store the tags of the second contact they are added to the tags of the first contact, and so on.
Obviously every single contact as a list of "tags" that are only related to the contact itself.

i thought to delete the tag of tinydb "tags" every time i add a new contact, so every contact has its own tags

but with the solution of italo, i do not need it anymore

i hope it's clear now, this is a problem of language and tiredness

-- 

Not having seem your blocks, I would guess that your are not building up your TinyDB tags to include the JOIN of the parent object (Contact Name?) and entity(tag)  name?

ABG


-- 
i'm using another method with listpicker, the best solution of course. I didn't like it but i was dumb

can u make an example of what are u speaking of? "JOIN of the parent object (Contact Name?) and entity(tag)  name?"


-- 
Here's a sample set of tags and values showing how to make TinyDB do all the work of tables, rows and columns:

(Tag:Value)

Users/UserID/ABG/Name : Abraham Getzler
Users/UserID/ABG/email : AGetzler@myob.com
Users/UserID/ABG/NickName : Methuselah
Users/UserID/ABG/Age : 999

,,,
Users/UserID/Diego/Name : Diego Marino
Users/UserID/Diego/email : Diego.Marino.task@myob.com

Do you see how extensible this is?
ABG

-- 
i'm just a bit confused.....you mean:

the "users/userid/abg/name" how do you make it in the blocks?
i'm making to muuch stuff and this is confusing


-- 

the "users/userid/abg/name" how do you make it in the blocks?
i'm making to muuch stuff and this is confusing


Use the text JOIN block.

ABG

-- 
however the solution is this one

 Cattura.png
it works fine

-- 

Comment field & collapse/extend block


Commenting code is one important issue and when block is collapsed at least I can not find a possibility to read comment field, Is there some trick to reach this comment field? When I teach coding basics I always try to remind about this code commenting& documentation issue.

br, Eero


-- 
Consider starting a doc file with screen shots of your blocks intermixed with explanatory text, in a 
multilevel organization with a Table of Contents.

It will live long after AI2 is gone, and is a good way to show off work to others.

ABG

-- 
Hmmm, am I reading from answer Ai2 is not living so long and they are not willing to put any new features to it?

-- 
Depends on your time frame.
Nothing lasts forever.

I have a self replicating FORTRAN card deck without printing on top that would be a pain in the neck to read.
We still get requests from AI1 users discovering they can't load them or convert them.

Take the long view, 20 years.

Or if you are looking ahead only one term, think of it as a fast way to read student work without starting up an emulator and AI2.

ABG

-- 

 Is there some trick to reach this comment field?


Click on the blue circle.

ABG
-- 

Strange math/variable glitch


I created an app for calculating the amount of change for any money amount (for instance, if i typed 12.48, I would get 0 $20, 1 $10, 0 $5, 2 $1, 1 Quarter, 2 dimes, and 3 pennies) I have the block structure attached.


This is the strange part. When I enter random numbers (for instance 32.91 and 95.16) I'm always a penny short

(I found out that the variable, money was somehow equal to 0.01 after it had displayed the values to me.)

But other random numbers (67.45 and 94.62) displayed all the values correctly, but it made the variable, money equal scientific notation values (2.8311E-15 for 67.45 and 4.5415E-15 for 94.62. The E- values (dont know what to call them) are all around 15 and 16 whenever I come across this instance).

When I found this out, I decided to create an loop that could only be stopped when the value of money was equal to or less than 0. When the loop stopped, it would display the values of quarters, dimes, etc. The values were never displayed. I redesigned the loops in many ways but all came out with the same result.

You can analyze my code and I assure you that all of my display methods are correct (I've checked on multiple occasions). You may even recreate the code if you are unsure. I suspect that it is a bug with the App Inventor program itself. Please tell me if you know anything about this. I will talk with my computer science teacher tomorrow too.

thank you.

 Screen Shot 2016-11-14 at 7.17.46 PM.png

 Screen Shot 2016-11-14 at 7.20.09 PM.png

The two screenshots are supposed to be connected in one block of code. I separated them because the block was too large to show in one screenshot.

-- 
Yikes!! If-then in more than three levels smells trouble. Make some sensible procedures and then try again. Try DoIt on each step then.
Cheers, Ghica.

-- 

This is the strange part. When I enter random numbers (for instance 32.91 and 95.16) I'm always a penny short

(I found out that the variable, money was somehow equal to 0.01 after it had displayed the values to me.)

But other random numbers (67.45 and 94.62) displayed all the values correctly, but it made the variable, money equal scientific notation values (2.8311E-15 for 67.45 and 4.5415E-15 for 94.62. The E- values (dont know what to call them) are all around 15 and 16 whenever I come across this instance).

AI2 stores dollars and cents as a IEEE754 floating point number, with a binary mantissa.

 The mantissa stores approximately 15 decimal digits worth of precision.
Binary mantissas see decimal fractions like 0.1 as infinitely repeating decimals, hence the loss of accuracy.

I suggest multiplying your input by 100 and then rounding it, to get an integer number of pennies.

ABG\
(see Math section)



-- 

METHOD TO SHOW SCREEN BASED ON MULTIPLE CHECKBOX CHECKED BY USER


I have problems in using checkbox. in my case the user has 4 options (checkbox). each user can choose the option more than one choice (one, two, three or four choices made at one time). if the user selects an option, then a new page will be displayed and also if the user chooses two or three or four choices, a new page will be displayed (all the item checked). help I expected was how to display two, three and four (4 checkbox checked) based on user choice in the same page?

--

Creating counter that tallies in another screen


Students of mine are trying to create a client app that is suppose to keep track of counts from screen 2 and 3 but the counts are to be presented in screen 1. I am wondering if this is even possible, and if so, when we go from screen to screen, is it possible to keep the tally until it is cleared by user choice? Thank you for all and any help you can give me! :)

Follow FDL Schools on Twitter

http://twitter.com/fdlschools

-- 
See the TinyDB and Screens sections of this FAQ ...

-- 
Yes, it is possible to transfer data between screens, the developer MUST use a TinyDB as just mentioned by ABG.  The references he provides show solutions using multiple screens.

An alternative is not to use separate screens at all; simply create virtual screens by using layouts that you hide or show.

Your entire app can be built on one screen.  A very neat idea ;  You do not have to pass information between screens using a TinyDB or passing variables that can get VERY complicated.     WIth mulltiple screens, you  duplicate variables for each screen since each screen' performs as its own independent app' even though the TinyDB tags are shared.

What you presently put on a your second or third screen can be put in two  Vertical Layouts, set Visible to false and shown when needed using true; the same is true with succeeding screens.   You need to initially set your Screen1 to scrollable  (so you can work with all the Vertical Layouts).  When you are finished, add a block in the Screen1 event handler set Screen1.Scrollable to false. perhaps to hide the second and third virtual screens until they are needed.

Coding on a single screen requires more thought than coding on multiple screens but a developer avoids the huge headaches of passing data between screens, duplicate variables on many screens to handle the data etc.

Look at the past advice on this forum regarding screens; ALL the moderators urge users to code on a single screen  or at the most one or two.  Users can build large apps on a single screen.

You might enjoy this  


despite the caption, the article is actually about building an app with only one or a few screens.

However, if you really believe you NEED  three screens for your app, use a tinyDb to pass the values.

-- 


Volume


Hello

In which unit is the volume of the player ?

Thanks.

-- 
see the documentation
http://ai2.appinventor.mit.edu/reference/components/media.html#Player
its just a number between 0 and 100...

Taifun

-- 
But is it in decibels, hertz, or some other unit?

Thanks.

-- 
The unit of volume is percent of the volume.
For example, if you enter the number "50", this means "50%" of your device volume.

-- 

Countdown


Hello friends.
I was programming a game on app inventor 2 and I want to insert the countdown feature in my game. However, I am unable to do so. Please guide me for the same. The code is attached herewith.

in the Clock.Timer event set Clock.Enabled to false and 
in the TextToSpeech.AfterSpeaking event set Clock.Enabld to true again

also set Clock.TimerInterval to a reasonable value, for example 1000 milliseconds
Taifun



-- 


if you want take a look to this.

--