2017년 7월 30일 일요일

search results for HELP ME! How to exchange image.


Good Evening. I just wanted to know how to 2 image exchange in app inventor. When light dependent resistor sends high value of data to app it will ...
Hello the boys, for the interested to share image with message text on facebook !! I find an intelligent solution !!! Yoohooo !!! But in exchange if you ...
Like I have a rectangle and I have two image sprites in them. I want exchange those two images when when the user swipes an image.(if possible ...
but they exchange the Sprite.Picture values with ... The only thing that changes is the way the image file names are assigned to the. sprites. This is just ...
... exchange the images of 'Magic' for those in your cartoon if you resize your 9 images to the same size as the blocks that compose Magic's image and ...
Nooddl_Cafe_cp_V_1_5&hl=en_GB. As used in our school everyday to replicate picture exchange for children with autism and learning difficulties. :)
Good Evening. I just wanted to know how to 2 image exchange in app inventor. When light dependent resistor sends high value of data to app it will ...
... token to the app or maybe saves the access token as a text file and the app could use an image component set to the location of the text file on the server and then extract the access token this way. ... It is important that the Android app never attempt to exchange the code for a refresh token on its own.
yes, I can provide a path for image content URIs like this. how to continue see again Q2 here https://puravidaapps.com/file.php#q. Taifun.
Now your talking Scott, I think reducing the size of the app is the first goal. You know, you should check it by using a small image in exchange for the ...
Games might be possible using Bluetooth clients / servers, eMailing chess moves back and forth, using sms texting to exchange moves etc. ... here are some of mine: https://appinventorforfun.wordpress.com/tag/gamepuzzle/ These are single play games that might be adapted but I image it would be very ...


Sliding Puzzle App help


I am making an "Sliding Puzzle" app. But I don't know how to code it. I made 9 buttons and put image on them. (pic Below)

Can any one tell me some basics, or give me link where I can learn the required stuff. I found one Tutorial online but it was too hard to understand.
I will be very thankful. Please.

--
Is this the tutorial you saw     

Slide Nine – a sliding block puzzle game tutorial for App Inventor ?  This tutorial is an Advanced tutorial.  A sliding block puzzle is complex and requires knowledge of some the advanced features of App Inventor 2.  The complete Project aia is included in the tutorial.  The code should be adaptable to your images.  Looking at you screen post, you already have some of the many parts of the Project.  In fact, you should be able to exchange the images of 'Magic' for those in your cartoon if you resize your 9 images to the same size as the blocks that compose Magic's image and the puzzle should work Faraz.

We want you to have fun with App Inventor so here are some resources to help you learn to use the AI2 tools  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  .

To code the sliding blocks puzzle, you need to learn the AI2 blocks and coding techniques.   The tutorial does not describe the basic things required to successfully code and adapt this Project to your needs.

Ask specific questions here and someone will try to help.  After taking the programming course mentioned above and reading the book about programming, you should be able to adapt Slide 9 to your needs.  Just try.  I do not think there is any simpler code available anywhere for a puzzle like this using AI2  Perhaps someone else might provide a different reference.if one exists.

--
@SteveJG,  I don't see any links for the tutorials or .aia files at your Wordpress site cited above, just the descriptions.
I am using Chrome, with no blockers.

Did something happen to your site?

--
The pdf's on App Inventor for Fun are copyrighted.  Posting and distributing those pdf's on other than the App Inventor for Fun web pages and/or distributing / sharing them with others is prohibited.  All the materials on that web site are copyrighted material (this includes the aia files) and the material is NOT freeware.  The distribution of these files other than from the App Inventor for Fun pages is strictly prohibited.  Posting  and redistributing any of those files on this forum or other Web pages is a violation of the law.  Please honor my copyright.

--
Sorry about that I didn't know.

--
Here's an alternate shuffle technique for sliding puzzles that should always give you a solvable puzzle.
If all pieces of the sliding puzzle are the same rectangular shape and size, then you only get a choice of up to 4 possible choices for each move: up, down, left, right (U,D,L,R).  

So a random shuffle could be done by starting from the end position and applying some large number of randomly chosen moves (U,D,L,R).  How many moves?  Twice the number of pieces should probably be plenty.

Note that some moves may end up with no net difference in block positions, for example asking for four right moves in a row in a 3 by 3 puzzle.  When you code to process a move request, check if it's legal and ignore it if it's illegal.

How do we know for sure that the end result of the random sequence f moves will be solvable?
Just apply the reverse of the sequence of moves that created it from the starting position.

--
PUZZLE2.aia



--


How can you make a Shop for a game like cookie cliker


If you know that will help me out a lot thanks 

--
Don't understand... what do you want to know David.  Shop for a game?

--
Google Play in app purchase is not supported

to star an issue means, to click onto the star in the upper left corner of the issue to vote for it and to get an email in case there are news
--
No like a upgrade shop. to upgrade your points.

--
sorry, what is an upgrade shop? you might want to explain a little bit

--

You want the player of your game to 'buy' points and images within your app, I imagine ... like in Dungeons and Dragons or other turn based games and Cookie Clicker?

You will have a list of objects you can 'buy', probably selected  in a ListPicker , depending on how many points the user has accumulated in the game?  If the user has enough game points, he can buy some but not all of the objects?

Tell us more about how you think the 'buying' should work ... step by step.   ...and someone will provide some suggestions.

--
Yes that is the game i want to make i am all most done i just need the saveing and upgrade shop the upgrade shop will be (Ex: you tap once gives you 2 Coins and when you buy something out of the shop it will make you get 4 coins more. and the price raises once you buy one upgrade thats what i need help with and the TinyDB1 And the TinyWebBD. thanks 

--
Thank you for confirming the Project.

Have you done the Colored Dots tutorial?   It shows how to work with the TinyDb.  Colored Dots for App Inventor 2    Be aware, using the TinyWebDB will require you to have your own server.  Fusion tables, though not perfect, may provide an alternative way to store scores, the store items etc.    Have you done the Pizza Party tutorial?   It will get you started with Fusion tables...  Pizza Party with Fusion Tables for App Inventor 2

You will need to use lists.  A basic discussion is here:    Making Lists (App Inventor 2)

You will need code to provide the logic to let the app know how you will 'spend' coins ...You will most probably make extensive use of the If..then    else    or else if blocks.

My suggestion is to take this one piece of a time.  Save the app you have now as an aia to keep it save.   Then start several projects with different names to code the buying logic and a way to save information to the TinyDB.     Your project is not difficult but it is complicated.  Building parts, then later connecting them may save you lots of time.   It is easier to debug a small demonstration app then your main game app that may have many blocks.   Make a chart on a piece of paper showing yourself how you want your app to work; it will help you to design what you need to code.  Again what you want is complicated, not difficult if you have done the tutorials.

Try some blocks.  If you have questions, post them as a new thread and include an image of what you have done (jpg or png images are best) and you will get more assistance.

--
Intro to > logic tests and conditions < using and, or, not.

--

search results for cookie clicker


edit... sorry, I was getting clicker and clicks mixed up.... In your while test... your Global clicker will always be greater than 0. Your not changing it in your ...
Hi, I am working on my first app, it is a mock-remake of "Cookie Clicker" called " Kitty Klicker". With cookie clicker the points you have (cookies) are ...
In my current project, (A simple cookie clicker clone) I believe that I'm misusing the tinyDB, as all my variables keep resetting on clock time activation.
So I have to make this app as a project for a coding class so i decided to do an app relatively similar to Cookie Clicker. So I'm just running through ...
Hey i am trying to make a game like cookie clicker. How could I do that the Score Label is getting +1 every second? Pls help. Thank you Daniel.
... of your game to 'buy' points and images within your app, I imagine ... like in Dungeons and Dragons or other turn based games and Cookie Clicker?
Hello! I am making a simple clicker app (like cookie clicker). I have code that stores clicks to TinyDB, but I don't no how to get clicks and show they!
I am intending on creating a game similar to the popular Cookie Clicker. I saw a thread asking about how to create an upgrade shop, but I am ...
So I'm making a cookie clicker type app for a project in school and i have everything done but the click multiplier aspect so i was just wondering if there ...
I am new to programming and am trying to make a easy game to start. i want to make a game similar to cookie clicker. so i am trying to make a ...
Unzwar habe ich ein problem ich so etwas wie einen cookie clicker gemacht aber wenn man die app schließt und wieder öffnet dann muss man alles ...


File component and CSV files


There have been a few questions about making a "question and answer" app or something similar that has a table in it. 
I wanted to make  simple .csv file, load the file into an app, and read it into a list of lists. It drove me almost nuts before I finally figured it out, thanks to several examples, most notable one from Taifun (which I cannot find back right now to link to it).

Here goes:
We have a .csv file which looks like this: 
T1. Question one, one|T1. Answer one, two
T1. Question two, one|T1. Answer two, two
As you can see, the fields are delimited by | (a pipe) and not by , (a comma). This is handy, because it allows us more freedom in creating text. It would be very limiting if we would have to write questions and answers as sentences without comma's! If it is small, you can create such a file using a simple text editor, otherwise use some spreadsheet program. I found that using Excel is not very easy, because it is difficult to tell Excel to use | or anything else as ; for that matter as delimiter. Open Office, or Libre Office (both free) are much easier to use for this purpose.

In our example app, we made a design like this: 

It just allows us to check whether our blocks are right. We upload the .csv file into the app as T1.csv

during initialize we read T1.csv as follows: 

In this example the file is an asset in the app. If the file is very big, it would be better to have it stored somewhere on your sdcard. For example, a filename /qa/T1.csv would locate the same file in a folder qa on the card. The advantage of such an approach is that it would be possible to distribute a new file without distributing a new app, but it would not be easy for many users to place the file on their phones in the right spot.

When the file is read, a GotText event will be raised:
Unfortunately, we cannot use list from csv table, because we do not have , (comma) as delimiter. (How nice would it be if we could specify what the delimiter is!)
Therefore we split the text we just read first into a list of rows, and next we split each row into a list of elements.
To check if we did everything right, our example app has two listviews, to display the two rows of our example .csv file:
 and that shows on our telephone screen: 


After having read the elements as a list of lists into the global Topic1 in our example, you could expand this by storing the list in a TinyDB, (which would actually not be necessary if you were reading the file always at app startup, unless you would be using multiple screens).
You can use the attached .aia to try things out.


--

Create a List without using the Blocks


Tired of making long lists (or even short lists) with LOTS of blocks?   Try this instead:
The very simple way using AI2 Blocks and hard-coding the List elements:
Construct a List called MyList from a csv text file created within and hard coded into an app.  The list is:  0.1,0.4,0.3,0.2,one,four,three,two    .  Type it in the maroon block or type it in Notepad or another text editor and drag and drop it from Notepad  into the empty maroon Text block.    The easiest  and safest way to create a long List is to use a text editor to create the list using drag and drop to populate the Text block (you really do not want to type all those blocks do you?).  If you need to change the list or an element of the list, change the text in your Notepad file and replace what is in the Text block with that. Yes, use the list from csv row text block to make the text a List.

Another way to create the List  is to use the File component to populate MyList on loading the app.  This way is more complicated.  Create a file called  MyList.csv with Notepad.   Put it in a directory on your Android device using a file manager or by using your Android as a memory device hooked by USB to your PC.   You can then read the file using    call File1.ReadFrom
                                                                                           fileName  where what you put there is    the location of MyList.csv .    If you put the file in the Media (yes, you can load the text csv file into Media just like a photo or sound bite), this is easy  ..no need for a File editor    and name use the fileName   MyFile.csv

Put the File1.ReadFrom block in the app's  Screen1.Initalize method handler, then use the When File1.GotText do block event handler to set global MyList  to  text .    Your MyList global now has the contents of the Notepad list.
Edit Sept 9)  Here are more things you can do using csv files to make lists:
--
DOH!!! DOH!! DOH!!
LOL. The above is from my second app. When I created that bit I forgot one of my own rules about computers: "If it seems like a pain in the ... there's probably another way!"
Thank you Steve! :) You're technique would also work with list from csv table to create a list of lists like I needed.

--
list from csv table     0.1,0.4,0.3,0.2 /n one,four,three,two    using the example list above possibly?    

--
Hi, If one or more elements contains comma? How is possible to use list from csv row in this case?

--
@Francesco    I think you can handle that by putting internal commas within quote marks, but I am not sure.     ","   ... try it and tell us what happens.   You may have to put the entire list item within quotes.   Try that too.

--
@SteveJG you are right. This is the solution

--

List & List Manipulation


Many apps use lists of data. For example, an catalog system might use lists to keep track of books. We use lists to create and manipulate different sets of values/elements.
Introduction


In this tutorial, we will create a Book Collection app. The app will show you how to:
⦁ Create List
⦁ Add items to List
⦁ Remove List Items
⦁ View all List Items
⦁ Search List and use index
⦁ Join  text to create List item
⦁ Split List item
⦁ Store Lists in database (TinyDB)
⦁ Retrieve data from database
⦁ How to use procedures that return data
⦁ How to perform data validation

Image below shows how the app will look like:

The components in the Design Editor are shown in the below diagram:

The blocks are shown in the diagram below.
⦁ Initialize 3 variables as follows:
 ◦ TAG_BOOKS – used for storing book collection to database
 ◦ listBooks – used to store / manipulate List of book data (Title : Author)
 ◦ varTemp – a general purpose variable
⦁ initData procedure – On app start-up, it:
 ◦ Sets up ListPicker title
 ◦ Hides the ListPicker (we use a button to open it)
 ◦ Sets up initial demo data into our database (happens only on app initial install).  This procedure uses attempts to get the data from database. If data does not exist, then it uses demo data in csv format, splits using comma (,) and assigns it to our temp
⦁ Screen.Initialize — used to check if first time installation. This is done by checking if any database table exists. If not, it will then invoke initDatabase procedure

We also define the following procedures:
isDataEntered – This procedure gets invoked when we try to add a book to the list. It performs validation to ensure data in both fields are entered. It returns false if either book name or book title is not entered.
isExistingBook – This procedure gets invoked when we try to add or delete a book to the list. It joins the book Title / Author in form of Title:Author and then checks our List to find out if exist or not. If it exists, it returns true, else false

Adding a book – when the button ‘Add’ is clicked, it invokes the procedure isDataEntered.
⦁ If a false is returned from the procedure (i.e. data was not entered in text fields), we display error message.
⦁ If true is returned, then we invoke procedure called isExistingBook. The procedure checks to see if data already exists in our list. If it does, we display error message otherwise a join title, author in format of Title:Author and stores it into our list. It also stores this latest data into our database using our TAG variable

Viewing books in ListPicker: When ‘View’ button is pressed, we invoke the ListPicker.Open to show data. This will cause the BeforePicking block of ListPicker to be triggered. Once triggered, we set its elements to listBooks which contains our book collection data. Next, the picker will open showing data:

Data in the picker (image above) is displayed in form of BookTitle:BookAuthor. When a selection is made, the AfterPicking will be invoked. At this time, we take data for the current select, split it at color (:) and assign it to a temporary variable (varTemp) as a list. The list will have 2 items with first item as BookTitle and 2nd item as BookAuthor. The next blocks take item 1 (BookTitle) and set it into text field (txtBookTitle) and will take 2nd item (BookAuthor) and set it into text field (txtBookAuthor).


Deleting books: To delete a book, user can select an existing book from the picker (see above). User can also manually enter title / author into text fields and then click the ‘Delete’ button. Once clicked, we invoke procedure isExistingBook. The procedure (see above) checks to see if book exist in the list and based on that returns true or false. If false (book not found), we display error message. If found, we join the data from text field using color (:). Next we check for this Title:Author and get its index from our list variable listBooks. The result (index) is saved into our temp var varTemp. Next using that index number, we remove the item from our list. We then save the updated list of books into database using the TAG we had defined as the key.

Resetting the database (book lists)
To re-initialize the database and remove all books (reset the list), we have provided a button btnClearList (Clear Book List). The blocks below show hot to reset the book list and re-init the database:

Variations:

Current code does not check for case. Update the code if mixed case is used for book title/author, it would perform proper validation. You could also store all data in upper case prior to storing into list and database.
Download 

 ⦁ Click HERE to download .apk




How can I save a numerical value to a file and recall it to a variable?


I am intending on creating a game similar to the popular Cookie Clicker. I saw a thread asking about how to create an upgrade shop, but I am interested in a save mechanism. For example, I download this app and collect 54 coins. I shut off the app, it is saved, and when I start the app back up, the 54 coins are still there for me to add to. Correct me if I'm wrong, but I thought the easiest way to do it was to save the value to a file, then recall it to a variable to change it afterwards. Any help will be much appreciated.

--
You have two options:
1) Save to a TinyDB.  In this case, you do not save to a file, the TinyDB is internal to and part of the app.
2) Save to a csv file or a text file.    You can save multiple values in a csv.  Retrieve the csv or text file when the app starts and it will have any value(s) saved when you save the file.    Use the File component to read from and write to the file.

--
TinyDB is the simplest, with no delay between asking for the value
and getting it back.

See here for three TinyDb examples.

--
It does not look like you have used the forums yet, as a search using the search box above would have returned several threads about this topic.

Advice: Before posting, it's a good idea to search in this forum. Many others have likely run into problems similar to yours. How to search see screenshot.
Josh replied by eMail..threads are automatically terminated for lack of activity after two weeks... why did it take so long to reply Josh?

Your note:
This seems to be the best idea, but how exactly would I go about doing this? It's not the theory, it's more the work.


As suggested by others, the solution is somewhere in the Forum.

Here is some specific reading material

Tutorials:


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.




How do you do some basic things?    http://www.appinventor.org/content/howDoYou/eventHandling



=====
Lists
Sajal's example    List Blocks On App Inventor

Hossein's example    List & List Manipulation



List of Lists

========================
TinyDB
ABG's example    Build Your Own DB - Part 1   demonstrates filtering

Stephen's example    TinyDB - a persistent data solution


========================
FILE and CSV
FIle and csv's .... another possibility for storing and retrieving you leader board info....here are links to a lot of stuff about them 





You specifically need to read about the TinyDB but probably will benefit by most of this.   Sorry, there is no easy way to explain what you want to do Josh because you have to do it.  This stuff will certainly help.  What have you tried?

--

Font size in ai2LiveComplete


I want to create a text based game that looks the same on every type of phone regardless of its screen size and pixel density. This is currently impossible on the standard version of AI2 so I am waiting for them to update it and add a feature that allows text to look the same size on all phones. However, I was looking at ai2livecomplete and was wondering if it has a feature for font size to be pixel density independent. Does anyone know if it does?

I'm so confused how people are creating apps that work on all phones yet I can't get text so look right on newer high end phones eg Samsung Galaxy 5, Note 4, Sony Xperia Z3 etc.

--
Perhaps Sajal's solution with AI2 ...  Universal Screen Size Using App Inventor

--
That doesn't have any effect on font sizes.

--
The simple answer is no... AI2LiveComplete is based upon AI2's source code... When AI2 gets updated, so will AI2LiveComplete. 

--
I like to clarify. It definitely is based on MIT AI. However it includes some features that are not in MIT AI such as incoming Google play in app billing as shown in my blog below 

--
Yes, but that's NOT what he's asking.  Does AI2LiveComplete now handle for the API4 stuff?  He wants to make an app that looks the same on every device...

--

search results for Sajal's solution


If you are impatient, maybe you can add a special purpose. one shot non repeating disabled Clock to Sajal's solution,. set to whatever number of ...
Perhaps Sajal's solution with AI2 ... http://www.imagnity.com/tutorials/app- inventor/universal-screen-size-using-app-inventor/. Regards,. Steve.
It's not the theory, it's more the work. As suggested by others, the solution is somewhere in the Forum. Here is some specific reading material. Tutorials:.