2014년 12월 2일 화요일

Not understanding some components

For the most part I have this app inventor understood. Just not seeing the components needed to set my app up. Trying to make this simple as can be nothing else. This is what I am trying to do. Lets say I am going to church. Church last for 1 hour and 30 minutes. Normally I would set the phone to silent mode then turn the ringer back on after. What if I forgot to turn it back on afterwards. So I want to make an app that sets it self up like a reminder to turn on the ringer or increase the volume half way automatically. Is there a way to do this on here? Hopefully I made sense, if you have questions please ask.



Understand Joe.   Unfortunately you can not use an App Inventor to use as a reminder to do or set a certain event or phone setting at a certain time unless the app is already running.  App Inventor apps can not run in the background (what your app would need to do).  There are 'tricks' to keep the app running continually, but that is not going to work in your situation (you would run the battery down very rapidly).





CSV file Import into android database

I have problem, I want to import a CSV file into the Android Database. So I want that providing the address location of the file in the device I import that file into the database of the application.



Could you please specify a bit more explicit about what you want and what you tried? Do you want to store the contents of a CSV file in a TinyDB? Or maybe a Fusion table, or a TinyWebDB?
Did you do the tutorials about reading files, working with lists and storing data into various types of databases?
If yes, come back and post some blocks of where you are stuck.



use the file component, see also the documentation http://ai2.appinventor.mit.edu/reference/components/storage.html#File
then use the list from csv table block to convert the csv into a list of lists and store it in TinyDB

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 instance /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 applications private storage (for packaged apps) and from /sdcard/AppInventor/data for the Companion.

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.


Texting Issue (URGENT)

I've a problem when sending sms from my app. I have a custom message, it has a link and the adress obtained from the location sensor, and it is supposed to be sent after a phone call in an sms using the texting component, but when the message is sent it "breaks" I mean it sends one half then the other sendind 2 sms instead of one, what can I do? I'm really desperate and there seem to be no information about an Issue like this one anywhere. This is the code I have so far:

<img style="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAc8AAACFCAIAAACyruTCAAAgAElEQVR4nO2d+VcUV5//+3+YH77neZ5vxlGjWYy7aKLGDBoNikECRCMPq+
~~~~~~~~~~~~
SKq0uK0Sh4n1xW2NKS1q1ZxhbTlSe9HpH4eXXuIvx4w2L2NJ+XBhP/nxc9AW68LFWsSY5aFlifiV0lkdcaX6gNfqOK/KKZaFR9VkxmnVcbUZmnPn6jL20ALcs8Urkjavy7SVM/uUjm9BjDYM/xpylf4gJPJwn+K
...



SMS, like Twitter, has a limited number of characters.  Look at your phone... send a long text message to someone, and you'll see that it's breaking that up into separate messages.  It sends it as a whole messages, but has the breaks so that a phone with that limit can receive the message, in several chunks.

How many characters is your message.  I believe that 140 is where things start breaking up...



My message is only 90 characters long. And as long as I've tested my phone can send up to 160 characters long



Have you tried your app on various devices?



Those are the screenshots to my code, I don't have any \n I tought at first it may be it so I removed them to see what may happen and instead of breaking in 4 parts the message now breaks in 2






Post the blocks that make the complete text of your message...



Im sorry the first image was an old one






Those are all very nice, but they don't show me what I need to see... I want to see how the ENTIRE sms message text is created.  That's got to be where your issue is...



This is the entire message I'm trying to send:

"Mr X has called for a Taxi at the address: (your current location's address or the No address Available string)https://www.google.com.mx/maps@0.0,0.0 This message was provided by Guardian Angel"

This is the complete message I would like to send in at least 2 parts, but with this length the message breaks in 4 parts.



In that address, is there a line feed after the street address?



There is a limit to the character count of a sms message you send.    Sms allows 140 bytes:  this translates to 70 16 bit wide characters (non ascii languages); 140 standard ascii characters; or 160 7 bit ascii characters.  The character count is determined by the mode you send the data.

Frequently, if you send the LocationSensor.CurrentAddress you may exceed that limit or if you send all the decimal places in the lat/long  without parsing the result.    Look at the DoIt result using the AI2 debugger to see what is actually happening.


Emulator and web connectivity

First day and first try at this. I need some advice. I have set up a button and on click I want it to go to a web API and this will return json data. I then want to display the json data in a listbox. I think the blocks I have put together work but the emulator gives me nothing. I am not sure where to go:

1.Does the emulator connect to the web as normal
2. Is my coding correct

If someone can help it would be very much appreciated. I am not sure how to upload the project so here is what I have set up:

One button, one web component, one list box

Button on click event it runs the following
web1 set url to (my url)
Call web1 get (definitely needs a get request)

The url is tried and tested and works well to retrieve json data from a web api

When web1 got text event
set response content to call web1 json text decode listview1 elements



Close. You need to get the ResponseContent, not set it.

Set listview1 elements to json text decode get ResponseContent.

See the stock quotes tutorial http://appinventor.mit.edu/explore/ai2/stockquotes.html



Does your 'Company network' have a firewall?  Talk to your IT person, you may have  firewall issues regarding port 8004 ... if that is blocked, no emulator.  

If you are on a company network, be aware, firewalls block lots of AI2 communicagtion paths and cause activity issues.   It is not possible to use AI2 for all functions if you are using complementary Internet use from most hotels, restaurants, hospitals, schools etc.  Their firewalls block the ability of AI2 to 'talk to itself' ... that is use the emulator.  You may be able to 'build blocks' but you may not be able to 'live test.'

That may be your issue.



set listview1 elements to call web1 json text decode get response content 



> Close. You need to get the ResponseContent, not set it.
> Set listview1 elements to json text decode get ResponseContent.
> See the stock quotes tutorial 

Many thanks I looked at the tutorial and got what I needed, it is working now. SteveJG as far as firewalls yes we do have but as I am in charge of them I have no issues in using the software but thanks for the message.


Jukebox app infringement terms?


hi all, you can create an app that is a jukebox-style music and usepages that have that music on their server.

I explain. the application would work as a player of songs that can be found on any web. Might just listen online, download anything to do.

it will be violating any rule with this type of application.?

--
You would have to check with every web site from which you want to download music.  Downloading music is a pretty touchy royalty based area, ans it's heavily protected.  It doesn't violate any of the MIT terms of service that I know of, but it IS up to you to have the proper permissions or agreements to access music sites across the web.


-
-

Downloading project

I would like to download the source for my project as a zip file to my computer.
In AI help I ran into the following instructions:
>>>>

Downloading a project

You can share your apps by downloading the source code as a .zip file and then sending that file to another person who will in turn upload the .zip file to their projects in App Inventor. In the Designer window, click "My Projects" in the upper left. Select the checkbox next to the app you want to share. Click the "More Actions" button and select "Download Source". A .zip file will be saved in your Downloads folder.
>>> 
The problem is that when I tried this the only buttons where "Start new project" and "Delete Project"
Could someone tell where I'm going wrong?



Are you coding in App Inventor 2 David?    The instructions you found are for App Inventor Classic.   The correct instructions for downloading an AI2 aia file (the source files in AI2 end in aia; they are a special zip file for AI2). http://appinventor.mit.edu/explore/ai2/share.html

Sharing your app so that others can remix (.aia file)

Make sure you are viewing the list of all of your projects (if you are not, choose Projects | My Projects). Select the project you wish to share by checking the box next to it. Choose Project | Export selected project (.aia) to my computer to export the source code (blocks) for your project. The source code is downloaded in a .aia file.

If you are coding in AI Classic, are you aware that MIT says it will stop supporting AI sometimes this year?  It is late in the year and there have not been any update from MIT on the timing, but AI Classic soon will not be available.  Consequently, we urge AI users to start converting their projects to AI2 and to start using AI2.



Thank you for your help.
I was using AI 2, hence my problem.


Help, News App.

Hello friends, how about ?. Now I have some time experimenting with App inventor and me gone really well and learned full well thanks to various forums and tutorials out there on the net but right now my mind create an app news style flipboard or maybe or a little simpler for start and get an idea of how to do it ?. Anyone know how it could create an app using news app inventor? perhaps gathering of some blog rss or something ?.



Try:  FeedMe ...http://www.tair.info/faqs-and-how-tos/ai2-how-tostutorials/rss-example-feedme-ai2/


Runtime error


After i finished inputting the tex, it noticed runtime error: tex is null.

--

You have a problem.   If you post a screen capture of your blocks, perhaps someone can help you with the issue Steve.


If text is null, it probably means that you either did not type any text into a TextBox?  (it is not clear that is what you are trying to do) .  If you did that, you may not have pressed the Done key on the Android keyboard?  before you try to do whatever you try to do with the text in the TextBox.     

or is this something else?

How to capture an image of your Blocks screen
On Windows  Ctr + PrtScn  keyboard keys pressed at same time copies an image of the screen to the Windows Clipboard.  Open Paint and save the image by putting the contents of the clipboard into Paint. Save the image to your desktop or another folder as a png or jpg file.  On Win 7 and above you can use the Snipping tool (in Accessories) to capture an image of blocks directly from the screen.  Capture what you need and Save the file as to a folder on your PC.

On a Mac,  command-shift-3 (whole-screen) or command-shift-4 (drag a rectangle) to take a screenshot. The image file will appear on your desktop. 

To post an image to the forum:  Once you copy an image and named it something like capturedimage.png and you have put it in a folder on your PC;  find the blue Insert Image control in the forum text area (the icon is next to and left of the Link).  Press the icon.  A small screen opens..drag the capturedimage.png to the new screen; wait a few seconds while Google's forum loads the image to the text area.  Now the image is in the forum's text box area, ready to post.

Please save the images as a jpg or png file.   Other formats are possible but create problems for some forum members in reading your images.

--
i am trying to create an app which has two sceen; when you press a botton ,then it will open another sceen and in this sceen you can input some message and then return the message to the first sceen.but when i finish inputting,it notice runtime error: tex is null.
here is the screenshot of my block.
    
--
Global variables in App Inventor are only "global" for the single screen.  If you set a global variable on Screen 2, Screen1 won't see that.  

To pass things back and forth, you're best bet is to use a TinyDB, saving and restoring as necessary.

--

hidden variables

does anyone know how to make hidden variables?



What is a 'hidden variable?'



Local variables are hidden outside of their definition block.
Look in the Builtin Blocks Variables section, and use the
blue mutator square to add more names.


Cambiar idioma MIT App Inventor 2 web (Change Language MIT App Inventor 2 web)

I am a beginner and started working with Inventor Mit 2 through the web and I can not change the language. Any idea why this option appears not me? Thank you



What is not changing?   Use the Globe MENU item to select the language...there are presently four choices.


My language is English, however when I switch to Espanol... I get:

If you started a Project in English, the names of the Controls and any variables you created will NOT change (see the blue arrow and the yellow highlight), however the MENU items and other labels will switch.   In this case to Spanish...see the red circles.

The language changes are NOT happening on your browser screen with Firefox?

Would you please tell us more about what you tried to do to change the programming language.


Workspace design

i am creating an periodic table. i´m using a table arrangement and many buttons.
the problem is that i dont have enough space to put the buttons on th screen .



You'll have to shrink your buttons down.  I suggest you shrink the font size, or, have sections of the table on other screens, and use the main screen (screen1) as a map to get to all the different areas on your screen.



It depends on how many elements you want to show at once. A suggestion is that you put a scroll mechanism so that at any one time you are displaying say 30 elements and then each scroll shows the next 30 etc. Or show them in groups e.g. transition metals etc. This way you don't need as many buttons. 




FontSize and Tablets

I searched in the forum found this topic here and there but without any solution. 

I used App2Market and after that fontsizees are very small (on7" tablet). (shrunk)

Any practical solution ??



Universal Screen Size Using App Inventor by Saj

Taifun



Unfortunately, Saj's solution doesn't address font sizes.  This is something you'll have to figure out on the fly.  Probably based upon the width of the screen, which will tell you approximately if the device is a phone, 7" or 10" tablet.  Then, adjust the font size appropriately based upon those return values.



Taifun/Enis - Thank you for reply.

Does Clocktimer also get scaled during coversion in tablet form.. I noticed my timers are slower like my font shrunk?

Do I need to scale timeintervals with screen dimesion as well??



Nope... none of that affects Timer intervals.  How many timers do you have going at any given time, and what are their intervals?


I have 3 of them , with time interval of 50,200 and 4000.



Are they all going at once?  the 50 triggers 20 times a second... the 200 triggers 5 times a second, and the 4000 ticks every 4 seconds. Read the section on Timers & CPU in my tips below entitled "Why is My App Slow?" which discusses timers.



I use 30+ timers, each timer for some type of animation(change filename of imagesprite, width, height).
But I do not run more then 2 timers at once.
Sometimes I use timer for one tick, this timer disable itself in timer body. This need me for interupt on some events.
I have only one persastant timer which runs each 0.5 sec.Animation timer runs each 30 msec for each animation frame. Animation timer runs when it is needed.
Time to work of this timer are limited (up to 1 second).
Can this huge number of disabled timers freeze my app too, because system use it in one's own way?

I get some expirience: if you use lot of graphical elements on canvas and all of them are set as Enabled and Visible but has blank image(as result they are invisible on canvas), then application work slowly, instead of you disable all of them. I think application process imagesprite's collisions and other events of canvas...
In my case this add a lot of performance. I use 64+ visible and invisible images on canvas.



As long as the timers aren't all active, they're fine.  They only start eating CPU time when they're counting!


just started the ZOO lesson,Trouble with tables

Just started the Zoo lesson and on the table arrangement part in my properties area I don't have the part that allows me to change it to 3 columns and 2 rows. I can change to to fill parent but not much more.  
Thanks for any help,




I am not familiar with the 'Zoo' lesson.    It seems you need a Table component?   Is that true?  Did you place a Table component on your Designer screen from the Layout controls?
The options for using the Table will not appear in the Properties unless you put a TableArrangement component on the screen... it appears you placed a HorizontalArrangement on your screen.

Is that the issue?   Did you solve it?


connect a place to a number

Hi, anyone can tell me how and if it's possible to create an app where it is displayed a map (GOOGLE MAP)with: your CURRENT location, and some other addresses. I would like to connect the addresses to a phone number and by clicking on an address i would like to text the person. Basically connect a person to a place. 



This example from the MIT Gallery might help.  Be aware, the app does not close screens properly and there are other small issues.   It uses Google Voice, which can be an issue if you are not within the USA (then you can use / send an ordinary sms) and you have to modify the code.

 http://gallery.appinventor.mit.edu/#page%3DApp%26uid%3D28626002%26label%3DFind%20Me%202.0

This is NOT a tutorial...it is a 'finished' app that some chose to share.

Is this what you wanted to know Laura?




first, Thanks for answering!! ok, it is the very first time i try to use this kind of things so i'm sooo not good at doing this. We are dealing with the problem of thieves so we are trying to create an app which permits to notify to somebody if there is something wrong with his house. So basically one should be able to open the app and , by clicking on a "pin" (the pin would appear only for the people who decide to appear in the map) to text the owner of the house. 
I don't know if it's clear, i'm italian so my english is not good at all, and exuse me if I have explained everything but i think it's the only way for me to be understood. (maybe :) ) 



Yes, you are clear.  You are new. Some of what you want to do is regarded as requiring advanced programming skills. The clicking on a pin on a map and getting the device to send a location from that clicking is NOT easy to program.   

To code or write an app similar to what you want you need to learn how to program.  The way to do that is to do the tutorials and read the free ebook shown here.  Tutorials:


The AI2 free online eBook http://appinventor.mit.edu/explore/ai2/tutorials.html ... the links are at the bottom of the Web page, teaches users how to program using Blocks.

You will probably have to learn to deal with Lists, the TinyDB or perhaps how to use a Fusion table depending on how you want to share the data.   Here are some hints and things you will have to learn to control with blocks using App Inventor:

=====
Lists

List of Lists


TinyDB



Concepts



You will have to learn how to use the Texting component and learn how to use the AI2 LocationSensor component.  The tutorials explain much of those things but they do not explain how to make your app.

What have you tried?    If you post a some block images and ask specific questions we can help.    However, it is impossible how to tell you how to do everything you expect to do.   You are going to have to learn to program...the people here will help with that.




Oh well ok, so much work to do. I'll try ! many many thanks! You've been very kind! 
I'll write again in case. 



yes it is possible


Playing mp3 files by setting player source


I am trying to set the source for a player to an mp3 file on my tablet but either get "Error 701: Unable to load <filename.mp3>" when I start the filepath with a "/" or get "Error 702: Unable to prepare ..." when I start the filepath with "file://". The file I am trying to play sounds fine when loaded into the app. I can read and write a text file to local storage from the app so I know access to read and write works ok. Does anyone know how to make this work please?

-- 

did you upload the file as asset into your app?
if yes, only use the filename, example: myFilename.mp3
in case it is available on the sd card of your device, you will need the full path to the file, which is something like this:
file:///mnt/sdcard/myDirectory/myFilename.pp3

--
The information provided here seems not to work Accessing Images and Sounds (App Inventor 2)

--
thank you for spotting this... hopefully this will be corrected soon...
@Josh?

@Nut: did my suggestion work for you?

--
Thanks a lot. I had not included the /mnt in the filepath. It works fine now.

--

求救 打包apk遇到錯誤 (Help pack apk encountered an error)

App Inventor will not compile this project
Compiler error output is
________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_andreewr13/TestReadFile_SplitNFind/Screen1.yail to appinventor.ai_andreewr13.TestReadFile_SplitNFind.Screen1)
(compiling appinventor/ai_andreewr13/TestReadFile_SplitNFind/app01.yail to appinventor.ai_andreewr13.TestReadFile_SplitNFind.app01)
ERROR: appinventor/ai_andreewr13/TestReadFile_SplitNFind/app01.yail line 21: call to 'set-and-coerce-property!' has too few arguments (3; must be 4)
Kawa compile time: 2.094 seconds



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

The most probable, based on your posted image is the first or second items which are probably preventing an apk compile.

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 occasionally 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. These controls need to be live 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.

The problem could be something else, like running an old version of Companion ...in this instance the cure might be: Projects > Hard Reset. If there are Companion issues a pop up will appear (if no issues, nothing will happen...just smile). When the pop up appears, follow the instructions very carefully, then reboot your PC and try again.

Did any of these suggestions help you to solve your apk compiling problem?


Horizontal Scroll in Viewer

There isn't the horizontal scroll in my viewer! Can you update it?



That is correct... there is no horizontal scroll in the viewer... I doubt that is going to change.



star issue 2150 https://code.google.com/p/app-inventor-for-android/issues/detail?id=2150

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