2014년 12월 15일 월요일

Many small apps - bring together with A dashboard app and Activity Starter?

My "clients"  (staff and children!) are "requesting" many applications from me, most of which are all small one screen apps.

I started off thinking I could have just one big app which each smaller app on a different screen, but I think this may become unweidly and might bork if I go beyond 10 screens etc.

So am now thinking of writing a "dashboard" app and using activity starter to call each app as required.

Any advice or suggestions on the best way to do this, especially around returning (closing or leaving open?) from an app to the dashboard app, and the possibility that the smaller apps may need to interact with each other?

I am quite comfortable with using tinydb or php/csv external data.



You could have a lot of small apps on your Android, then use ActivityStarter to  call them


Starting arbitrary apps

You can use the Activity Starter to start any activity at all if you know the package name and class name, or the appropriate intent. Some developers document these intents for the benefit of other Android developers. For hints on starting other apps using intents, see the Android API documentation or search the Android developer forums.
If you have an app on your phone and you don't have the source code, you might still be able figure out the package name and class name (and sometimes the intent) by launching the app and inspecting the Android system log, as indicated above.

The documentation is a bit skimpy but you should be able to figure it out.



Have fun experimenting.    Run in to issues?   Someone here will possibly know so ask again.



Given my particular needs (things constantly changing, for existing and adding/removing apps !) seems it will make more sense to have many apps and a dashboard app to call them all. Activity Starter allows results to be passed and received so this will help, and if I need it I can use external data/lists which can be called by all.

I'll have to do some testing, but assume that "Close Screen" will be equivalent to "Close Application" when generating a result?

How to call dashboard app (which could be open or closed?) when closing other app ("so it feels like one app") ?



At the moment, you are at the leading edge of technology Tim.   What have you tried?

Close Screen will close one screen.  Close Application closes down the entire app that it is called from.  If elicited from your 'dashboard' it will close the dashboard app...I do not know if it will close other apps opened by dashboard.... you gotta'  try and see ... that is what most of us do when we venture in the bleeding edge and do something we have never attempted before.  I suggest you do not 'assume' anything.  Try it, if it breaks, then ya' know, if it works, rejoice.

"How to call dashboard app (which could be open or closed?) when closing other app ("so it feels like one app") ?"     I do not know.  I think putting an Activity.Starter in each of the other apps ... however, the way to move from an ActivityStarter elicited screen to the main page of the app is to  use the back button.   I am not sure there is another way.  So that idea probably will not work :(  

I do not know if it is possible to pass data between apps automatically, possibly a Boolean value)... without creating a file in one app and reading it in the other app.  Something like that would allow communication to know whether the value is true/false  but I do not see how to create automatic control.

Your question is interesting but the ability to do what you want might be impossible with AI2.

Again, try some blocks...you are going where no one has gone before perhaps?



How to call dashboard app (which could be open or closed?) when closing other app ("so it feels like one app")

the dashboard app opens another app using the activity starter. After closing that app (close application block) you are back in the dashboard app
you also can pass values back to the dashboard app, I once made a snippet with App Inventor Classic here https://puravidaapps.com/snippets1.php#fetchdata



OK run a little test, which has thrown up a surprise (to me)

I created a simple app called Dash with a button and activity starter
Then a second app called App1 with an image and a button
Then a third app called App2 with another image and a button

Gathered the activity and class info from App1 and entered into the activity starter in Dash
Set the button in Dash to call the activity starter.

In App1 set the button to Close Application

Compiled all and installed on device

Open up Dash, click the button and App1 (with its image) displays. :)  Click the button in App1 and we return to Dash. :)

But App1 is not independent from Dash - it seems to become a part of it. I can't use the Dash app whilst App1 is opened via Dash.

Is there a way around this so I can return to Dash after opening App1, so that I can then open App2 at the same time, and then hopefully return from either to Dash when I close them ?



Made some progress.

You can set the "dashboard app" to close after you call the app you want, and also send information to the app you call.

This gives you options as to whether you want to return directly to the dashboard app or not

Some blocks and viewer of dashboard which gives examples of both



[App Inventor Open Source Development] Samsung Galaxy Note 4

Hello everyone!
I just bought the latest Samsung Galaxy Note 4 but can't get it to work with App Inventor... I've tried everything I could think of...
Anyone out there knows what I should do or where I could find the appropriate dirvers?






Nope... this doesn't work either... :'(

...might it be because I'm using AppInventor Personal Server?

PS: thanks anyway for your help!



Have you tried it with app inventor 2 and WiFi? It should work that way.
If you are having trouble with personal server you should contact their maintainers.


[App Inventor Open Source Development] App Inventor Personal Server

...I'm in need of assistance... a few months ago I've bought AI Personal Server from a guy called Jose Mª Martin <xcitizen.team@gmail.com... It's a decent enough project but, as I later found out, has same issues which need to be fixed... the problem is that, now, despite the fact that I've paid €99 for the software, Mr. Martin has disappeared into oblivion, does not reply to mails and even his web page has been removed.
One of the problem in his AI Personal Server is, for example, that he's "forgotten" to add the Button FontSize feature in the block editor...
Now... is there a way to go around this problem with some other component whithin block editor, is there a way to implement this feature in the AppInventor software itself or is there anything else I coud do?



I don't understand your question. Do you want a workaround for button font size to use with personal server?



You'll have to get in touch with him or download and update the code here: https://github.com/xcitizen/appinventor



Basically YES! there are other issues which need to be fixed but that one is definately one of the most important... what I was hoping to do is to find a way to change Button FontSize without having the usual "normal" feature working... Either by using some king of special procedure within BlockEditor or by, somehow, fixing the code of AI Personal Server itself.
As I mentioned, the guy who sold me the software, has better things to do then answering customers requests for help.

I've attached a screen shot of the missing component...



There isn't much anyone can do to fix the code, other than the author. Hossein points to a GitHub repository but we cannot know for sure if that's the code used for the service you are using.
Only way is for you to contact the person, or for you to move on and use some other service, but you'll probably have to create your app again, as the service you are using might use non standard components.



May I suggest a possible work-around?
I see in your screen shot you have the ability to change button images on the fly.
There are web sites where you can create and download your own 
button images (with your text) for free.
If you are expecting only a fixed set of button texts, consider pre-building
them as images and leave the buttons text-free but with variable images.



Thank you all for your support!
..and thank you, Abraham... that's a good ieda! I'll try it out! ;)


Hello Kitty sound won't play

Is there something special that I have to do to get the sound to play on my Surface Pro 2 tablet?  I read somewhere to use Player component instead of Sound.  What exactly does that mean?



Sound and Player are different components.  Use Player, not Sound



I tried that and it didn't work either.  None of the apps that use sound are working.  Is that normal?



Some things to consider and check:

Is the volume turned up on your tablet?
Does the sound work on non AI2 apps?
What kind of sound file are you attempting to play?    How large is it (Mb)?
Do you have the sound file loaded in Resources (Media)?

Could you please post a png or jpg image of the blocks you are trying to use to play the sound.  You said you tried different things,
if we could see some of your code, we might discover the issue.



I have tried both player and sound components on Ubuntu and Mac platforms. The emulator is playing sound from the keypad but I cannot get the media to play.



Did you download the sounds from the site as well as the code?



Yes. I am on a Mac. The sound file is fine and has been uploaded.



It seems to be a problem with the emulator running the code block. I can see it clicking on the image but I just tried a code block to change the label text when clicked and that hasn't worked either. Do I need to do something before the code blocks will run on the emulator? I tried re-connecting but no change.



Viv... You're using a Microsoft Surface Pro?

AI makes apps for ANDROID... not iOS or MS...



I'm using the emulator - I am an A level Computing teacher not a novice. I have now had the emulator software installed on a windows machine in school. Still no joy on the sound. I will try out some other programs and see what happens.



Have you done Tutorials:


or read the AI2 free online eBook   http://appinventor.mit.edu/explore/ai2/tutorials.html   ... the links are at the bottom of the Web page.  It TEACHES how to use AI2 blocks to program.

A possible issue, is your emulator working at all?   Code a new project.   You are experienced so this should be easy.    Just place a Button on the screen, change the caption on the button to Hello; now Projects > Emulator  .    Do you see the emulator render the button and the word Hello?    If you do not, something is wrong with your emulator setup.

Until recently, the emulator was not possible to use on LINUX boxes.   It is supposed to be working now.    The emulator has always worked on Macs .

What type of sound file are you trying to play with AI2?    mp3, wav  or one of the strange ones?

You have NOT posted a screen capture image of your Ai2 blocks.    Without a code image posted, answering your questions and providing adviceis  difficult because anyone is guessing.   Our standard answer is "Try some blocks"     and that applies to teachers too.


Images gone missing from post?

Did a how to a little while back, now most of the images of blocks I put up are gone, and the ones that are there are blank, requiring a click?

Is it me?

I am not offered the hyperlink to display images either ?





Could be something with Google's server Tim.  Try again later, and if they're not there, edit the post and insert the screenshots again...



I suspect this a Google feature of Google Groups.    I do not see the images on your post unless I left click the box where the image is supposed to be.   I think this happens on Google threads when the thread is closed to additional posts.    Our forum threads shut down for additional posts after the post has been active for about ten days..that might flag Google to treat images the way you post is being treated 



There are only two images left out of @ 15 originally posted.

Not sure why the thread needed to be closed (anyway), even if this is what caused the problem.

How do I raise an issue with Google on this one?



Tim... threads are automatically closed by the forum system after several days of inactivity.  It wasn't an arbitrary decision, but rather just an automatic thing...



Ah I see, thanks Enis  :)



Tim... I opened the original message, and the images are there but it appears they are not accessible.  Did you add them as images, or links to images?



Tim... Have you changed the permissions on the files that were accessed?  I can go to the links manually, but the images of course aren't appearing in the post.  I'll try to put them in there for you.  Give me a few minutes...



I'm not sure what's going on in that post.  I tried getting to the images, and got to some, but things are moving around all over the place as I try to edit.

Was this a direct post, or did you create this post in something else and paste it in?



Just posted in the normal way, straight onto the forum. I did the write up in Leafpad (plain text editor) then copied over, inserted space, and uploaded images direct from PC IIRC. If I did link across from Google Drive the folder and files have "anyone with link can view" permissions. Maybe this is it ? - they uploaded and displayed OK to start off with, the emailed version is still intact with images on gmail.


open another screen

I prepared my new Project. I wanna do command When {}.Click doopen another screen screen Name {}. I dont know how to choose another screen in this command. I prepared new screen in my project but i dont˛t have an option where i can choose a new screen. 



You need the Text-Command [ "( )" ] where you type in the Name of the other Screen



The recommended method of switching screens in App Inventor



how to change the font size in the displayed list of "listview"?

how to change the font size in the displayed list of "listview"?



ListView has no font property Block, so you can not change the font size.  See the ListVie documentation here:  http://ai2.appinventor.mit.edu/reference/components/userinterface.html#ListView

Is there a work-around?   Probably not.


LisView doesn't implement FontSize.   I'll add the request as an issue to include in a future release.  Thanks for suggesting it.



you can't change the font size of the App Inventor listview
but this workaround can do it:
see also Q4 in the Questions and Answers section http://puravidaapps.com/listview.php#q


Building APK for my app

Hi guys. I'm having a problem in building an APK file for my app. We have a school project and our project is making a TexttoSpeech App. My app is 11.66 MB but the app inventor only requires up to 5MB. Most of my classmates app are more than 5MB. Some have 12MB app. The problem is, I can't build an APK file of my app. Same goes with my classmates. But I'm just wondering, why is it before we can download my apps even if it's more than 5MB? Is App Inventor having a problem today? Or its just that we have a slow internet connection?




Do not know if your issue is specific to the problems described here:  The latest public information and advice is at the following document

https://docs.google.com/document/d/1wQy_1uCsZDAXY51wElbMyfy8AJid_EOqklIX_ggzBJY/pub


However, if your aia's have been over 5Mb and you have been getting away with running and loading your apps, you have been running on borrowed time.  5Mb is the LIMIT for the aia.  We tell users that constantly and users refuse to believe that AI2 starts to become UNSTABLE over that limit.


Here is the standard what to do if you can not save, compile or run an app.   Hope it helps.   In addition, we note that if users have unused assets in media (a image or other file that is NOT being used by the app), this might cause issues...try taking any files that are not actually needed in the app out of media)

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 source 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.  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. Sometimes, with lots of graphics, the emulator will just give up.   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 seen 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.


There are third party solutions for loading more than 5Mb ...    You could  search in the forum using the Search for topics box to the right of the colorful google at the top of this page with a term like    5Mb or loading more than 5Mb and you should find some links.

If you still have issues, ask again...if this is the server problem there will be an announcement of the
AI2 splash screen when it is fixed.     NOT ALL USERS have the server issue.


Maps

Can I use maps in Mit AI2 with GPS?



Yes you can use maps in MIT AI2.   You have several options depending on what you need to do with the maps, whether you have to have the maps stored in the app or whether the app can access maps from the Web (including Google Maps):
1) Use Google Maps
2) Use Google Static Map API
3) Use a Fusion Table with its map feature
4) Use your own 'flat' map that you will calibrate to allow World location coordinates to the Canvas screen coordinates.

All of these  options work with App Inventor 2

There is a GPS tutorial and a simple way to use Google Maps demonstrated in the MIT tutorials here:http://appinventor.mit.edu/explore/ai2/tutorials3818.html?&page=2

To learn more about App Inventor, consider the AI2 free online eBook  http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.


How to translate the application into another language?

How to translate the application into another language?
Applications created in Polish but I would like to make it available in English and in Russian.
App Inventor does not create an XML file with a text ...
Are there any solutions to the renovation did not need to translate the entire application from scratch?



Try the tutorial here called Polyglot:  https://appinventorforfun.wordpress.com/


Problem with "Texting"


I´m trying to make a Alarm-Pager for my Red Cross medical unit. The alarm sender works without any Problem, but the "Pager" doesn´t work.

The Pager-Screen should only react on presetted Words. When these words are detected in a Message, the app should play a Sound and set the Label-Color to "red" until the confirmation-button has been clicked.

I tested it with the AI Companion and with the .APK but whatever I´m trying, it doesn´t work at all.

The Attachment shows my Blocks-editor. Can you tell me, where the mistake is?



How to manipulate Draw Text on canvas?


This might be dumb but I'm trying to take a piece of canvas text and make it fall from the sky.  (so it can be shot at?)

It seems easy with an image but I can't really figure it out with the canvas text thing?. 

Any ideas? 

BTW. If any of you guys that help out have a bitcoin address please put it in your signature. .  Thanks. 

--
You can't do it without a GREAT deal of overhead.  The text has to be drawn on the canvas.  Therefore, you'd have to draw the text on the canvas, then restore the canvas and drop down a pixel or two and redraw the text, then restore etc...

If the text is static, then make it a sprite and let it drop so you can shoot at it.

--
Yeah thats what I figured, problem is the text is dynamic from an API.. which makes it even more of a pain in the ass. :)... I might just go with another idea at this point

--
Here's an idea... Not sure if it would work but you could try...

Have a second canvas with a 0 alpha background... 
Paint the text to that, 
then save that canvas with the text.  
THEN, assign that saved picture to a sprite and rezize the sprite to fit the picture... 
then drop the sprite and you'll be able to act upon it...

--
Don't know if this will work, but here yah go... just my two cents :D  It looks pretty cool though :)


--

SEEKING SUPPORT

I'm having trouble actually accessing the course! The lessons won't load. 

I have one app created that I was ready to test; but I was also not able to figure out how to 'test' it properly (tried .apk file)

Would anyone be able to guide me in the right direction? :)



to test all you need to do is go into your project from the developer or blocks screen, click "connect" and choose AI companion(an additional download from the google play store) after that is running on your mobile device/tablet, just scan the QR code that comes up and wait for it to sync to your device, or input the 6 digit code and click (on your device) the button that says connect with code.  The anything you change while building is reflected on your mobile device display, or you can just run the code from the phone/tablet.



You can test "live" by clicking on the Connect Menu, and choosing Emulator... Your program should load on the stock emulator.


Checkbox

Quick question (and potentially a fairly simple one).

I'm putting together a simple enough app that involves calculating a number of inputs. Each input is multiplied by a number, and all are added together. Most inputs are textual, and it works fine.

However, some of these inputs are checkboxes. If the box is checked, I need the input to be a 1, if not checked, the input is a 0. 

It seems to me like it's a fairly straightforward thing, but I can't seem to find out how to do this after searching all over. Does it involve setting up a variable or something?



All depends upon what you want to do with that input.  Here I used a global variable but the logic would be the same with many different possibilities like changing a label's text, or a textbox's text etc:




Thanks a lot for the reply.
 
I've added a shot of the block I'm working on. The gaps are where I need to put the 1 or 0 (based on the checkbox result).

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAi0AAAF1CAIAAACrvk0iAAAgAElEQVR4nOydd1yT1/7Hae+9HbftbW/v7W61Kip7hg1hqrhFAUW2LGUkEEBABEVFVkLYe2+y92KGHXhCAmGEvRWQIe5qLb8/wAEGR9vb8Ws+r8/Ll3nmOQ/
~~~~~~~~~~~~~~~~~~~~~~~~
z0jlz3wGlIFNlIyImNX6GcbYQzzretXbNmISeo557nvr5L6i1LlRZJeW4jPr589Tzz42qaM+u/tTjHWaGpkQgKmdzKvb4cP993uHHH51u33EMjnDZwMkEEdkTeMjcNbOsvs1g7rhy48EcnoM39Ypgwhat90mUhxRSnkkdu+Nb9h5snWMS2qFIMuBofUxRR3BBvy4PiRW0h+Y9aA
...



Sorry, screenshot didn't show up.

I've attached it here.




Here you go.. adapt it to your blocks:



you also can use the following blocks and add them directly into your current blocks




While that's a nice solution, he'd need 3 sets of those in his existing block code when he really only needs to set it once...



@Enis: it has been said
some of these inputs are checkboxes. If the box is checked, I need the input to be a 1, if not checked, the input is a 0. 
which means, there is more than 1 checkbox...


point taken...



Thanks guys. That works really nicely. I press submit and I get the final sum on the screen, printed in a "blank" label that I have.

While we're on a roll here.... :P

The next level of complexity that I have is a two-parter:

1. When I press "Submit", I want to open a new screen, and display the numerical result there.

2. Finally, I want to use a variable to print a pre-defined statement. If the result is <1, then print statement A, if it's >1, print statement B.


Any ideas?


Aircraft Weight & Balance


So, I am in commercial Helicopter pilot school, I have been looking for a Bell 206L3 weight and balance program out there somewhere,and it just isn't there.  So in my infinite wisdom, I decided I would try to make one... Yeah after the tutorials and countless all-nighters I am hitting a wall.  I made a drawing board in photoshop of what I wish to accomplish, and so far all I can get to work is the basic calculations on screen 2.  I'm trying to incorporate a database using lists, but it's just not clicking for some reason.  I have read every topic I can find on this in the forums, think I need a Barney style idiot-proof description or pictures.  Any help would be appreciated.  I'll attach the drawing board and what I have so far.  After I finally get this part functioning I need to add one more screen to display Center of Gravity graphs to display limits.  This is my intro into Java and I think I took a HUGE bite...  Thanks all



--
First of all, AI2 does not help you to bite into Java and you should be thankful for that! Maybe you can really start doing Java by the time you think the app you are trying to make now was a piece of cake.

Why don't you take things step by step?
Start with completing the code in screen 2. You probably want to have a global variable that is going to contain a list with all the items in your template for one plane. You should also have a TinyDB in this screen, where you can put this list when you press save. As tag you probably want to use the tail number, I suppose it is unique. When you are ready with this, you can go to screen 3. Here you also want a TinyDB and automagically it will contain what you have saved in screen2. Instead of those balls, maybe you want a ListView, that you can use to display the tail numbers you have saved so far and you could find the details as you have saved them in the TinyDB. When you have all this working, you probably know how to continue.
So again, step by step, try something for screen 2, and if you get stuck, post again.

--
Thanks for the input, as for the "balls" I just have the number in them right now and they are hidden until populated.  What I am working on is using TinyDB to call the tailnumber and record number saved from screen 2, making the 1(for instance) visible, and replacing 1 with the tail number entry for record #1, so there will be a blank screen until it is populated with aircraft.  Then as they become visible, the button will appear with the tailnumber as their text.  That way I can populate another area with that pre-loaded weight/cg/and mom to do the later required calculations and graphing.  I would like to complete one page at a time, but the amount of cross-referencing required for the different data is mind blowing.  But hey a lot of time spent now should save me time later right? :)


--

OK, first thing I'll say... you're not biting into Java at all... AI doesn't use it.  You'll be able to play with the blocks, and add actions and stuff via the blocks, but this is not in any way Java ;)!


Couple of things I see right away... Screen 2 should not be buttons, but a list view of available aircraft.  You'll do way too much work aligning things with the buttons, and it's really not necessary.

It's really difficult to see the code blocks and definition in your screenshots.

I believe you're using a TinyDB there.  That's fine. Again, if you use a ListView or a ListPicker for the list of aircraft, it'll make your life much easier cause you can assign the tags tot he ListPicker Elements.  One thing... you're saving on tag number, and I probably wouldn't do that. I would opt to save the records with the tag being a brief description of the craft and THEN a tag number... that way, you could group aircraft by type.

For the graphs in the end, you'll have to do everything on a canvas, drawing your graph manually line by line, then adding the data etc.

--
ok, so I am about 75% complete,now I am starting to get errors and I have been trying to figure out where.  It happens on initialization so I am assuming its in one of the hundreds of TinyDB calls... I have scoured and cannot see where the "dave" thing is coming from, any suggestions would be appreciated.






--

Wow... so think I figured it out finally... just was looking 1 too deep in database, removed the TinyDB calls and went straight to "global personnel" and bingo!


--
Dave... The message says you're trying to get item two from something that only has one.


You're overworking this... In screen.initialize, get the value from default personnel, which will be a list and store that value to the list.  Then, use the list you store the default_personnel data to to extract everything.  Don't make constant calls to the TinyDB... it's not necessary.

Oops... just saw your new post... yes, you were going too deep...

--
is there an easier way to draw? I have like 2200 blocks to get the graphs I want... I hope its not mandatory lol..   and I only end up with this...











--
I'm getting no errors in the AI companion, as soon as I bundle it to APK it starts and gives me this...I just cant win...



--


There are several things you can do... For example, for the horizontal and vertical lines, you can have 4 statements in each of two loops that just increments the coordinates every time it loops.  Instead of 14 sets of three blocks for the vertical lines, you could do that with one loop of a total of 16 blocks...  For example, here's one loop....  You can do the same for the lateral stuff too.

--
As you realize, the Canvas is not a Drawing program.  You are doing some neat things, however rather than draw the entire Canvas image, just draw part of it with AI2 and the rest with the graphics program you might have on your PC.

Being able to use a 'calibrated' Canvas.BackgroundImage to draw on might work depending on how you need to use these images within your app.  It appears these diagrams you are drawing from scratch are either sophisticated histograms  or  a nomogram. If you use a background template, the Canvas dimensions must be identical to the graph dimensions to keep this simple and at the same time, will save you lots of blocks.

If you just need to 'fill-up' the vertical space, from bottom to top, you could then program the Canvas to display a line of width whatever you want, sequentially, using as many lines as needed where the 'line' width would vary if necessary as the stacking of lines proceeds up the graph (higher in the aircraft).   That could be done with the DrawLine on the Canvas or you could use a sprite (for the line) or several sprites. 

It is possible to do some neat things with the Canvas:

Consider using a scaled background image... sorry I do not have an example of that at the moment and forgot where in the forum I saw someone do exactly that.

--
Here's an example of a background scale ... Accelerometer tester

--
Basically what needs to be done on these images,is when you get your calculations back from that specific aircraft, with the pilot, passenger, fuel,and baggage info, it will display points and lines mapping out your center of gravity and it needs to be inside the limitations drawn so far,otherwise you will not have the adequate forward or rear control to land or takeoff.

--
Understand that Dave.  What is suggested is a way to simplify the drawing.   It may or may not work for you.


and the code looks something like this:

where the image is 325 x 215 ...   but you would have to figure that out yourself.

The Touched is used to help calibrate the background image ... it posts the x and y coordinates of points on the 'graph' template to the Title Bar.
What I would do to get the thing to fill in the upper regions is to change the x1 and x2 coordinates appropriately.    Of course, this may not be what you want to do with the graph.

At the moment, only you understand what you want to do.

--
That May help, but the graph will look more like this, it is a graphical representation of the change in center of gravity of the aircraft as you burn the available fuel.


--
you might want to take a look at http://www.chartjs.org/ and their line chart
I have an example which uses their pie chart here

--
Why is the visualization of the chart needed?

The chart might be encoded as a lookup table in the app,
a csv table with two columns:

1. Fuel in liters (0-500)
2. Fuselage station in inches or whatever.

This would be a list of lists, for use with the
lookup in pairs block, effectively taking in
fuel level and returning fuselage station readings.

If the app could convert one into the other, why would
the graph be needed?

--
Doable with Canvas most probably Dave.

If all you need are the red points and can live with straight-line curve (in green) between them this can be done probably fairly accurately on the AI2 Canvas.'

What the graph above has is 12 x 13 cells, place a 12 x 13 grid in the Canvas background like shown in the image I sent earlier, calibrate using the Touched block.    Do your calculations for the points in red.   Post them to the graph at the nodes using the Circle control; draw a line between them as required using the DrawLine

If you need the curvature, then either plot more points (pixel by pixel ..Canvas will do that) and you do not need the green lines.  This is simple trig and being able to plot coordinate to coordinate will help.

My 36 buttons with Scotts snap    https://groups.google.com/forum/#!searchin/mitappinventortest/36$20buttons/mitappinventortest/c7xYUTKFG_Q/hlwOMxsNm6oJ  shows a way to snap data to the grid if necessary..

--
@Abraham:  The graph is needed because before you fly, you need to know what your weight and CG will be at all times.  If you are going somewhere 40 miles away, you need to know what your CURRENT CG will be.  Each aircraft has it's own burn rate for fuel, each aircraft weights different amounts so starting values are different.  Be any flight you need to know you full fuel, empty fuel, most forward, and most aft CG(Center of gravity) and ensure your not outside of the operating limitations.  I want this app to plot the relevant data on this in the general shape of that diagram as the Bell 206 burn operations are basically that of which is shown.  There are also different ones depending on aircraft serial number which I already incorporated the discriminator for that.

--
@Steve: Yeah that straight line is livable.  I think I'll give that a try.  If I get stuck I'll Let ya know.  As for why the grids are different, that is just the fuel burn diagram, it gives different information but in the same way.  Overall that is what the basic shape of it should be after you calculate.  Because the 206 has 2 fuel tanks so it kind of teeter totters back and forth gradually as you burn fuel.  Thanks

--
Ok, here is a weird error for you... When I save something in the listpicker, then later in the same instance of the program delete it, next time I go to the listpicker screen, it flashes on and off REALLY fast I have to click like 50 times to finally get a selection in.  Any Idea how to prevent this?  Don't really have a way to get a picture of that... but I am making some killer progress on this thing... only one real error right now other then the blinky listpicker thing...workin it out though.



--
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.

PS: don't hesitate to start a new thread for new questions next time...

--
As I said in the last message, it's not really possible to get a screenshot of the error...It flashes at like 50-60 times per second like it is trying to close the listpicker and re-open it a bunch of times, but I have no idea why it would do that.  I'll include the coding for the listpicker and the delete box because those should be the only things affecting that option...

--
Do you have a timer running?  If so, what's the interval set to?

--
nope

--
You MUST have some recursion going on there... Just look for anything that triggers a listpicker or a choice of some sort and that should lead you to your recursion.