2014년 12월 3일 수요일

Out now! Small game - NoOt Amused

I would like to share a game I made with App Inventor. Some of the people from these forums have been very helpful, answering the questions I had while developing it, so thank you.
I'd appreciate the feedback, and as always, share it people! :)

https://play.google.com/store/apps/details?id=appinventor.ai_valentina_chrysostomou.NoOtAmused


how to set up my Database?

I have a question that I like to create app where use will be getting entire ACT details once use select listview item "ACT".

I am bit a confuse as to how to set up my database in TinyDB. Kindly advice because ACT is having good amount of text data so how & where it should be stored?



=====
Lists

List of Lists


TinyDB







Thanks SteveJG!

Please guide me how to store 10 lines text into tinyDB.



first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.htmlto learn the basics of App Inventor, then try something and follow the



Thank you Taifun Sir!

I know I am new to App Inventor 2 but I have gone through available resources on the net & still got confused with my query.

I am creating app which loads complete ACT on the mbl & i am confused about how to upload that big text data into csv format.

Please advice.



ALLER FAIT BOUR AOU


Question about the resolution

Hello, sorry for my bad English, I'm Franch. I want to make an app for 1080p smartphone, but when I choose horizontal or vertical arrangement, and I set a number of pixels, the app I develop in app inventor doesn't correspond to the resolution of my 1080p phone. So all of the elements are shifted compared to AI.

So my questions are :

  - Is there any solution to set the resolution of the editor in AI ?
  - If not, what's the resolution of the editor in order to correspond it with 1080p ?



Instead of setting pixels, set the width / height as a proportion of the screen size.

See here -http://www.imagnity.com/tutorials/app-inventor/universal-screen-size-using-app-inventor/


How can i publish my apps in Google Play without paying?

I can't pay for it so is there any way to publish apps without money?
For example using a big company(as a developer) maybe?



I think Google requires a $25 payment...but there's probably a better place to ask this question than in the App Inventor forum.  Might I suggest searching Google Groups for a Google Play forum?



Andy... There's a $25 registration fee from Google.  After that, you pay only their percentage, and that $25 covers all you do...



Be aware, you can distribute your apps without charge by following these instructions:
You can email the app (".apk" file) to your friends who can install it by opening the email from their phone. If you want to distribute it more widely, you can upload it to a website that both you and your friend can access. 
NOTE: Anyone installing your app (which is an ".apk" file) will need to change the setting on their phone to allow installation of non-market applications:
To find this setting on versions of Android prior to 4.0, go to "Settings > Applications" and then check the box next to "Unknown Sources". For devices running Android 4.0 or above, go to "Settings > Security" or "Settings > Security & Screen Lock" and then check the box next to "Unknown Sources" and confirm your choice.
Google 'charges' the nominal fee to help ensure the 'quality' of apps on its 'store.'    It is a one time fee (at least at present).  If you anticipate selling your app, and it sells more than 20 copies, you probably will recover your 'investment.'   If this app does not 'sell,; write another one that might.   If you want to make it available for free, you probably can submit it to  http://gallery.appinventor.mit.edu/#page%3DHelp    he MIT App Inventor Gallery is the main site for sharing your App Inventor apps and checking out the apps and blocks of others. It is like Google Play, except open source-- all of the uploaded apps have source code (blocks) that you can study and remix! Think of it as one of the greatest open source learning studios ever created.

Is this what you are looking for?



If you can`t pay to Google. Then you can use alternative free app stores:
Samples:
etc. etc.



I would also suggest, using a different store, although PlayStore is probably the best.
You can use, Amazon, Windows, and Aptoide.

Hope this helped!


login message

Hi there..i´ve got a problem trying to join http://ai2.appinventor.mit.edu to continue doing my app. After give my ok to a TOS , browser says :

Error: HTTP method GET is not supported by this URL

I´m using Safari 7.0.6 on Imac

Can someone help me please? need to continue doing my app.


deleting from tinyDB?

Hey guy's,i have a small app that stores clients,and lists all store values to view.

once im in the view i can't seem to be able to delete the item..

if i have a tag called txtName so i but a button clear tag=txtName

but seems to work but the main tag stays in the list when i load it it says error nothing to load but the tag name shows in txt box...

 i tried also clear all tag..but no success




You're using two different things for that tag... you're getting the name list first in screen,initialize.  That's OK

Then, in After.Picking, you're doign way too much work for no reason at all.  Get the tag from the TinyDB ONCE... that will go to a lit.  Once it's in the list, set the items to the items in the list you got from the one call to the TinyDB.  Calling it 3 times is silly.

You show the button1del.click, you show that you're clearing all tags... Not sure why.  In any case, if you want to clear the ONE tag, you have to HAVE that tag in the TinyDB.  And I see where you're saving the tag.

BUT... In After.Picking, you have to refresh the global nameList with the contents of the TinyDB, which are now different than they were before...  

Also, read my tips from the links below, and read the section about redundancy (probably a good idea to read ALL of the tips!):



Error Compiling .apk

I get the following error when compiling. I have over 1000 blocks on this screen, is that why? Any workaround?


App Inventor is unable to compile this project. 
The compiler error output was 
________Preparing application icon
________Creating animation xml
________Determining permissions
________Generating manifest file
________Attaching native libraries
________Copying native libraries
________Attaching component assets
________Compiling source files
(compiling appinventor/ai_flyoffacliff/ifit4/Screen1.yail to appinventor.ai_flyoffacliff.ifit4.Screen1)
(compiling appinventor/ai_flyoffacliff/ifit4/About.yail to appinventor.ai_flyoffacliff.ifit4.About)
(compiling appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail to appinventor.ai_flyoffacliff.ifit4.Manual_Control)
ERROR: appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail line 13: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
ERROR: appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail line 13: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
~~~~~~~~
ERROR: appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail line 13: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
ERROR: appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail line 13: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
ERROR: appinventor/ai_flyoffacliff/ifit4/Manual_Control.yail line 13: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
Kawa compile time: 2.463 seconds



Perhaps?

One of the following  possibly applies to your code (all may not apply to your code):

1)  You have coding errors in your blocks.  In the Blocks editor, look in the lower 
left corner of the window for the yellow and red triangle icons. If the red icon has a value larger than 0, 
you have a serious coding error.  Find the block in your code that has a red triangle and 
fix it.   Red triangles always inhibit creating an apk or running a project in the 
emulator or possibly creating an aia file.     Yellow triangles are more forgiving, 
however, sometimes, these need to be fixed because they trip an internal warning and not billing puzzle piece sockets are left un-filled.

2) Your source file (the aia file) is larger than the 5Mb limit allowed in AI2 (the aia can not be larger than 5Mb). You may have put images or other resources in your Media (resources) that you do not use in the app. 
 All the images and sounds in resources count toward the 5Mb limit along with the souce code.    You can program 
apps larger than 5Mb in the browser, but the apps will not compile and might not run in the 
emulator or the project may not save as an aia. If this is the case you need to reduce 
the size of your image and/or sound files.   Most image files can be made quite small 
by resizing them using a photo manipulation program on your PC to less than 50Kb each.

3)  You might have more than 10 Screens in your app.  AI2 becomes unstable when more 
than ten screens are used.  Projects CAN be built with slightly more screen but then you should expect your app to occassionally behave erratically.

4) You might have set a Screen icon in the Designer Properties for your project that is too large. Use an image 
sizeof 48x48 px or 96x96px instead and only use jpg or png images.  *.ico files are not 
supported.  The 'icon' (actually an image) can be as large as 520x520 (I think that is the size GooglePlay apps require).  The smaller 'icons' work fine otherwise.

5) You did not code the entire project using App Inventor 2.   If you used one of the 
third-party AI2 clones,you might not be able to load a Project into the AI2 compiler or 
create an apk with the standard AI2.

6) If you incorrectly modified the project's Manifest files using a third-party tool, you may have issues.

7)  Sometimes, if you have LOTS of Layouts on a single screen,  the apk might not 
compile. How many is a lot?  I do not know, keep adding layouts and buttons, compile and try again...when the server crashes, you got a lot.

8)  The network you are using may be overloaded (possibly a school network), or you have other applications running in the background on your computer, or your virus checker is doing a scan.  Sometimes, just trying to access the MIT server a few minutes later will give you a more favorable response.

9)  If you have BlueStacks on your home PC (BlueStacks is a special emulator that allows Android apps to run on a PC).  The Google emulator on AI2 cannot run unless BlueStacks is disabled and all of the BlueStacks processes are shut down.  On a Windows PC, you use the Task Manager to 'kill' running processes.

10)  Are you using Sensor controls (except for the clock)?   Most Sensor controls or controls related to sms or the phone do not work in the emulators.  They need to be tested on a device.

11) If this is an issue about the Project loading slowly on your device or on the emulator:  Be aware, the more images, layouts, components you have on a screen, the longer it takes for the emulator and Companion to render the graphical screen.  How fast the emulator renders is partially a function of your hardware...how much ram you have, your cpu clock speed etc.  Can you develop live using WIFI or using USB? These options almost always render faster than the emulator but will not be at lightning speed if you have lots of graphics.  Be patient.

12)  This happens too:   We have see instances where it is probable the Google Cloud messed up; other instances where an older PC has had memory issues and caused file corruption of the Project and instances where a user is using a very slow Internet connection (like dial-up) and it is just too slow.

13)  Do you have an AVG, Eset or AVAST virus checker.  Some versions of these products have been reported inhibit running the emulator unless (in the case of AVG) the Advanced Link settings on the software are set to allow AI2 communication.



Whatever the problem, it's in your manual_control screen.  Something there requires 4 parameters, and you're only supplying 3...



Thank you for all the tips. I think I figured it out. Is there anyway to get around the 5MB limit? I really need 8MB. Is there a third party clone that supports larger? 5MB is tiny, Google Play allows up to 50MB.



Read my tips below on the 5MB limit:




Thank you. App Inventer might be okay for smaller projects, but I think I am going to need something more powerful for this. I need 200 sound files and over 1000 blocks. AI2 is bogging down my $2000 PC. I know the basics of Python but not Java, which is what Android uses. Can I export what I have done in AI2 into android source code and try to work on it in Eclipse? Any other ideas?



How many MB do these sound files have altogether?
You can always use a personal server and build your project on your own build server...

1000 blocks is not very much, but probably you have a lot of redundancy in your blocks? 
how many Player components do you use?
see also Enis' tips. 
A screenshot of some blocks could help us to help you...



Realistically, an Android phone is NOT a computer; an Android Tablet is NOT a computer.  Depending on the device you use, the cpu's on different devices have different clock speeds, the internal system memory has limitations.  If you get your app to run at lightning speed on a high end device, it will become a slow poke on an inexpensive device.

Apps coded in Eclipse, Android Studio, and various other languages will all have advantages over most AI2 apps in the speed department; especially if the app is doing mathematical operations.

Bogging down your computer?   If you are running the emulator, slow execution is to be expected.   Have you compiled your app and run it on a device.  Generally the performance will improve dramatically.    Is your issue slow compile speed?    Android Studio is not particularly fast. With AI2 you can write code faster than most Java programmers, it is true and code compilation is generally fast.

You said "I can't even copy a 1.7MB .aia file." ..., that probably means you are doing something wrong?     Have you tried non-live coding?   You do NOT have to code live to a device or an emulator Ben.    


Help with a school project.

I'm creating an app for a school project. I need to figure out how to keep records (or logs) in the memory of the phone so they can be displayed in a table. I also need to know how to make an app interact with system settings, primarily vibration and sound, in order to disable them. Any help would be appreciated. 



use TinyDB and the Activity Starter, see also the documentation

first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.htmlto learn the basics of App Inventor, then try something and follow the


How can I use 'list from csv table'

i try to program a vocabulary trainer app with MIT APP Inventor 2.
The words are in a csv-file.
I have upload this file to the Media Box.
How can I get the words in a list to work with them in the app ?
Do you know an example for this ?
Shall I put the english-words in one csv-file and the german words in another, or is it possible to get the englisch word and the german word from the same csv-file ?
How have I to use the "," or the "/" in the csv-file ?



use the file component and the File.ReadFrom block, then in the File.GotText event you get the result http://ai2.appinventor.mit.edu/reference/components/storage.html#File

probably it's easier for you to use 2 files for each language, e.g.

apple
banana
cake

Apfel
Banane
Kuchen

if you want to import a 1 column csv table as in this case, I recommend you to use the split at block and split at \n (new line) to get a simple list of the words


Simple way to extract JSON from uri ?

I have a uri that in a browser shows json text. Do I need to parse the json in order for my app to read the json? Is this consider extracting json from uri ? Examples of extracting the json from uri please? A simple answer would be great!



Found this: https://www.youtube.com/watch?v=lKZnJe4MGKs

Think this will help me






Nice tutorial video!
Thanks for sharing it!


Malware on not malware ... :)

HI!

I made a software what is called ALL_IN_ONE ...

It send and recieve SMS and USSD code.
Open CSV file and read it.
Write a LOG file some data ...

My colleguage install avast in his phone and openned my software ... :)

Is it true ?


Robert




please report this false positive to Avast, see also here https://groups.google.com/d/msg/mitappinventortest/e8eWVrRLDIk/jREBA_QHTf0J


What is this button?


Does anyone know what this button is as an AI2 button?



initialize global MoveRight to  false

initialize global MoveLeft to false



As Steve wrote above... they're variable definitions, not buttons.


i cant save the apk file!!!

i cant save the apk file!!!



And, why not?  Are you getting error messages?


Polyglot - make your app bilingual or multilingual

Polyglot is an app and a tutorial demonstrating one way to make your app bilingual or multilingual using AI2.

The tutorial is at:



Very slick Steve...


CSV to Listpicker


I´ve created a simple database using fusion tables in AI2.
I´ve adapted the pizza party tutorial and now i´m trying to update and delete the values in the table.

I used the "fusioncontrol.getrows"-component to extract the columns and values as csv (i think it´s a csv).

The result looks like this:

col10,col20,col30
val1-1,val2-1,val3-1
val1-2,val2-2,val3-2

I would like to use a listpicker to show the table like this:

------------------ 
col10 = val1-1
col20 = val2-1
col30 = val3-1
------------------
col10 = val1-2
col20 = val2-2
col30 = val3-2
------------------

.....and so on.....

I think i have to extract the columns and the values somehow into a variable to create/fill the listpicker. But i don´t know how...
Can someone please give me a thought-provoking impulse?

--

Try changing csv to array (list) and then selecting item at position x, and then joining the two arrays togather.

Something like this:

join position in list array1
               position 1
join                       = 
join position in list array2
               position 1
join position in list array1
               position 2
join                       = 
join position in list array2
               position 2


And so on,

--
Thanks for your post. 
I don't understand that. How can i change the csv output to array?

--
http://appinventor.mit.edu/explore/ai2/support/blocks/lists.html

list from csv table
Parses a text as a CSV (comma-separated value) formatted table to produce a list of rows, each of which is a list of fields.
Rows can be separated by newlines (\n) or CRLF (\r\n).

--
As result to the csv->"list from csv table" i get ((col10 col20 col30) (val1-1 val 2-1 val3-1) (val1-2 val2-2 val3-2)).....
I´m not sure what to do with this....

--
It is now a list (array), use 


with the list as the name of the list and index as 1.

Next use the "join" block and below add a text box that says " = "

Add a third join section by clicking the blue sqare (mutator block) and dragging the "join" from the left and place it under the already existing "join" blocks (if this makes sense)

As previously use the select list item with the list as your 2nd list and index as 1.

This should make col10 = val1-1

Add more text or change it as required.

--
see the prepaareListpicker procedure here https://puravidaapps.com/fusionDB.php#select to get an idea how this could be done

--
Have you seen 
?

The UPDATE and DELETE queries let you 
change the fusion table directly, if you can build up
the proper query as a text string.

You might need to add extra fusion table objects in the Designer
for different phases in the UPDATE and DELETE process, like getting
a ROWID for later use in an UPDATE or DELETE.

--
Yes i´ve seen it.
At the moment i´m trying to write the rowid in a column named "RowID" for later use.
But it did not work.....

As result of the "send query" i´m getting "rowid\n 12001\n", from this i tried to remove rowid\n and the \n after the rowid itself (the \n ist not really there but the...idon´t know the word...it´s like someone hits enter after the words... :-))

then tried to update the send-query and "update" it right after the "insert"

I´m a newbie in AI2 but i like it very much. Now trying since monday to solve this problem...

See pictures for my blocks...maybe you see where i am wrong.



--
Take particular attention in Taifun's example
how you don't try to extract the rowid until you are in
the event handler that returns the rowid.

Don't assume the rowid will be instantly available.

--
Thank you very much! The "select item list->split at..."-Block helped me out!

I´ll try it now with that and let you know if it will work for me

--
i tried it with the update procedure but it won´t write the rowid in the RowID column in my fusion table.
The UPDATE-SQL-String looks good....but it won´t work....
On screen initialize i set the api-key of the fusion.control2 to the same as the fusion.control1.

Edit: Never ending story....As result of the second fusion.control i get "403 Forbidden Daily Limit for Unauthenticated Use Exceeded. Continue use requires signup."

--
Found the error by myself.
Created a second api-key and set it at the update-procedure.
Then i´ve got a "bad request error..." because i had named one column "RowID". When you set column names to reserved word you have to quotify the column name in the query. (thx taifuns "FAQ´s on FT!!)
--
Exactly what are you updating?
You are setting the row id to itself?

The row id is the LAST thing any one would want to update.
You usually update another field that is dependent upon the row id.

--
what ABG said...
and: why do you need a second api key? this does not make sense.
If you like to connect to another table, another tableid (of the new table) would be sufficient

--
thank you very much for your answers.
I just wanted to create an app to use a fusion table as an online inventory. 
I just need to edit columns (Product, Manufacturer, Quantity) just like your sample an your webpage, Taifun.
But i think it´s to difficult to me.....
INSERT is no problem but UPDATE and DELETE is a little bit too tricky for me....

--
let's assume, you like to update the Quantity of a Product

the first step is to get the rowid of the Product you like to update with a SELECT statement like this
SELECT ROWID FROM< tableID> WHERE Produkt = productNumberOfTheProductYouWantToUpdate

you get back the rowid as described in this example https://groups.google.com/d/msg/mitappinventortest/JBPLDUJhEM8/4ZXUfIEv0b8J
the second step is to do the UPDATE
UPDATE <tableid> SET Quantity = 42 WHERE ROWID = rowidFromStep1

That's all...

--

How to make a limiter in App Inventor?

Hi does anyone knows how to make a limiter in app inventor 2.

In my text box you can only put numbers 0-50. But I have know clue how to do this. 
And also if that Place is full it needs to notify the main screen on that building that it's full.

Could somebody help me please?



What have you tried?

Read this chapter   http://www.appinventor.org/Chapter18     about how to use the logic blocks.  It is part of the  AI2 free online eBook  http://appinventor.mit.edu/explore/ai2/tutorials.html   ... the links are at the bottom of the Web page.

You can limit the values you can have in a TextBox using this technique.    Use an  If then ...else   block  for the 'building is full thing'.    You will need to pass a variable from screen you are on to the main screen.   Most people would put a TinyDB on both screens,  make a tag 'IsFull' or something like that and place a Boolean global value there   (this means save a true / false condition).

Try some blocks.  Show what you tried if you get into issues and someone probably will help here if you post.



You need a timer (clock) component) that is disabled until the text box gets focus, at which time you should enable it.  In that clock.fired event block, as Steve said, use an If Then block from the control drawer and either reset the value that's in the text box, or put up a notifier to warn the user that the value is wrong, then blank out the text box and let them try again.  Of course, you can also use a ListView and let someone choose the number from a list, rather than allowing them to type it in.

You should know, from your own code and data, if the building is full BEFORE you let them go to another screen.


How to Change the size of a downloaded jpg picture to fit screen

My app downloads .jpg files from a server. some are bigger than others. How can I resize them to fit my screen?



Use a good graphics program and resize them...