2014년 12월 4일 목요일

About This application

Ask, MIT app lnventor 2
About This application
Apk made after installation
Press the right function key will

內置圖片 2

You can do this (right function key) it?
Or the (About this App lnvented w .................................. edu) deleted to own text content?







looping mp3 sound files from json file list

I am developing an app in ai2, were the player is playing mp3 files pulled from a json sound file list. I want the files to loop. If I set the player to the property "loop" in the designer, the mp3 file isn´t looped, but just stops after being played once. Is the looping function to be set in the blocks editor and how?



try set Player.Loop to true

Loop
If true, the player will loop when it plays. Setting Loop while the player is playing will affect the current playing.



intranet app


my company will change our Black Berry phone with Android smartphone and I want create one app like a dashboard of my activity.
Is possible with android connect to AS400 db?
and it's possible, always in android, play one query to analyze this db and receive qry output??

I know sql, VB, ecc... and before try to create something for Android and learn java, I like to know  if is possible that I want.
thank in advance at all.

--
I'm not familiar with AS400 databases, but if you can connect to that database from a webpage, you will be able to connect from App Inventor, too
probably this can be done similar to the MySQL interface https://puravidaapps.com/mysql.php
mysql.aia
mysql.php

Como obtener de un numero decimal solo los decimales??? (How to obtain a single decimal number decimal ???)

How do I get a number such as 3.05 0.05 only for use in other matemetica operation ???? no way ???? days ago I'm looking for the form and not the meeting thanks !!!!



Format Number:

http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#format



use the split at block and split at , (comma) to get a 2 items list, 3 as first item and 05 as second item


Help! Calls to a PROCEDURE RETURN with inputs does not have input connectors

Dear admin and community, have you encountered this?
PROCEDURE DO with input works well, but in our project, using:
Windows XP,7, or 8
Chrome (latest version),
any call to a PROCEDURE RETURN with inputs
doesn't have the input connector.
Please help. We need it in our class project :(




that's a bug
use the procedure from the procedure drawer and you get the input parameter


Mail to multiple recipients

Hello,i wish to make my app send e-mail to multiple recipients where the recipients' mail ids will be mentioned in the block section.



Try taking out the question marks (?) from the addresses and putting in semi-colons (;) instead.



still not working bro,only the first recipient got its place as before.......



Also, use mailto: just once, then append the addresses to the first.



again not working dude,may be i am implementing it wrongly.Could you be more clear of what should i exactly do? any pictorial help, if you don't mind.



the activity starter solution can send only to one recipient
see here for other solutions:

Different eMail solutions for App Inventor




That means there is no solution for my problem using app inventor 2? :-(





Sharing game screen with screen shot

I need help for blocks of my game.

I want to use "sharing" component to share a "high score" of a game; by taking screen shot of the game screen (with its high score).

Then I can share it Instagram with game screen photo for instance.

How to take a screen shot of the game screen before sharing?



You have to either take a screenshot using your Android.   Many Androids allow you to do this by pressing the Volume button and the OFF button on the device simultaneously.  Find the instructions for your device and look for something like    take a screenshot .   How you do this on different phones/tablets is different and it may not be possible on some devices.

You can add code in you app to capture the highscore game screen IF the game screen (and score) is displayed within an AI2 Canvas control.    It is possible to save a copy of what is currently in the Canvas.  Once you save that image,  use your Android's Gallery app to share it or you can do some more coding and possibly send it from your AI2 app using the Sharing component.   

Here is Taifun's example of how to save a Canvas:  http://puravidaapps.com/snippets.php#2canvassave  

Try some blocks.  When you get a solution, why not post your blocks showing how YOU did it?



Actually first, I used "camera" component to share players' high score with their photo. 
But instead of this, I want to take a photo of the game screen (see photo below), then use "sharing" component to share to Instagram. 



Thanks for your help in this matter.

This problem is solved by the blocks below:

When share button


Complex variables

I would like to see how to create complex variables or variables made with elements of different type. Maybe the easiest example is the complex number, which has real and imaginary part. In Pascal you use the "record" to create such structure, in C "struct", in Java object... I don't see a clear conceptually way to do that with app inventor. In this way is easy to make the methods or functions that provide math operations of complex numbers, specially if you need a vector (array) of complex numbers.

Another example can be the Quiz. It's needed to keep two separate lists with questions and answers and manage both at time. I think it should be more clear a unique list in which each item contains two elements, question and answer. Also imagine you need a number for each question representing the number of points according difficulty of the question. Thus in this way you need a third list with those numbers. By putting this new element as part of each item of the list you have grouped the question, answer and difficulty level, which is in my opinion easy to manage. 

If you say you could use lists of lists, I don't think this is correct cause each item can have different number of elements and all of them are of same type. What I would like to have is that all items have same elements and these elements can be of different type.

At least I missed something, I'm searching something like a variable block able to contain another variable/s block.



Your "complex" variable could be a list...



Thank you for your answer. However lists are conceptually different from what Im' looking for (maybe it doesn't exist in app inventor). For sure I can work with lists or separate variables or lists of lists as said, but this is different. Basically in a list you can add or eliminate elements. So when you have an array of "complex" each one could have different number of elements and this is not what I want.

Imagine you have a small data base with three fields. You can have let's say 10 rows, 10 items in your database, Each item has same elements, for instance, name, age, favorite_color. For this case the natural way (in my opinion) is build a complex variable with the elements name, age and color and then a list of those complex variable to represent the whole database. For sure you can build the same with separate variables and/or lists of lists but I think this is less appropriate. 



You could certainly build variables like that, with the values separated by commas, and parse them every time you read them.  I think you're trying to make this more "complex" than it has to be.  A list... each element has your three items, separated by commas... 10 items in the list  That's your database of variables... 10 items, of three elements each.



Some people use XML to store multi-part data.
Here's a link to some examples ...

You can do it a little more compactly in JSON, too.

And here's a link to a doc of mine if you want to use lists of lists...



ok. Thanks to all for the ideas and hints. 
Time to check them carefully ans decide what better suits my needs.


Viewer images not showing up

I'm having a problem with App Inventor 2. Images in the web viewer/designer are not showing up and the canvas only fills the screen horizontally even though I've set it to fill parent. It worked just fine the first time I used App Inventor.The app Itself works well on the emulator on my phone, however I want to be able to edit it in the web browser and I can't do that with this problem.




Break in audio loop

Has anyone else noticed that when using an audio loop there is a break in the sound when the loop restarts? It's just a tenth of a second or something like that, but it does happen. Seems like it's an unresolved issue

For reference, this is happening with an MP3 file, in the Player component, with Loop checked off. 



Sal... Scott was probably correct in that reply he made to the other thread.  There is probably a split-second of empty sound in that MP3 at the beginning or the end.  If there's both, combined, they'd make up a gap.  Also, the player has to "rewind" the sound by reinitializing and reloading the sound...



No break in the sound unfortunately, that was the first thing I checked. Interesting on the "rewind" idea. I assumed there was some sort of reinitializing/reload but I wasn't sure if it would have been perceptible when working with such a small file (160kb). 

So if the file needs to be initialized I doubt setting a loop of two audio files would help. That is, the jump from audio file 1 to audio file 2 would be the same as from 1 back to 1. 

Is AI2 able to taper sound off? I could have the volume drop from 100 to 0 on file 1 as file 2 goes from 0 to 100. 

trying not to over-engineer this thing, but the audio breaks are super annoying!



Hello Sal (our names are almost the same, maybe we have some ancestors in common ...)
Try to use 2 player. with a clock you can start the second some milliseconds the end of the player active and than off it.



Good call! So player 1 going to player 2 still has a break in the audio, so more advanced methods are required. Any ideas how to start a player a few seconds into the audio file?



Sal, the reality is that there's overhead... there's always overhead.  AI or any other development language sends a call to the OS.  The OS does it as fast as it can.  But the OS is doing MANY things at the same time, and the call is put in a queue.  In addition, there's a priotiry to the queue, so Android will do it as fast as it can, or wants.



Quite right Enis. I'm just being lazy by relying on loop. I'm going to brew up a timer and figure out a smarter way around it. This wouldn't been a nice way to save myself some time though! 


Viewing TinyDB during testing

I have read the post concerning viewing a TinyBD and that it needs the phone to be rooted, but isn't there a way to view or build a list of the data on a new screen while developing it?

Also, is there a way to completely delete the records in the file?



call TinyDB1.ClearAll  completely deletes the records.

 "viewing a TinyBD and that it needs the phone to be rooted" ...you did not provide a link but that is certainly not a requirement for viewing the contents of a TinyDB.     Load the TinyDB to a List or List of Lists and you can view the information in an HTML table or display.  Simple? No.   You need to coding a routine to show the elements that are in the TinyDB, put them in a list and display them in a label, html table (see below) or in a series of labels; in fact you can make a pseudo spreadsheet by using a Table component and labels though that would be awkward.

See Taifun's Dynamic Table Layout ...   http://puravidaapps.com/table.php        His example uses csv files, but the input could be from a list.

Another way would be to send the contents of the TinyDB to create a csv file...again, you will need some creative coding.  You will be able to view the contents of the TinyDB as a csv file.   How do you do that?   Lots of ways, be creative.



Did this help?




correct, to be able to view TinyDB, which is actually an XML file, you need root access, but to view the data, first get the tags and then loop through the tags to get their values, see also the documentation http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

any GetTags()
Return a list of all the tags in the data store
any GetValue(text tag, any valueIfTagNotThere)
Retrieve the value stored under the given tag. If there's no such tag, then return valueIfTagNotThere.



Once again you guys rock!

This is a big project and AI2 has been able to handle it just fine. I am sure I could do things better but for now it's working.

New line in Textbox and disable keyboard.

I would like to use a component to keep a history of text the user uses in the app with a new line for each text line. I already have multiline turned on. As you can see in the picture I used the ":" symbol I would like to use the "return or enter" function. Thanks!




use \n for new line


location sensor multiple providers

I've been told that for the best location results you want your network and gps providers enabled, is this correct? I created a IF statement: If:ContainText-LocationSensor.AvailableProvders. For  piece can I put gps and network? If one of these options were not available would it provide be location with other option, with out throwing error?



you only can have one provider and if possible, you should use gps for best results


Run time error"BT Admin "

When attempting to connect to a previously paired bluetooth device I get "Need BLUETOOTH_ADMIN permission: Neither user 10092 nor current process has android.permission.BLUETOOTH_ADMIN." 

how to add this in XML file Thank You.



see these threads https://groups.google.com/forum/#!searchin/mitappinventortest/android.permission.BLUETOOTH_ADMIN%7Csort:date


upload apk to google play

I have problem in google play, I can't complete store listing with (7 & 10-inch tabl)
my app designed by appinventor



Yes, this is a problem with AI2 apps presently.    AI2 uses Googles' Android API 3; Google Play does not recognize that apps made with API 3 can run on Tablets (but they can, usually with no issues).   AI2 is getting ready to be able to use API 4 soon that may correct that problem.   In the meanwhile,
this solution might work for you:    Solution for tablets on Google Play by J Martin



Thanks SteveJG



Solution for tablets on Google Play by J Martin


Can you boost quality of app?

I was wondering if you can "boost" the qaulity of an app in app inventor....
My app looks pretty pixelated, and low quality, but maybe it's because I just recently checked it out with a tablet. Does is have better qaulity on a phone?
Also, the little bar at the top of the screen, looks REALLY unprofessional, and has very low qaulity... Is there any way to remove it, or boost it's qaulity?
One last question. can you make your icon multiple sizes, so it i suitable for most screens (hdpi, xdpi etc.) ?

ANY HELP PROVIDED WOULD BE GREATLY APPRECIATED!



ad 1: App Inventor and the Screen Size
ad 2: use App ToMarket to remove the title bar
ad 3: see here Solution for tablets on Google Play by J Martin

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.
 


Listpicker alternative with App Inventor and jQuery Mobile including a Search...


After installing the application (.apk) push button "select item" or "show
search filter". A message appears: "web page not available".
Where it should be listview.html file? After it opened in the browser google
can not see anything.
The blocks are two links:
file: file: ///mnt/sdcard/AppInventor/assets/listview.html
file: file: ///android_asset/listview.html
Should I do something about them?

--
see again the installation instructions:
Before building your app, set the flag "development" to false.

--
I think I have a similar question. I'm trying to create a search box, where the user enters whatever text they want. Then the search finds this text in the "database" for example you're searching on a particular name (but you don't know which names are in the database). So you want the search text to match the text in the database. How do we do this?

This is what I have so far, but the block logic set to "true" I don't think this is correct. Do we need JQuery for this and what do we do with it?



--
I think I have a similar question
no, you have a completely different question, this thread is about https://puravidaapps.com/listview.php

just define a small example list and try how the filterbar works...

Accidently deleted my screen can someone somehow get it back for me?

Hi I accidently deleted my screen with all my work on it The project is called: Voetbal and it was screen2 I tried to get it back but wasn't able to would be really nice if someone could help me cause i got a backup but its way to old and I chanced alot of things and it would cost me lots of hours to remake it.

For our App Inventor Tips, visit TwoDogApps.com



The person that has the ability to retrieve these projects from backups is extremely busy right now.  I've forwarded this on to him.  This will only be done, if possible, once.  It's YOUR responsibility to back up your work.



I know it was stupid from me that I dont have multiple aia files but I am new to this program and was really happy with what I made untill now. I understand that it can take while I will be patient but it would be really nice if I could get it back somehowe. I still have the app on my mobile divice is there anyway to get it back by that?



No, there's no way to get it back from the installed app on your phone...

Thanks for changing your display name.

Hopefully, he'll be able to get back to you later today, tonight or tomorrow.  It's specialized to get into the backup and retrieve a project... 



If you really deleted the Screen, it is most probably gone forever unless it appears on an MIT backup file.  When a user deletes something on purpose, what you have done is told the MIT server to delete it.   I suggest you reproduce that screen from scratch and start now if it is real important.   Perhaps you will be lucky.

Saving aia files often, saving the Projects > Save project as... are tools to help you.   When a developer gets tired, they frequently do ridiculous things..AI2 has NO UNDO capability.  At the point when the developer does something he/she regrets or a rare glitch happens in the Google Cloud, your PC's memory etc., a saved aia  or a backup project (a copy of your project with a different name) on the MIT server are your friends.

Good luck, perhaps you will get a recovery.


Custom Google Map App to find specific products in selected stores


I desparately need help with building a section of my app. I have a sell soft drinks and have mapped the locations of stores that stock my product on a google map. I have also added a description to the pin so that people know exactly what products each store stocks. I would like to put this google map onto my app so that people can open the map, find the nearest store that stocks my products and navigate to it from their current location.

Please can someone assist me. I am still very new to MIT App Inventor and need to get this app up and running quickly. I would greatly appreciate the help.

--
You are going to have to share a lot of information to get help Matt.  Mapping and doing things with Google Maps as you describe and be VERY complex and there are many ways to use pins.

You created a map, did you do this using https://mapsengine.google.com/map/   or did you create it as a static Google Map  or as a Fusion table map?    It makes a huge difference in which path you need to follow to accomplish your goal.

Show a screen capture of your blocks and ask a specific question and you should get some advice.  Be aware, what you are attempting is VERY difficult to do all the things you want with App Inventor 2.     Google has a Business Map API ...you might be able to use that and ActivityStarter to do some of what you want...you have to pay to use the Business API.    Are there ways to use pins without the Business Map API?   Yes, and you might be able to some of the things you want to do with AI2.

To do all of the things you want to do, you should be coding with a professional, compiler; like the Java based, free Eclipse or Android Studio.  These tools have established libraries for working with maps.   Can you code something with AI2, certainly.

--
refer to: FAQ for maps

--

Some Traditional Chinese Traslation Problem

Can correct this translation problem?
In TableArrangement Component Properties Windows , "Rows"  must  translate to  "列數","Columns"  must  translate to  "行數".
Now exchange these two word.




This should be fixed in the new translation server. 



Thanks you for pointing this out to us. I will create a ticket and get it into the translation server queue.



Fixed on server. 


Litte question about AI

Hi, i'm here for asking you something. I'm discovering AI and for a school project i need to send a wifi information to a switch (i can explain in details my project if you want) with my app. So, can i send a wifi information with AI ?



What sort of switch are you trying to trigger?? Arduino?  WHat software is on the receiving end of the sent info?



You can communicate with outside devices with AI2 by using Bluetooth protocol.   FTP is not supported.  What is available using Bluetooth is here:


appinventor-java-translation : is it still working?


I'd like to convert an app invetor project to java so I wonder if this project is still working on current app inventor '2.0, https://code.google.com/p/appinventor-java-translation/downloads/list ?

--
This is a utility to work with App Inventor Classic and is not a MIT tool.    The tool most probably does NOT work with App Inventor 2.  To find out more, you might try emailing members of that third party project's  Members ....  see this link:  https://code.google.com/p/appinventor-java-translation/


JoshuaS3... is the owner of that project on

--
We started that project about 3 years ago on the Classic version, and have not updated it in over 2 years. 

Sorry...

I am not sure if the Java Bridge still works (maybe just for the Classic version), but that is a way to write Java code targeting the App Inventor components (much easier than traditional Android SDK). Our project just generated the source code for the Java Bridge after analyzing the saved zip of an App Inventor file.

--
1. Ok, I can convert AppInventor Classic project to Java with App2Java converter. Will be this converted recompiled project runs more faster rather then apk compiled in AI Classic?
2. Which functions of AI Classic can be recompiled to java project without troubles and problems? All of them are supported?
3. Can I probe to convert AI2 project to AI Classic?

--
1. The way to find out if the recompiled project will be faster is to convert to Java, run the project in a Java compiler and test.   What did you discover Sasha?
2.  To find out what problems  just do the conversion.  The reported issues with that tool are here:  https://code.google.com/p/appinventor-java-translation/issues/list
3.  You can not convert an AI2 project to AI Classic without rebuilding the AI2 project with AI blocks.  There is no conversion tool for AI2 to AI (and probably never will be one).  A conversion tool from AI to AI2 is being worked on by someone as reported several months ago; however that tool is vapor wear...The last anticipated date for release was yesterday and it is not available and might not be available until the development team finishes debugging the AI2 Android API4 version (which is being tested internally now to eliminate bugs).

--

How can I change the image of a button when clicking it and play a sound?

Hi all, I´m new to app inventor. I need some help for a school project. The whole project consists in making an image say something random every time you tap it. However, I want the image to change when it`s tapped and play a sound according to the image that appeared. I would appreciate some help here. Additional information: I just have 2 days to finish this project.



What have you tried so far?



I tried some blocks at the "logic" section but they don´t play the sound. And I`m not sure if the "join" block of the text section will work



You'll have to make a list of text and images.  When you tap, you change the image and the text.

Sounds to me like you procrastinated on this project for school, and are now cramming to get it done!

First, have you done ANY of the tutorials?  The tutorials are located here: http://appinventor.mit.edu/explore/ai2/tutorials.

You probably want to use text-to-speech to "say" the text, and just load the image to the button.



Thanks for the tip. Yes, I already did some tutorials. I would ask for a complete "tour" if I hand`t checked them. May sound like too much for just a school project, but one of the things graded will be how complex the app is. I would prefer to use my own voice for this.



If you're going to use your own voice, you'll have to record the sounds, and then add them to the project as media.  However, you have a 5MB cap so your samples should be the simplest, low level quality if you plan to have many.  I suggest you read my tips below because you'll run into problems if your stuff is too large.  Also, you'll need to use the Sound component to play the text recordings, as long as they're short.



That`s already done. The lines are already recorded, short and have low quality. They are also imported and set as sounds. The same goes for the images. I only need help at the "blocks" part.



I don't understand where you're lost... Button.Click.  Change Image, Play Sound



Thank you so much for that. Now I just need to find a way to make it pick from a random list. There are 6 different image. Each one has an own sound.


AppInventor adb.exe 'unable to start correctly'

We've been using AppInventor for a few weeks but we're suddenly getting an issue with trying to connect to the emulator from within Firefox.

aiStarter loads up fine and is listening on 127.0.0.1. On connecting to the emulator from the browser, we immediately get the error message "The application was unable to start correctly," on adb.exe.

Inside the aiStarter window, we get the following text:

127.0.0.1 - - [03/Nov/2014 15:01:56] "GET /echeck/ HTTP/1.1" 200 30
127.0.0.1 - - [03/Nov/2014 15:01:56] "GET /start/ HTTP/1.1" 200 0
Problem checking for devices : status -1073741790


Re-installing the package corrects this issue, but I don't really want to have to do this each time in case it re-occurs in the near future. It would be nice to know what is breaking it in this way..



Did you install the setup tools in the default directory or a custom directory. FYI I am working on a new setup tools package that will solve several problems people are having. 


Αdditional Space We need 3mb more


Hello my friends, We are students from Greece and we have problem with our app. We need additional space about 3mb cause our app includes all of information and photographs
We hope to figure out our problem as soon as possible.
We would like to thank you in advance for providing information to us.(If it is possible Always) 
...........
...................__
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯∖
........('(...´...´.... ¯~/'...')
.........∖.................'...../
..........''...∖.......... _.·´
............∖..............(
BROFIST ...........

--
Please read Enis' suggestion for When AIA is greater than 5Mb....    http://twodogapps.com/?page_id=686  It has suggestions.

--
You can use AppToMarket utility to repack your apk.
My AI2 apk has size near 28mb, but after AI2 I get apk near 7mb. I do not put in project original big files!
In my project I use various big jpg files for any screensize(4:3, 16:9), mp3 files as soundtracks and speechs (you can see this game at https://play.google.com/store/apps/details?id=appinventor.ai_test.ukrchess This project now only in Ukrainian, but this game simple to understand and you can test it). 
How I get this result?
In AI2 I use fake files with small size. As example, mp3 file with 32kb size instead of original 5mb-sized file.
After unpack project I copy all aoriginal files instead of faked files with original filenames...
Pack it and profit!

P.S.: AppToMarket can correct Android manifest of your apk to fullscreen mode!

--