2014년 11월 30일 일요일

Edit the content (text) of the app without App Inventor.

I'm new with App Inventor and I have one idea for develope an app.

My question is: How can I edit the content (the text) of one screen of my App without publish a new Update of my app?

I have listened about database, and I have seen one friend usingwww.parse.com

Do you know something about this?

I only want edit the text of the App sometimes from www.parse.com for example and not update app each time that I want to edit the content.



From the looks of it, parse.com is a completely different platform and not compatible with AI2.
If I were you, I would make the app with the text you have in mind now (do the tutorials first!). If you have finished, you can continue by putting the text in a TinyWebDB or similar. And load the text at app startup.


Logging into an email service without showing the process

I'm trying to create a simple app that would have a name (like a gmail account name) and when clicked on, would behind the scenes input the email and password then log in and just show me being logged in (showing my emails). I would love to learn how to do this so if anyone happens to stumble on this and knows how, could you explain the general idea how so I can still do it myself?



this is a little bit more advanced...
I can offer a solution for gmail here 

App Inventor - Gmail Gmail Interface

but as Enis said, first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the


Error : Unable to decompile

Here is my log. Any suggesation

Unable to decompile


29Nov2014_0843.11:  Your Platform: windows 8.1

29Nov2014_0843.11:  Java Version: 1.8.0_25

29Nov2014_0843.11:  AppToMarket Version: v3.2

29Nov2014_0843.11:  Install folder: C:\Users\Arnav\Documents\App related\AppToMarket_v32

29Nov2014_0843.11:  Your data was loaded from: C:\Users\Arnav\Documents\App related\AppToMarket_v32\resource\config.txt


29Nov2014_0843.40:  BUTTON CLICKED: Generate

29Nov2014_0844.33:  BUTTON CLICKED: Generate

29Nov2014_0844.33:  ERROR:

You already have a keystore file with specified name. 
...Please use a different name for keystore. We don't recommend deleting keystore. 
...Your selected keystore file is: C:\Users\Arnav\Documents\App related\AppToMarket_v32\myKeystores\myks.ks

29Nov2014_0844.38:  SUCCESS: AppToMarket saved your new configuration file into config.txt file! Also, It made a backup file, from previous config, and placed in the resource folder. Check it out! 

29Nov2014_0844.48:  BUTTON CLICKED: 1> Decompile

29Nov2014_0844.53:  ERROR: Unable to decompile your .apk file


Current date and


Wanted to develop my total investments and as of now interest amount APP.

A. for this i need to save 1. Cust Name 2. principle amount 3. per anum intrest rate 4.starting date  after this when ever i check the investments total intrest amount should display.In this process , how to add get current date in the programme , if its from date picker how to set with out date picking inter action for date picker element.

B. How to edit data in TinyDB if any correction in the entered data

-- 

You need to create a list of your 4 items.  You save that list as the value for a single tag in the TinyDB.  If you want to change the data, you refill the list with the correct data and store it to the same tag name and the data will be overwritten with the new data in the list.

Use the clock component for the dates and times.

Have you done any of the tutorials?  The tutorials are located here:http://appinventor.mit.edu/explore/ai2/tutorials

Also, read my tips in the links below:


For our App Inventor Tips, visit TwoDogApps.com

--
Is it possible to delete entire list of 4 items ONE RECORD from TinyDB, If yes how

-- 

If you have stored a list as a value for a single tag, just use the "clear tag" block, and give it the tag name.

--


Troubleshooting an app in the phone

I made a qr code, and when I used it on my phone, it said 'downloading is not supported', then it doesn't download anything.



Several possibilities David,  ..the QR code will only download the app for a limited period of time; depending on the Android operating system on your phone, you will have to temporarily change the phone's download option settings as described at the end of these instructions.

Note: The other option (provide QR code for .apk) produces a scannable QR code that will download the app for two hours. You can share this code with others, but they have to use it within 2 hours of your generating it.
Once the build completes, 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. You can also distribute your app on the Google Play Store.
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.

Did this allow you to get the app on your phone?     If not, instead of using the QR code, download the apk to your desktop, then email the apk to yourself and install that way.


China National App Inventor Contest holds final round

On November 22, the 2014 China National App Inventor Contest for High/Middle School Students, which kicked off last June, held its final round competition at the Google office in Shanghai.
Here is a report by Kathy Deng of Google University Relations Education, China
http://appinventor.mit.edu/explore/blogs/hal/2014/11/china.html


Multible Screens

I am having trouble navigating between screens. Do I have to close a screen before opening one? How do I switch to a screen that is opened? What are all the commands like "Close screen with value    result"?



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

Here are solutions on how to switch screens... http://puravidaapps.com/tribblehunter.php

Please read my tips below:

For our App Inventor Tips, visit TwoDogApps.com



Ben, you do not have to close a screen before opening one, HOWEVER, eventually your app will crash and burn because if a screen is not closed as you exit it the screen gobbles system memory (an exception is Screen1, which is never closed).  Use up enough system memory and lots of woe.

Read Enis's post and do close screens on exiting them properly.  Be aware, the screen changing method described in the link he provides works after the apk has been built...use the browser Screen button to change screens while developing... however when this code is in place, it  prevents the device's system memory from overflowing and crashing your app.

can i create an image gallery using app inventor

is it possible to create an image gallery using app inventor 2



No, not really.  You could have many canvases and make them visible or invisible, but in terms of loading pictures as the screen scrolls, no.



see this App Inventor Classic solution from Scott


Android system setting change possible in Inventor?

Hey all, I was wondering: Is it possible to create an app that interacts with android settings directly? Say a toggle switch to turn on and off Alarm, Vibration etc.

Also, can the app be made to run in the background and only use the GUI sometimes, say to change a setting?



Sorry, App Inventor apps can not run 'in the background.'    Impossible.  Ai programming is event driven, you can not have multiple processing threads.

Interacts with Android Settings?   You can use AI with an ActivityStarter to invoke the Setting screens, change parameters directly...no and as a security feature, other compilers can not change many Android Settings directly.


Spinner help

So I have a spinner. I'd like to use that to select a music file to play, but I'm having trouble figuring out the process here. 

Basically what I'm imagining is:
  • Spinner selects "One"
  • Player source becomes "One"
  • Hit play and it plays "One"
So if I do it that way I need some sort of variable that least the system know that "One" is the file "one.mp3" Which I'll have to figure out.

You think that's the best way to do it? Or is there a better way to get an app that is able to play different files after a selection?



you could have 2 lists, list1 to be displayed in the spinner and list2 with the corresponding file names


ActivityStarter Issues....jackpal.androidterm


So, I have been banging my head against the keyboard all weekend on this one...(BTW, not helping...) I have the following, but can't get it to run the iInitial Command (or script)...what am I missing? when Button1.LongClick do set ActivityStarter1.Action to "android.intent.action.MAIN" set ActivityStarter1.ExtraKey to "jackpal.androidterm.iInitialCommand" set ActivityStarter1.ExtraValue to "exec su -c whoami" set ActivityStarter1.ActivityPackage to "jackpal.androidterm" set ActivityStarter1.ActivityClass to "jackpal.androidterm.Term" call ActivityStarter1.StartActivity I have also tried the following: when Button1.LongClick do set ActivityStarter1.Action to "android.intent.action.MAIN" set ActivityStarter1.ExtraKey to "android.intent.action.RUN_SCRIPT" set ActivityStarter1.ExtraValue to "exec sh run.sh" set ActivityStarter1.ActivityPackage to "jackpal.androidterm" set ActivityStarter1.ActivityClass to "jackpal.androidterm.Term" call ActivityStarter1.StartActivity Thanks much for your time and assistance,

--
I just tried this, see screenshot



you have to modify the manifest with a third party tool, e.g. AppToMarket to get this running, see also https://github.com/jackpal/Android-Terminal-Emulator/wiki/Launching-Terminal-Emulator-for-Android-from-another-App

--
Update...still nothing, however I did want to add that I also have the following setup:
On the ActivityButton in the Designer I have set up the following:
*Action:* android.intent.action.MAIN *ActivityClass:* jackpal.androidterm.Term *ActivityPackage:* jackpal.androidterm *ExtraKey:* jackpal.androidterm.iInitialCommand *ExtraValue:* sh /sdcard/run.sh
As suggested by this link:
I have also now built the button.click to look like this:
when Button.clicked
    set ActivityStarter1.ActivityPackage to "jackpal.androidterm.Term"     set ActivityStarter1.ActivityClass to "jackpal.androidterm"
    set ActivityStarter1.Action to "jackpal.androidterm.RUN_SCRIPT" 
    set ActivityStarter1.ExtraKey to "jackpal.androidterm.iInitialCommand"
    set ActivityStarter1.ExtraValue to "sh sdcard/run.sh"
if is empty call ActivityStarter1.ResolveActivity
then call notifier show 
             notice "ALERT!"
else 
    call ActivityStarter1.StartActivity
And I have edited the AndroidManifest.xml with the AppToMarket tool to now include: 
<uses-permission android:name="jackpal.androidterm.RUN_SCRIPT"/>
which upon the .apk install where it asks for permissions...does not ask for anything like running scripts... 
So, when I press the button, my app launches the Android Terminal, but just shows the command line with no command issued...frustrating...
I guess, I'm not sure if I'm missing something or where each item for ActivityStarter is supposed to go... 
I think that is adding to the confusion and the inability for it to work...
Any other suggestions???

--
please follow the documentation EXACTLY, see also my screenshot
https://github.com/jackpal/Android-Terminal-Emulator/wiki/Launching-Terminal-Emulator-for-Android-from-another-App
as you can see, there is no package and no class necessary

--
So, just to be clear...
I need to type in all of this into the manifest....EXACTLY...(except, of course, my own initial command...)
// opens a new window Intent i = new Intent("jackpal.androidterm.OPEN_NEW_WINDOW"); i.addCategory(Intent.CATEGORY_DEFAULT); startActivity(i); // opens a new window and runs "echo 'Hi there!'" // application must declare jackpal.androidterm.permission.RUN_SCRIPT in manifest Intent i = new Intent("jackpal.androidterm.RUN_SCRIPT"); i.addCategory(Intent.CATEGORY_DEFAULT); i.putExtra("jackpal.androidterm.iInitialCommand", "echo 'Hi there!'"); startActivity(i);
--
and should I change anything in my AI2 (Design or Blocks)???

--
just use the blocks from my screenhot...

// opens a new window and runs "echo 'Hi there!'" // application must declare jackpal.androidterm.permission.RUN_SCRIPT in manifest Intent i = new Intent("jackpal.androidterm.RUN_SCRIPT"); i.addCategory(Intent.CATEGORY_DEFAULT); i.putExtra("jackpal.androidterm.iInitialCommand", "echo 'Hi there!'"); startActivity(i);

--
I now prepared a snippet, for details see here https://puravidaapps.com/snippets.php#2terminal

--

I need help sharing the same random function across multiply lists!!

I am building a multiply choice quiz and need a bit of help.

 I have a list of 30 questions and a list of 30 lists of answers (each question has 3 answers). I can call the questions in the order that they are listed, and the correct answer list, but, I wanted to randomise the questions  and correct answer set which appear, but can only randomise the question and not the answers, therefore, the question is randomised, but the answers stay at the same order of the original answers list and don't match the randomised question. 

How do match the output of the question randomiser to the answer list selection so they match? 

I have enclosed a screenshot of the question/answer generator block.

If anyone can help, I would be very grateful!




instead of 
  set global index to get global index + 1
  set global index to pick a random item listQ

pick a random item


Picks an item at random from the list.



This isn't complete. 

Your instructions would only pick one item. "Picks an item at random from the list." I need the same random process to correspond to two lists.

Do you understand?



I did carry out your instructions, and i got a runtime error: The operation pick random item cannot accept the arguments: 0



yes, sorry, my answer was wrong...
you have to use the random integer block to get a random index, see also this snippet 



That does help a bit.

There lots of examples on this forum of people giving advice via actual explanations and examples of exactly what needs to be done specific to their issue, is there any chance I could get one if those please.

I know I need to use a random interger block and I know I'm working with lists and sub lists, what I need to know is, how to populate the random index list with paralel random choices across two lists



well, if you have a random index, you can select the corresponding questions from the question list and the corresponding answers from the answers list

set global index to random integer from 1 to length of list get global listQ

just try my suggestion and in case you still have problems, 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.


i have attached screen shot of error iam having with fusion table app

i am have tweeked the fustion table app tutorial to fit my needs got everything working exept i am receiving this error is anyone famliar with it and how i can solve it thanks.

it says there has been a transmission error.400 bad request invalid query:parse error near 'and'(line1,position 72).please try again


i have attached a screen pic my blocks all seem correct

Screenshot_2014-11-27-20-54-04.png 표시 중



Look at your data... position 72 on the first line of data...  You didn't post a screenshot of your blocks, but a screenshow of your error.  That's OK... Use the DoIt function at the top left of every block to see what data you're returning and adjust things from there.



i am sorry here are my blocks for the fusion table error.

as for the blocks some of them offer the do it function some dont an the ones that do ...nothing happens when i click it 





here are therest of the blocks ..please assist if you can ia mquite lost this was simple enough now its just turning into something else



and the last one





Frequent Made Errors with Fusion Tables Fusiontables and how to fix them






how to share multiple photos and text using sharing component in app inventor 2?

how to share multiple photos and text using sharing component in app inventor 2?

my app should send 3 pics with their captions through email but it sends only 1 pic and 1 caption



you only can share 1 photo, you can't share multiple photos



can i save all the photos and text in a file then send that file?
if yes please guide me how to do it :)



no sorry, you can't
what you can do is to upload your images into your Google Drive or to your web server and share the text and the links to the images

Can't figure out how to build a GPS locator application

Does anyone know if there's a tutorial on how to track another phones location using GPS



A GPS receiver tells your Android where it is; it does not tell the World, however if an Android user's settings (Location permissions) are set to allow Google to find you, it can provide location information to other apps or the Web.  But Googlet does not generally use gps, it uses WIFI and or cell tower information.   You do not have access to that with Ai2.

Combine the LocationSensor tutorial with the Where is My Car tutorial and the sms tutorial, build the app.   Put the app on your phone and have someone else put it on their phones and when all the phones are turned on and running the app  the phones can tell each other where they are if you share phone numbers.    Is there a way to do this directly or without the other phone users knowing?   Of course not with Ai2 and if you did, you would be creating malware.



Barry... Please do NOT multiple post up here for the same issue.  We'll get to your question as fast as we can.



I just want to create an app that me and friends can use to located each other during a hike, or while tracking down a friend who's had too much to drink and has wondered off from the pub. Hopefully I'll be able to combine the three tutorials and get the app to work. Thank you for pointing me in the right direction Steve :).


Coding

Does anyone kow if you can add your own coding to apps on here?



"add your own coding to apps on here"  -- does that mean can anyone load a app to this forum?   The answer to that question is that you can NOT upload an apk file.   You can upload images of blocks and an aia file  to the Tips and Tricks section.    Or you can provide a link to your app on Google Play or at another web location, but you can not post the apk.

If you want to post an apk of the work you have done, you can post it here:  http://gallery.appinventor.mit.edu/#   to the MIT AI Gallery.    There a already a few AI2 apps here.  You must follow that site's guidelines.


or does "add your own coding to apps on here"  mean  can I modify the apps you find the source code for or modify the tutorials?  The answer is yes; just do not claim you did all the work yourself and provide attribution (acknowledgement that parts of the app came from someone elses code in the AI2  About property.

or is your question something different?



"the blocks are your code" might be the answer to your question...
and you can do a lot with HTML/JavaScript, more see here https://puravidaapps.com/tutorials.php#html


is it possible to load a microsoft word document into app inventor

is it possible to load a microsoft word document in a screen so that when i load a page it opens up



No.  Load a word document with a File control; read it in a label and you get a lot of text and control characters.  Try it.  If you as a question is it possible, it is possible your might figure it out your self if you try some code.   How do some people here know things others do not?  They search, they read and most important, they TRY.

Convert the Word document to a pdf and you might be able to use the following to view the Word document converted to a pdf. (a Taifun code snippet in AI Classic that might help)  https://puravidaapps.com/snippets1.php#pdf     You will have to convert the Word document using an app on your PC or using a Web service.


that snippet is also available for App Inventor 2 here https://puravidaapps.com/snippets.php#2pdf

did you try to convert your word document into a Google document and read it with the Google Viewer similar to the pdf example?


Using the random block

I need help, i posted last night, but someone answered my post with a completely wrong answer and marked it as completed, so i'm posting again.

PLEASE DONT MARK AS COMPLETE UNITL THIS QUERY IS COMPLETE


I am making a multiply choice quiz. I have my questions in a global list call 'listQ'  and the corresponding answer in a global list called 'listA'. 
For each question I have the correct answer and two wrong answers. I can take questions and answers in the order they were listed 

For example: i can call 1st item in listQ (and send it to my question box) and the 1st item in the listA (the correct answer and two wrong answers that are randomly assigned to my 3 multiply choice buttons. the 1st item in listQ and the 1st item in listA correspond as does the second and third etc. 

but i would like to randomise this process so that a random corresponding pair will be used. I can randomise the question, but i don't know how to make that randomisation process relate to the answers.

here is  link to the original post that has a screen shot of my blocks






Just because a post is marked as complete doesn't mean you can't continue it.  Starting another thread/topic is just wasting forum space.

Check your code... you're passing an empty list (0).



Ok, thank you for responding. I'm very new to all this! Please have patience.

I know why it's returning an empty list, it was because I followed the instructions wrong, and used the global index instead of listQ.

I did do it again and it just returned a runtime error featuring all the entires of listQ. 

If I make it simpler to explain: 

ListQ= 1+1, 2+2, 3+3
ListA= (2,5,7), (4,6,8), (6,5,8)
The first item in each sub list is the correct answer. 

I can call these items separately, one after the other starting from the first item in the list, but I want to randomise that process so that instead of starting at 1+1 (2,5,7) it can start at a random item on the list and continue to choose random item: 2+2 (4,6,8), 1+1 (2,5,7) 3+3 (6,5,8)

If someone could explain how to do this (perhaps with a screenshot of the needed blocks) I can incorporate it into my project. 

Thank again for your patience!

John

SCREENSHOT: My project is quite complicated and i don't know how to export am image of the whole project. is there a way?



ScreenShot:      

1) You can shrink the image slightly... in your browser, press the Ctrl key plus use the scroll wheel on your mouse (if you have one) to shrink the blocks...be careful, you shrink too much and the blocks become unreadable.

2) Make multiple screen captures of different parts of your block code and send multiple images.  

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.


duplicar screen (double screen)

As doubled the screen




Try this method proposed by Scott:  you can copy a 

Then delete the blocks in the copied screen that you don't need.


or  ========================

projects-one.html

=============
or do not copy at all but code smart:  


Layering

I was wonderibng if anyone knew how to layer images and variables in the app.
What i want to do is create a scoreboard, so the image will be in the background and i would have a changing score in front of it.



You can make the canvas the scoreboard, and have numbers as sprites...

Don't know what you mean about layering variables.


Avast resporting my app as malware

Since yesterday my app "Geocachers On The Move" is reported as Malware (FakeInst-AFO) by Avast on Android 5. Does anyone recognise this phenomenon? I have already reported this to as false to Avast. 
But can anyone advise me on what I can do further?



Thanks for responding to Avast.   If you search the forum you'll see that some other App Inventor users have run into Avast reporting false positives as malware.
It seems to be an issue with more than App Inventor.  You may have already seen this:

https://blog.avast.com/tag/false-positive/


Need help with csv lists

I need a little help with importing a list if lists from a csv file. 

Using some other similar threads and tutorials I have managed to import a simple csv table using the 'file' component and 'import from csv table components'. I now need help with importing a a slightly more complex table. For example, I want to make a list of 10 soccer teams where each team is a list of 11 players, and each player is a list of a number of traits like name, age, height, weight etc. I know how to make a list of lists in app inventor but am confused about how to make this list in csv format and import it to app inventor. I want to make this in csv format so I can easily edit the data in excel and overwrite csv file whenever needed after the app has been packaged.


Also an off topic question but would appreciate if someone can help. In my game app I have a sprite which I want to move from point A to B. Currently I place the sprite at point A, set its heading to point B and then enable it so it moves in a straight line from A to B. What I want to do now is to make it take a curved path from A to B instead of moving in a straight line. It is more of a maths problem than an app inventor problem but would appreciate any help. 



for more complex structures I recommend you to use JSON format
after importing the file in JSON format just use the JSONTextDecode block from the web component to convert it into a complex list of lists

probably someone else can give you a tip for the second question...



Curves.  A programmed curve path plotted on an AI2 Canvas.   Not easy with a Canvas.   Here is a link to using the Canvas in a Windows Delphi Object Pascal project  http://www.efg2.com/Lab/Library/Delphi/Graphics/Math.htm

Why am I directing you here?    Delphi's canvas works almost exactly like the canvas in AI2.  Some of the plotting algorithms  posted on this page would be almost identical in structure to code you would need in AI2 blocks... yes, the coding is in Pascal; you need to 'translate' to blocks.

Try some things by starting a new Project; put a canvas on the Designer and see what you can do.   Show us what you come up with.



Thanks for the replies. I will try the json format.

Unfortunately I am not from a programming/computers background so the Pascal bits are a little to difficult for me. But with some trial and error I have been able to make the sprite move in a curve. What I have done is to add a timer that changes the heading of the sprite continuously. It moves in a sort of curved path but doesn't really end up at the exact point I want it to. With some more time I might be able to figure this out though.



"Also an off topic question but would appreciate if someone can help. In my game app I have a sprite which I want to move from point A to B. Currently I place the sprite at point A, set its heading to point B and then enable it so it moves in a straight line from A to B. What I want to do now is to make it take a curved path from A to B instead of moving in a straight line."

Hi azar-

You must provide the following:

Point A (Ax, Ay)
Point B (Bx, By)
Center of a circle which has points A and B as endpoints of a chord passing through the circumference of the circle (Cx, Xy)

We can calculate the Radius of the circle:

Radius = sqrt((Ax - Cx)^2 + (Ay - Cy)^2)

Now we need to get the angles of points A and B on the circle relative to the center of the circle:

AngleA = atan2(Ay - Cy, Ax - Cx)
AngleB = atan2(By - Cy, Bx - Cx)

Now we can create a loop to plot the points along the arc from A to B:

for Angle from AngleA to AngleB by 1   (it is assumed that AngleA < AngleB, otherwise make the 'by' value -1)
   DrawPoint(Cx + Radius x cos(Angle), Cy - Radius x sin(Angle))




Thanks Scott, I will give this a go. My trigonometry is a bit rusty to so it will take me some time to figure out your solution but this is pretty much exactly what I was looking for.